﻿    :root {
      color-scheme: light;
      --ink: #172334;
      --muted: #5c6d80;
      --dim: #7a8a9b;
      --bg: #f4f7fb;
      --panel: #ffffff;
      --panel-raised: #eef3f8;
      --line: #d7e0ea;
      --lime: #df6d18;
      --cyan: #1477c9;
      --coral: #d84e35;
      --violet: #7655c9;
      --radius: 14px;
      font-family: Bahnschrift, "Aptos Display", "Trebuchet MS", sans-serif;
      font-synthesis: none;
    }
    * { box-sizing: border-box; }
    body { margin: 0; min-height: 100vh; background: linear-gradient(155deg, #f7f9fc 0%, #edf3f8 100%); color: var(--ink); }
    button, input, select { font: inherit; }
    .auth-screen { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 0%, #152b43 0, #08111f 62%); overflow: auto; }
    .auth-card { width: min(100%, 430px); padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: rgba(16,28,43,.96); box-shadow: 0 24px 80px #0008; }
    .auth-card h1 { margin: 8px 0; letter-spacing: .08em; }
    .auth-card h1 span { color: var(--lime); }
    .auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 22px 0 16px; padding: 4px; border-radius: 10px; background: var(--bg); }
    .auth-tabs button { border: 0; border-radius: 7px; padding: 10px 8px; color: var(--muted); background: transparent; cursor: pointer; }
    .auth-tabs button.active { color: var(--ink); background: var(--panel-raised); }
    .auth-error { min-height: 18px; margin: 0; color: var(--coral); font-size: 13px; }
    body.auth-locked .app-shell { display: none; }
    body.auth-locked .bottom-nav, body.auth-locked .modal-backdrop { display: none; }
    .launch-screen { display: none !important; }
    body.auth-ready .auth-screen { display: none; }
    .habit-goal-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; }
    .habit-goal-grid .habit-row { min-height:154px; grid-template-columns:38px minmax(0,1fr) auto; align-content:center; }
    .habit-goal-grid .habit-info h3 { white-space:normal; line-height:1.25; }
    .habit-goal-grid .habit-info p { line-height:1.45; }
    .habit-goal-grid .habit-info .bar { margin-top:14px; height:8px; }
    .habit-progress-dashboard { margin-top:28px; padding-top:22px; border-top:1px solid var(--line); }
    .streak-dots { display:grid; grid-template-columns:repeat(10, 1fr); gap:8px; }
    .streak-day { display:grid; justify-items:center; gap:6px; color:var(--muted); font-size:9px; }
    .streak-day i { width:28px; aspect-ratio:1; border-radius:50%; border:2px solid var(--line); background:#2b3542; }
    .streak-day.is-partial i { background:#e4bd38; border-color:#e4bd38; }
    .streak-day.is-complete i { background:#48c878; border-color:#48c878; }
    .mountain-chart { display:grid; gap:8px; margin-top:20px; }
    .mountain-day { display:grid; grid-template-columns:58px minmax(0,1fr); align-items:end; gap:10px; min-height:58px; }
    .mountain-label { color:var(--muted); font-size:10px; text-align:right; }
    .mountain-peaks { display:flex; align-items:end; gap:5px; min-height:52px; padding:0 7px 3px; border-bottom:1px solid var(--line); }
    .mountain { position:relative; flex:1 1 0; min-width:12px; height:calc(14px + var(--progress) * 0.38px); max-height:48px; background:linear-gradient(145deg,#d75b55,#7c2832); clip-path:polygon(50% 0,100% 100%,0 100%); }
    .mountain.is-complete { background:linear-gradient(145deg,#62d98a,#218c5a); }
    .mountain::after { content:""; position:absolute; left:50%; bottom:calc(var(--progress) * .38px); width:8px; height:8px; transform:translate(-50%,50%); border-radius:50%; background:#fff; box-shadow:0 0 0 2px #111a; }
    .celebration-backdrop { position:fixed; inset:0; z-index:60; display:grid; place-items:center; background:#05080dcc; opacity:0; pointer-events:none; transition:opacity .2s; }
    .celebration-backdrop.show { opacity:1; pointer-events:auto; }
    .celebration-card { width:min(90vw,360px); padding:28px 22px; border:1px solid #48c87899; border-radius:18px; background:var(--panel); text-align:center; box-shadow:0 20px 80px #000a; animation:celebrate-pop .35s ease both; }
    .celebration-icon { font-size:50px; animation:celebrate-bounce .8s ease infinite alternate; }
    .celebration-card h2 { margin:10px 0 7px; font-size:23px; }
    .celebration-card p { color:var(--muted); font-size:13px; }
    @keyframes celebrate-pop { from { transform:scale(.8); opacity:0; } to { transform:scale(1); opacity:1; } }
    @keyframes celebrate-bounce { from { transform:translateY(0) rotate(-6deg); } to { transform:translateY(-8px) rotate(6deg); } }
    @media (max-width:640px) { .habit-goal-grid { grid-template-columns:1fr; } }
    button { color: inherit; }
    .app-shell { width: min(100% - 32px, 1120px); margin: 0 auto; padding: max(26px, env(safe-area-inset-top)) 0 calc(100px + env(safe-area-inset-bottom)); }
    .topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 30px; }
    .brand { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 800; letter-spacing: 1.2px; }
    .brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--lime); color: var(--lime); transform: rotate(45deg); border-radius: 9px 3px 9px 3px; }
    .brand-mark span { transform: rotate(-45deg); font-size: 17px; }
    .icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
    .icon-svg { display: inline-block; width: 1.25em; height: 1.25em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .top-actions { display: flex; align-items: center; gap: 10px; }
    .timer-dock { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 9px; border: 1px solid #ff9a426e; border-radius: 10px; color: #ffb05b; background: #ff922e14; cursor: pointer; font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
    .timer-dock[hidden] { display: none; }
    .timer-dock .icon-svg { width: 16px; height: 16px; }
    .timer-dock.paused { border-color: #6984a1; color: #c1d2e6; background: #31506e33; }
    .icon-button { border: 1px solid var(--line); background: var(--panel); width: 42px; height: 42px; border-radius: 12px; cursor: pointer; color: var(--muted); }
    .icon-button:hover, .icon-button:focus-visible { color: var(--lime); border-color: var(--lime); }
    .avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #141a16; background: var(--lime); font-weight: 800; cursor: pointer; border: 0; }
    .avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
    main { min-height: 60vh; }
    .page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 23px; }
    .eyebrow { color: var(--lime); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.3px; margin: 0 0 9px; }
    h1 { font-size: clamp(29px, 6vw, 42px); line-height: 1.05; letter-spacing: 0; margin: 0; font-weight: 750; }
    h2 { font-size: 17px; letter-spacing: 0; margin: 0; }
    h3 { font-size: 14px; letter-spacing: 0; margin: 0; }
    p { margin: 0; }
    .muted { color: var(--muted); }
    .tiny { color: var(--muted); font-size: 12px; }
    .section { margin-top: 25px; }
    .section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
    .section-title button { font-size: 12px; }
    .grid { display: grid; gap: 14px; }
    .home-grid { grid-template-columns: minmax(0, 1.18fr) minmax(280px, .82fr); align-items: stretch; }
    .panel { background: linear-gradient(145deg, #14253a, #101a28 70%); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
    .progress-panel { position: relative; overflow: hidden; min-height: 208px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(115deg, #142b46 0%, #101b2c 56%, #101724 100%); }
    .progress-panel::after { content: ""; position: absolute; width: 48%; height: 62%; right: -2%; bottom: -3%; background: linear-gradient(145deg, #287acb44, #0b1421 78%); clip-path: polygon(0 100%, 17% 56%, 32% 75%, 54% 26%, 67% 54%, 82% 18%, 100% 53%, 100% 100%); pointer-events: none; }
    .progress-panel > * { position: relative; z-index: 1; }
    .metric-row { display: flex; align-items: center; gap: 20px; }
    .ring { --progress: 0deg; width: 118px; height: 118px; flex: 0 0 auto; display: grid; place-items: center; position: relative; border-radius: 50%; background: conic-gradient(var(--lime) var(--progress), #263b55 0); box-shadow: 0 0 22px #ff922e22; }
    .ring::before { content: ""; width: 94px; height: 94px; position: absolute; border-radius: 50%; background: #111d2c; }
    .ring-inner { position: relative; text-align: center; }
    .ring-inner strong { font-size: 25px; display: block; line-height: 1; }
    .ring-inner span { font-size: 10px; color: var(--muted); }
    .metric-copy .big-number { font-size: 34px; font-weight: 800; letter-spacing: 0; }
    .metric-copy .label { font-size: 12px; color: var(--muted); }
    .bar { height: 6px; background: #263b55; border-radius: 99px; overflow: hidden; margin-top: 10px; }
    .bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--lime); transition: width .3s ease; }
    .war-panel { min-height: 208px; background: linear-gradient(105deg, #10243b 0%, #151a25 53%, #2a1c17 100%); border-color: #38536e; position: relative; overflow: hidden; }
    .war-panel::before { content: ""; position: absolute; width: 68%; height: 62%; right: -4%; bottom: 0; background: linear-gradient(145deg, #236cc144, #ff8c3022); clip-path: polygon(0 100%, 15% 47%, 28% 71%, 48% 21%, 63% 70%, 78% 37%, 100% 80%, 100% 100%); }
    .war-panel::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, #ff9a42aa, #3e9fff88, transparent); }
    .war-panel > * { position: relative; z-index: 1; }
    .war-tag, .badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #ff765e70; color: var(--coral); border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
    .score-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 24px 0 17px; text-align: center; }
    .score-row strong { font-size: clamp(23px, 5vw, 32px); }
    .score-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
    .score-row .versus { color: var(--dim); font-size: 11px; font-weight: 800; }
    .score-row .home-score { color: var(--lime); }
    .row { display: flex; align-items: center; gap: 12px; }
    .between { justify-content: space-between; }
    .habit-list { display: grid; gap: 9px; }
    .habit-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid #263d58; border-radius: 12px; background: linear-gradient(110deg, #132338, #0e1826); }
    .habit-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--cyan); background: #38a8ff18; font-size: 18px; font-weight: 800; }
    .habit-icon .icon-svg { width: 21px; height: 21px; }
    .habit-info { min-width: 0; }
    .habit-info h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .habit-info p { margin-top: 4px; font-size: 11px; color: var(--muted); }
    .habit-actions { display: flex; align-items: center; gap: 7px; }
    .habit-value { text-align: right; min-width: 58px; color: var(--muted); font-size: 11px; }
    .check-button { width: 35px; height: 35px; border-radius: 10px; border: 1px solid #47524a; color: var(--lime); background: transparent; cursor: pointer; }
    .check-button.done { background: var(--lime); color: #17120d; border-color: var(--lime); }
    .action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: 10px; padding: 0 14px; border: 1px solid transparent; cursor: pointer; font-size: 12px; font-weight: 800; transition: transform .15s, background .15s; }
    .action:hover { transform: translateY(-1px); }
    .primary { background: linear-gradient(105deg, #ff9d38, #ff762e); color: #1b120b; box-shadow: 0 5px 16px #ff8b3024; }
    .secondary { background: linear-gradient(135deg, #172c43, #142236); border-color: #355373; color: var(--ink); }
    .quiet { background: transparent; color: var(--muted); border-color: transparent; padding-inline: 8px; }
    .danger { color: var(--coral); border-color: #ff765e55; background: #ff765e0c; }
    .full { width: 100%; }
    .quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .quick-actions .action { flex: 1 1 135px; }
    .filters { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #101416; }
    .filters button { border: 0; background: transparent; color: var(--muted); padding: 8px 11px; border-radius: 8px; font-size: 11px; cursor: pointer; }
    .filters button.active { background: var(--lime); color: #10150a; font-weight: 800; }
    .catalog-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, .75fr); align-items: center; gap: 14px; padding: 14px; border: 1px solid #2b4563; border-radius: 13px; background: linear-gradient(110deg, #152b43, #111b2b); margin-bottom: 15px; }
    .catalog-picker p { margin-top: 4px; font-size: 12px; }
    .catalog-picker label { display: grid; gap: 5px; }
    .catalog-picker label span { color: var(--muted); font-size: 10px; }
    .catalog-picker select { background: #0c1726; border-color: #375675; }
    .notice { padding: 11px 13px; border: 1px solid #62d9ce50; background: #62d9ce0c; color: #b7e7e2; border-radius: 11px; font-size: 11px; line-height: 1.5; }
    .empty { border: 1px dashed #3a4548; border-radius: 12px; padding: 24px 16px; text-align: center; color: var(--muted); font-size: 12px; }
    .empty strong { color: var(--ink); display: block; font-size: 14px; margin-bottom: 6px; }
    .leaderboard { display: grid; gap: 8px; }
    .leader { display: grid; grid-template-columns: 30px 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); background: linear-gradient(110deg, #132338, #0e1826); border-radius: 11px; }
    .leader.me { border-color: #ff922e; background: linear-gradient(110deg, #3b291c, #172336); }
    .rank-number { color: var(--dim); font-size: 13px; font-weight: 800; }
    .leader:first-child .rank-number { color: var(--cyan); }
    .person-avatar { width: 34px; height: 34px; display: grid; place-items: center; background: linear-gradient(145deg, #245587, #2b3044); color: #ddecff; border: 1px solid #5281aa; border-radius: 50%; font-size: 11px; font-weight: 800; }
    .leader-score { font-variant-numeric: tabular-nums; font-weight: 800; }
    .team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
    .team { border: 1px solid var(--line); background: #111619; border-radius: 12px; padding: 12px; }
    .team h3 { margin-bottom: 10px; }
    .team ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--muted); font-size: 11px; }
    .team li { display: flex; justify-content: space-between; gap: 7px; }
    .team:first-child h3 { color: var(--cyan); }
    .team:last-child h3 { color: var(--coral); }
    .war-screen { overflow: hidden; position: relative; border-color: #315577; background: radial-gradient(ellipse at 50% 30%, #1b436b 0, transparent 56%), linear-gradient(160deg, #10243b, #0b1422 68%, #171622); }
    .war-screen::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35; background: linear-gradient(135deg, transparent 42%, #ff8a2c18 42.2%, transparent 64%); }
    .war-screen > * { position: relative; z-index: 1; }
    .war-screen-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
    .war-screen-head .eyebrow { color: #ff9a42; }
    .war-time { color: #dce8f8; font-size: 10px; font-weight: 800; text-align: right; }
    .war-scoreboard { display: grid; grid-template-columns: minmax(0,1fr) 32px minmax(0,1fr); gap: 8px; align-items: center; margin: 20px 0 14px; }
    .war-side { text-align: center; min-width: 0; }
    .war-emblem { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 6px; border: 1px solid currentColor; clip-path: polygon(50% 0, 94% 19%, 87% 72%, 50% 100%, 13% 72%, 6% 19%); background: #2384db24; color: #52b1ff; }
    .war-side.orange .war-emblem { color: #ff9a42; background: #ff8a2c20; }
    .war-emblem .icon-svg { width: 27px; height: 27px; }
    .war-side strong { display: block; font-size: clamp(24px, 7vw, 35px); line-height: 1; color: #53b3ff; font-variant-numeric: tabular-nums; }
    .war-side.orange strong { color: #ff9a42; }
    .war-side small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
    .war-versus { color: #cad7e8; font-size: 12px; font-weight: 900; text-align: center; }
    .war-score-track { height: 7px; overflow: hidden; border-radius: 99px; background: #ff8a2c; }
    .war-score-track i { display: block; height: 100%; width: 51%; border-radius: inherit; background: linear-gradient(90deg, #29a4ff, #1682dc); }
    .war-score-caption { margin: 6px 0 18px; text-align: center; color: #bfcee0; font-size: 10px; }
    .war-board-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
    .war-board-heading strong { font-size: 11px; text-transform: uppercase; }
    .war-board-heading span { color: var(--muted); font-size: 9px; }
    .hex-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: min(100%, 330px); margin: 0 auto 8px; }
    .hex-zone { aspect-ratio: 1.08; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 4px; border: 0; background: linear-gradient(145deg, #1879c9, #113960); color: #e7f5ff; text-align: center; filter: drop-shadow(0 3px 6px #0007); cursor: pointer; }
    .hex-zone:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }
    .hex-zone.orange { background: linear-gradient(145deg, #ff9a38, #b94d24); color: #fff3e7; }
    .hex-zone.neutral { background: linear-gradient(145deg, #536982, #243347); color: #e4ecf7; }
    .hex-zone:nth-child(5) { transform: scale(1.05); z-index: 1; }
    .hex-zone .icon-svg { width: 23px; height: 23px; }
    .hex-zone span { font-size: 8px; font-weight: 800; line-height: 1.1; text-transform: uppercase; }
    .war-board-note { margin: 5px auto 15px; max-width: 330px; text-align: center; color: #b6c4d6; font-size: 9px; line-height: 1.4; }
    .war-contribution { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid #375879; border-radius: 11px; background: linear-gradient(110deg, #142a42, #101b2a); }
    .war-contribution .person-avatar { border-color: #ffab5d; background: linear-gradient(145deg, #287ac0, #b75a2d); }
    .war-contribution strong { display: block; font-size: 11px; }
    .war-contribution small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
    .war-contribution-score { color: #ffad5c; font-size: 16px; font-weight: 900; white-space: nowrap; }
    .war-team-details { margin-top: 12px; border-top: 1px solid #31506e; }
    .war-team-details summary { padding: 12px 2px 2px; color: #cfe1f6; font-size: 11px; font-weight: 800; cursor: pointer; }
    .war-team-details .team-grid { margin: 12px 0; }
    .war-team-details .team { background: #0c1928; }
    .profile-hero { display: flex; align-items: center; gap: 16px; padding: 22px 16px; border: 1px solid #29415e; border-radius: 14px; background: linear-gradient(110deg, #17314b, #121c2c 68%, #241b1b); }
    .profile-avatar { width: 66px; height: 66px; border: 2px solid #ffad5c; color: #fff; display: grid; place-items: center; border-radius: 50%; font-size: 23px; font-weight: 800; background: linear-gradient(145deg, #24598a, #bd642b); box-shadow: 0 0 24px #378ce455; }
    .profile-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
    .profile-identity { min-width: 0; flex: 1; }
    .profile-identity h2 { overflow-wrap: anywhere; }
    .stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 15px; }
    .stat { border: 1px solid var(--line); background: #111619; border-radius: 11px; padding: 13px; }
    .stat strong { display: block; font-size: 21px; }
    .stat span { color: var(--muted); font-size: 10px; }
    .achievement-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
    .achievement { min-height: 94px; border: 1px solid var(--line); background: #111619; border-radius: 11px; padding: 12px 8px; text-align: center; }
    .achievement-icon { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto 8px; border: 1px solid #ff922e66; border-radius: 12px; color: #ffb057; background: #ff922e12; }
    .achievement-icon .icon-svg { width: 22px; height: 22px; }
    .achievement strong { display: block; font-size: 10px; }
    .achievement small { display: block; color: var(--muted); font-size: 9px; margin-top: 4px; }
    .bottom-nav { position: fixed; z-index: 4; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 24px), 540px); display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px; gap: 4px; background: #171d20ed; border: 1px solid #384143; border-radius: 16px; backdrop-filter: blur(16px); box-shadow: 0 10px 40px #0008; }
    .nav-button { min-width: 0; height: 53px; display: grid; align-content: center; justify-items: center; gap: 3px; color: var(--muted); border: 0; border-radius: 11px; background: transparent; cursor: pointer; font-size: 9px; }
    .nav-button .nav-icon { display: grid; place-items: center; font-size: 16px; line-height: 1; }
    .nav-button .icon-svg { width: 18px; height: 18px; }
    .nav-button.active { color: var(--lime); background: #c6ff0010; }
    .nav-button.war-nav .nav-icon { color: var(--coral); }
    .nav-button.active.war-nav { color: var(--coral); background: #ff765e12; }
    .screen { display: none; animation: appear .2s ease-out; }
    .screen.active { display: block; }
    @keyframes appear { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
    .modal-backdrop { position: fixed; z-index: 8; inset: 0; padding: 16px; display: none; place-items: center; background: #050708cb; backdrop-filter: blur(6px); }
    .modal-backdrop.open { display: grid; }
    .modal { width: min(100%, 460px); max-height: min(88vh, 760px); overflow: auto; border: 1px solid #3c4748; border-radius: 16px; padding: 20px; background: #151b1e; box-shadow: 0 25px 80px #0009; }
    .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
    .close-button { border: 1px solid var(--line); border-radius: 9px; width: 34px; height: 34px; background: transparent; cursor: pointer; color: var(--muted); }
    .form-grid { display: grid; gap: 13px; }
    label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
    input, select { width: 100%; min-height: 42px; border: 1px solid #394448; border-radius: 9px; padding: 0 11px; color: var(--ink); background: #0e1315; outline: none; font-size: 16px; }
    input:focus, select:focus { border-color: var(--lime); box-shadow: 0 0 0 2px #c6ff0020; }
    .days { display: flex; flex-wrap: wrap; gap: 6px; }
    .day-chip { position: relative; }
    .day-chip input { position: absolute; opacity: 0; pointer-events: none; }
    .day-chip span { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; font-size: 10px; color: var(--muted); cursor: pointer; }
    .day-chip input:checked + span { background: var(--lime); border-color: var(--lime); color: #10150a; font-weight: 800; }
    .toast { position: fixed; z-index: 12; bottom: 88px; left: 50%; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; border: 1px solid #465348; background: #1b2420; color: var(--lime); padding: 11px 15px; border-radius: 10px; font-size: 12px; transition: .2s; }
    .toast.show { transform: translate(-50%, 0); opacity: 1; }
    .log-list { display: grid; gap: 8px; }
    .log-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #111619; font-size: 11px; }
    .log-item strong { display: block; margin-bottom: 4px; font-size: 12px; }
    .log-points { color: var(--lime); font-weight: 800; white-space: nowrap; }
    .friend-feed { display: grid; gap: 8px; }
    .friend-event { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #263d58; border-radius: 11px; background: linear-gradient(110deg, #132338, #0e1826); }
    .friend-event .person-avatar { width: 32px; height: 32px; }
    .friend-event strong { display: block; font-size: 11px; }
    .friend-event small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
    .friend-event .event-kind { color: var(--cyan); }
    .friend-list { display: grid; gap: 8px; }
    .friend-contact { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #0e1928; }
    .friend-contact strong { display: block; font-size: 12px; }
    .friend-contact small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
    .footnote { margin-top: 15px; color: var(--dim); font-size: 10px; line-height: 1.5; }
    @media (max-width: 700px) {
      .app-shell { width: min(100% - 26px, 540px); padding-top: max(17px, env(safe-area-inset-top)); }
      .topbar { margin-bottom: 25px; }
      .home-grid { grid-template-columns: 1fr; }
      .progress-panel { min-height: 190px; }
      .war-panel { min-height: 194px; }
      .page-head { align-items: center; }
      .page-head .action { padding-inline: 10px; }
      .panel { padding: 15px; }
      .catalog-picker { grid-template-columns: 1fr; gap: 10px; }
      .catalog-picker .eyebrow { margin-bottom: 5px; }
    }
    @media (max-width: 390px) {
      .metric-row { gap: 13px; }
      .ring { width: 102px; height: 102px; }
      .ring::before { width: 80px; height: 80px; }
      .metric-copy .big-number { font-size: 29px; }
      .habit-row { gap: 8px; padding: 10px 8px; }
      .habit-actions { gap: 4px; }
      .habit-value { min-width: 49px; font-size: 10px; }
    }
    @media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
  

/* HabitWars refresh: clearer daily routine planner */
.daily-planner{padding:18px;border:1px solid #304b68;border-radius:20px;background:radial-gradient(ellipse at 100% 0%,#1c477033,transparent 42%),linear-gradient(145deg,#13263b,#0d1725);box-shadow:0 14px 36px #0002;margin-bottom:18px}
.planner-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.planner-heading h2{font-size:22px;letter-spacing:-.4px}.planner-subtitle{font-size:12px;color:var(--muted);margin-top:6px;line-height:1.45}
.planner-progress{display:grid;grid-template-columns:auto minmax(60px,1fr) auto;gap:12px;align-items:center;padding:12px 14px;border-radius:13px;background:#07132180;border:1px solid #29415b;margin-bottom:14px;font-size:11px;color:var(--muted)}.planner-progress strong{font-size:13px;color:var(--ink)}.planner-track{height:7px;border-radius:99px;overflow:hidden;background:#263b55}.planner-track i{display:block;width:0;height:100%;background:linear-gradient(90deg,#38a8ff,#ff922e);border-radius:inherit;transition:width .3s ease}.planner-progress>span{font-weight:800;color:var(--lime)}
.routine-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.routine-card{min-width:0;border:1px solid #29415b;border-radius:15px;background:#0a1523b8;overflow:hidden}.routine-card>header{display:flex;align-items:center;gap:10px;padding:13px 13px 11px;border-bottom:1px solid #233950}.routine-emoji{display:grid;place-items:center;width:36px;height:36px;flex:0 0 auto;border-radius:11px;background:#ff922e1c;font-size:18px}.routine-card h3{font-size:14px}.routine-card header p{font-size:10px;color:var(--muted);margin-top:4px}.routine-count{margin-left:auto;padding:5px 8px;border-radius:8px;background:#1c3045;color:#c9d9eb;font-size:10px;font-weight:800;white-space:nowrap}.routine-afternoon .routine-emoji{background:#38a8ff1e}.routine-evening .routine-emoji{background:#a884ff20}.routine-anytime .routine-emoji{background:#62d9ce1c}.routine-items{padding:5px 10px 8px}.routine-item{display:grid;grid-template-columns:46px minmax(0,1fr) 32px;align-items:center;gap:9px;padding:10px 2px;border-bottom:1px solid #22364b}.routine-item:last-child{border-bottom:0}.routine-time{font-size:11px;font-weight:800;color:#9ecfff;font-variant-numeric:tabular-nums}.routine-item-copy{min-width:0}.routine-item-copy strong{display:block;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.routine-item-copy small{display:block;margin-top:4px;color:var(--muted);font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.routine-check{width:30px;height:30px;border:1px solid #48617b;border-radius:10px;background:#122238;color:#9bb2c9;font-size:17px;cursor:pointer;transition:transform .15s,background .15s}.routine-check:hover{transform:scale(1.06);border-color:var(--lime)}.routine-check.checked{background:var(--lime);border-color:var(--lime);color:#17120d;font-weight:900}.routine-item.is-done .routine-item-copy strong{color:#a6b6c8;text-decoration:line-through;text-decoration-color:#63809a}.routine-empty{padding:14px 4px 10px;color:var(--muted);font-size:11px}.routine-empty button{border:0;background:none;color:var(--lime);font-weight:800;cursor:pointer;padding:3px 5px}.routine-time-fields label{min-width:0}.routine-time-fields input:disabled{opacity:.45}
.habit-row{transition:transform .16s,border-color .16s}.habit-row:hover{border-color:#426487;transform:translateY(-1px)}.check-button{font-size:17px;font-weight:800}.screen h1{letter-spacing:-.8px}.section-title h2{letter-spacing:-.2px}
@media(max-width:700px){.daily-planner{padding:13px;border-radius:16px}.planner-heading{align-items:flex-start;flex-direction:column}.planner-heading .action{width:100%}.planner-heading h2{font-size:20px}.routine-grid{grid-template-columns:1fr}.routine-card>header{padding:11px 12px 10px}.routine-item{padding:11px 2px}.planner-progress{grid-template-columns:auto minmax(30px,1fr) auto;gap:8px;padding:10px}.routine-items{padding-inline:12px}}
@media(prefers-reduced-motion:reduce){.routine-check,.habit-row,.planner-track i{transition:none}}

/* Objetivos y navegacion compacta */
.bottom-nav { grid-template-columns:repeat(2, minmax(0, 1fr)); width:min(calc(100% - 24px), 360px); }
.nav-button .nav-icon { width:36px; height:30px; border:1px solid #496782; background:#122234; }
.nav-button.active .nav-icon { border-color:currentColor; box-shadow:0 5px 14px #0004; }
.nav-button.war-nav .nav-icon { color:#67bdff; border-color:#3974a2; background:#15314a; }
.top-link { box-shadow:0 4px 12px #0003; }
.habit-menu { font-size:0 !important; display:grid; place-items:center; padding:0 !important; color:var(--muted); }
.habit-menu::before { content:none; }
.habit-menu .icon-svg { width:20px; height:20px; }
.habit-menu:hover { color:var(--ink); background:#29445e; }
#habitForm select[name="category"] option[value="other"] { display:none; }
.mountain-peaks { min-height:76px; align-items:end; gap:8px; }
.mountain { display:block; flex:1 1 0; min-width:64px; height:72px; background:none; clip-path:none; }
.mountain-svg { display:block; width:100%; height:100%; overflow:visible; }
.mountain-fill { fill:#a33d4d; stroke:#e68173; stroke-width:1.5; }
.mountain-snow { fill:#f7d9c3; opacity:.92; }
.mountain-progress-dot { fill:#fff; stroke:#101925; stroke-width:2; }
.mountain .mountain-progress-dot { filter:drop-shadow(0 1px 2px #0008); }
.mountain-svg.is-complete .mountain-fill { fill:#32885f; stroke:#80dfa2; }
.running-habit-card .bar { position:relative; height:10px; background:linear-gradient(90deg,#572832 0 50%,#5f5322 50% 99%,#214d38 99%); border:1px solid #ffffff18; }
.running-habit-card .bar > i { transition:width .45s ease, background .3s ease; box-shadow:0 0 12px currentColor; }
.running-habit-card .progress-bar-low > i { background:#dc5c5c !important; color:#dc5c5c; }
.running-habit-card .progress-bar-mid > i { background:#e3bd3b !important; color:#e3bd3b; }
.running-habit-card .progress-bar-complete > i { background:#4ed486 !important; color:#4ed486; }
.current-mountain-day { min-height:150px; grid-template-columns:58px minmax(0,1fr); }
.current-mountain-day .mountain-peaks { min-height:132px; }
.current-mountain-day .mountain { flex:0 1 240px; min-width:170px; height:126px; }
.mountain-art { position:relative; display:block; width:100%; height:100%; }
.mountain-image { display:block; width:100%; height:100%; object-fit:contain; object-position:center bottom; }
.mountain-art img { display:block; width:100%; height:100%; object-fit:contain; object-position:center bottom; }
.mountain-progress-dot { position:absolute; left:50%; width:16px; height:16px; transform:translate(-50%,-50%); border:3px solid #fff; border-radius:50%; background:#ff922e; box-shadow:0 2px 9px #0008, 0 0 0 2px #ff922e66; }
.mountain-progress-dot[aria-label*="100%"] { background:#4ed486; box-shadow:0 2px 9px #0008, 0 0 0 2px #4ed48688; }
.mountain-svg { filter:drop-shadow(0 10px 8px #0005); }
html[data-theme="light"] .running-habit-card .bar { background:linear-gradient(90deg,#f5d7d7 0 50%,#f5eabd 50% 99%,#d8f1df 99%); }
html[data-theme="light"] .nav-button .nav-icon { background:#edf5fb; border-color:#a9c4d9; }
html[data-theme="light"] .mountain-fill { fill:#c64f5d; stroke:#ac3749; }

/* Legibilidad y temas */
:root { --text-size: 15px; }
body { font-size: var(--text-size); background: radial-gradient(ellipse at 82% 0%, #183755 0, transparent 36rem), linear-gradient(155deg, #091323 0%, #080e18 55%, #10131b 100%); }
.theme-toggle { display:inline-flex; align-items:center; gap:7px; min-height:42px; padding:0 11px; border:1px solid var(--line); border-radius:12px; background:var(--panel); color:var(--ink); cursor:pointer; font-size:12px; font-weight:800; }
.theme-toggle:hover,.theme-toggle:focus-visible { border-color:var(--lime); color:var(--lime); outline:none; }
.theme-toggle-icon { font-size:17px; line-height:1; }
.theme-toggle-label { white-space:nowrap; }
.tiny { font-size:13px; }
.eyebrow { font-size:12px; }
h2 { font-size:20px; }
h3 { font-size:15px; }
.habit-info p,.catalog-picker p,.notice,.empty,.log-item,.team ul { font-size:13px; }
.action { font-size:13px; }
.filters button { font-size:13px; }
.habit-row { padding:14px; }
.nav-button { font-size:11px; }
.nav-button .icon-svg { width:20px; height:20px; }
.modal { padding:22px; }
html[data-theme="light"] { color-scheme: light; --ink:#172334; --muted:#5c6d80; --dim:#7a8a9b; --bg:#f4f7fb; --panel:#ffffff; --panel-raised:#eef3f8; --line:#d7e0ea; --lime:#df6d18; --cyan:#1477c9; --coral:#d84e35; --violet:#7655c9; }
html[data-theme="light"] body { background:linear-gradient(155deg,#f7f9fc 0%,#edf3f8 100%); color:var(--ink); }
html[data-theme="light"] .panel,html[data-theme="light"] .stat,html[data-theme="light"] .achievement,html[data-theme="light"] .team,html[data-theme="light"] .log-item { background:#fff; border-color:#d7e0ea; }
html[data-theme="light"] .progress-panel { background:linear-gradient(115deg,#eaf4ff,#fff); }
html[data-theme="light"] .war-panel { background:linear-gradient(105deg,#eef7ff,#fff4eb); border-color:#cbdceb; }
html[data-theme="light"] .habit-row,html[data-theme="light"] .leader,html[data-theme="light"] .friend-event { background:#fff; border-color:#d7e0ea; }
html[data-theme="light"] .secondary { background:#fff; border-color:#b9cde0; color:var(--ink); }
html[data-theme="light"] .filters { background:#edf2f7; }
html[data-theme="light"] .filters button.active { background:var(--lime); color:#fff; }
html[data-theme="light"] .catalog-picker { background:linear-gradient(110deg,#eaf5ff,#f7fbff); border-color:#c5dceb; }
html[data-theme="light"] .catalog-picker select,html[data-theme="light"] input,html[data-theme="light"] select { background:#fff; color:var(--ink); border-color:#bdccda; }
html[data-theme="light"] .notice { background:#eaf8f6; border-color:#b1ded8; color:#285f5c; }
html[data-theme="light"] .bottom-nav { background:#ffffffeb; border-color:#d4dee8; box-shadow:0 10px 35px #7790a533; }
html[data-theme="light"] .nav-button.active { background:#df6d1814; }
html[data-theme="light"] .daily-planner { background:linear-gradient(145deg,#edf7ff,#f8fbff); border-color:#c6dceb; }
html[data-theme="light"] .routine-card { background:#fff; border-color:#d7e3ed; }
html[data-theme="light"] .planner-progress { background:#fff; border-color:#d7e3ed; }
html[data-theme="light"] .routine-item { border-color:#e1e8ef; }
html[data-theme="light"] .routine-check { background:#f3f7fb; border-color:#b7c8d8; color:#5b7085; }
html[data-theme="light"] .ring::before { background:#fff; box-shadow:inset 0 0 0 1px #d7e0ea; }
html[data-theme="light"] .ring-inner strong, html[data-theme="light"] .ring-inner span { color:var(--ink); }
html[data-theme="light"] .profile-identity p[style*="color"] { color:var(--muted) !important; }
html[data-theme="light"] .profile-identity h2,
html[data-theme="light"] #profileName,
html[data-theme="light"] #homeTitle { color:var(--ink) !important; }
html[data-theme="light"] .profile-identity .tiny { color:var(--muted) !important; }
html[data-theme="light"] .profile-hero { background:linear-gradient(110deg,#ffffff,#eef5fb); border-color:#c6d7e5; }
html[data-theme="light"] .planner-progress { color:var(--muted); }
html[data-theme="light"] .routine-card header, html[data-theme="light"] .routine-item-copy strong { color:var(--ink); }
html[data-theme="light"] .modal { background:#fff; border-color:#d5e0ea; box-shadow:0 25px 80px #50647a33; }
html[data-theme="light"] .modal-backdrop { background:#1e2a3880; }
html[data-theme="light"] .team { background:#f8fafc; }
@media (max-width:700px) { .theme-toggle { padding:0 9px; } .theme-toggle-label { display:none; } h2 { font-size:19px; } }

/* Refinamiento visual: tipografía, contraste y lenguaje deportivo */
:root {
  --font-ui: "Montserrat", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --focus: #f7c948;
  font-family: var(--font-ui);
}
body { font-family: var(--font-ui); letter-spacing: .005em; }
h1, h2, h3, .brand, .action, .badge, .eyebrow, .nav-button { letter-spacing: .01em; }
h1 { font-weight: 850; letter-spacing: -.035em; }
h2 { font-weight: 800; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.brand-mark { background: linear-gradient(145deg, #ffb347, #ff6b35); color: #111827; border: 0; box-shadow: 0 6px 18px #ff8b3040; }
.brand-mark span { font-weight: 900; }
.icon-svg { stroke-width: 2.15; vector-effect: non-scaling-stroke; }
.habit-icon, .achievement-icon, .nav-icon, .war-emblem { filter: drop-shadow(0 3px 7px #0003); }
.habit-icon { background: linear-gradient(145deg, #38a8ff26, #ff922e18); border: 1px solid #5cb9ff45; }
.war-habit-card .habit-icon { background-image:linear-gradient(145deg,#38a8ff26,#ff922e18); }
.war-habit-card .habit-icon .icon-svg { display:inline-block; }
.check-button, .routine-check { font-weight: 900; font-size: 17px; }
.feed-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:-2px 0 11px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:linear-gradient(105deg,#12263c,#111c2b); }
.routine-presets { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
.routine-preset { display:inline-flex; align-items:center; gap:6px; min-height:34px; padding:0 10px; border:1px solid #477397; border-radius:999px; background:#10263b; color:#d5e7f8; cursor:pointer; font-size:11px; font-weight:700; }
.routine-preset:hover { border-color:var(--lime); color:var(--lime); transform:translateY(-1px); }
.war-habit-list { display:grid; gap:8px; margin:12px 0; }
.war-habit-card { display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:10px; padding:11px; border:1px solid #315577; border-radius:11px; background:linear-gradient(110deg,#122b45,#111b2a); }
.war-habit-card .habit-icon { width:34px; height:34px; }
.war-habit-card strong, .war-habit-card small { display:block; }
.war-habit-card small { margin-top:3px; color:var(--muted); font-size:10px; }
.war-habit-tag { color:var(--lime); font-size:10px; font-weight:800; white-space:nowrap; }
.feed-summary { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:11px; font-weight:700; }
.feed-pulse { width:8px; height:8px; border-radius:50%; background:var(--lime); box-shadow:0 0 0 5px #ff922e18, 0 0 14px var(--lime); }
.feed-toolbar .action { min-height:32px; padding-inline:9px; font-size:11px; }
.friend-event { transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.friend-event:hover { transform: translateX(3px); border-color:#5d8cb7; background:linear-gradient(110deg,#18334f,#101d2c); }
.friend-contact { min-height:56px; }
.friend-contact .icon-button { flex:0 0 auto; }
.launch-screen { position:fixed; inset:0; z-index:30; display:grid; place-items:center; align-content:center; gap:10px; padding:30px; text-align:center; color:#f6f8fc; background:linear-gradient(180deg,#030609d9,#030609f2),url('./assets/war-background.webp') center/cover; transition:opacity .45s ease, visibility .45s ease; }
.launch-screen.is-hidden { opacity:0; visibility:hidden; pointer-events:none; }
.launch-mark { width:76px; height:76px; display:grid; place-items:center; margin-bottom:8px; color:#ffae46; border:1px solid #ff9b3a; border-radius:24px 8px 24px 8px; transform:rotate(45deg); box-shadow:0 0 35px #ff8b3045; background:#0c1017cc; }
.launch-mark .icon-svg { width:42px; height:42px; transform:rotate(-45deg); }
.launch-kicker { margin-top:13px; color:#ffad4b; font-size:11px; font-weight:900; letter-spacing:2px; }
.launch-screen h1 { font-size:clamp(32px,9vw,58px); letter-spacing:.08em; }
.launch-screen h1 span { color:#ff963c; }
.launch-screen > p:not(.launch-kicker) { color:#aebdd0; font-size:13px; }
.launch-skip { min-height:42px; margin-top:12px; padding:0 24px; border:1px solid #ffab4d; border-radius:999px; background:#ff8b2f; color:#17100b; cursor:pointer; font-weight:900; }
.habit-library-intro { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:18px 0 11px; padding:14px; border:1px solid var(--line); border-radius:13px; background:linear-gradient(110deg,#142a43,#111c2b); }
.habit-library-intro .eyebrow { margin-bottom:5px; }
.habit-library-intro p:not(.eyebrow) { color:var(--muted); font-size:12px; line-height:1.45; }
.habit-library-intro > .icon-svg { width:34px; height:34px; color:var(--cyan); flex:0 0 auto; }
.score-rules { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.score-rule { display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:9px; padding:11px; border:1px solid var(--line); border-radius:11px; background:linear-gradient(110deg,#13263c,#101a28); }
.score-rule-icon { width:32px; height:32px; display:grid; place-items:center; border-radius:9px; color:var(--lime); background:#ff922e18; }
.score-rule-icon .icon-svg { width:18px; height:18px; }
.score-rule strong, .score-rule small { display:block; }
.score-rule small { margin-top:3px; color:var(--muted); font-size:10px; }
.score-rule b { color:var(--lime); font-size:11px; white-space:nowrap; }
.war-screen { background-image:linear-gradient(180deg,#07101bcc 0%,#091522d9 55%,#0a0d14f2 100%),url('./assets/war-background.webp'); background-position:center; background-size:cover; background-attachment:fixed; border-color:#2f78b0; box-shadow:inset 0 0 70px #0008, 0 15px 40px #0005; }
.war-screen::before { opacity:.5; background:linear-gradient(135deg,transparent 36%,#ff8a2c18 36.2%,transparent 58%),linear-gradient(45deg,transparent 45%,#168ce522 45.2%,transparent 65%); }
.hex-board { width:min(100%,430px); gap:9px; }
.hex-zone { filter:drop-shadow(0 4px 10px #000a); border:1px solid #64bfff; }
.hex-zone.orange { border-color:#ffb25f; }
.hex-zone.neutral { border-color:#aebdcb; }
.war-screen .hex-board { width:min(100%,760px); grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px 16px; margin:18px auto 12px; }
.war-screen .hex-zone { min-height:142px; aspect-ratio:1.16; border-radius:0; font-size:1em; }
.war-screen .hex-zone .icon-svg { width:42px; height:42px; }
.war-screen .hex-zone span { font-size:12px; letter-spacing:.08em; }
.war-screen .war-board-heading { max-width:760px; margin:0 auto 10px; padding-bottom:10px; border-bottom:1px solid #ff9a423d; }
.war-screen .war-board-heading strong { color:#f3f7fc; font-size:17px; letter-spacing:.06em; }
.war-screen .war-board-heading span { font-size:11px; }
.quick-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.quick-actions .action { min-height:50px; font-size:13px; line-height:1.2; }
.screen[id="screen-ranking"] .page-head { padding:18px 20px; border:1px solid #315577; border-radius:16px; background:linear-gradient(110deg,#122d49,#111a29 70%,#2b1c14); }
.screen[id="screen-ranking"] .leaderboard { gap:10px; }
.screen[id="screen-ranking"] .leader { min-height:64px; padding:13px 15px; }
.screen[id="screen-ranking"] .leader:first-child { border-color:#ffb347; box-shadow:0 0 22px #ff922e1c; }
.screen[id="screen-ranking"] .rank-number { font-size:16px; }
.screen[id="screen-ranking"] .leader-score { font-size:15px; }
html[data-theme="light"] .screen[id="screen-ranking"] .page-head { background:linear-gradient(110deg,#edf7ff,#fff8ef); border-color:#bed3e2; }
html[data-theme="light"] .war-screen .war-board-heading strong { color:#f3f7fc; }
html[data-theme="light"] .quick-actions .secondary { background:#fff; color:var(--ink); }
.bottom-nav { padding:8px; gap:5px; background:linear-gradient(145deg,#111b29f5,#0a111cf5); border:1px solid #3c5872; box-shadow:0 12px 42px #000b, inset 0 1px #ffffff12; }
.nav-button { position:relative; height:56px; border-radius:13px; transition:color .18s,background .18s,transform .18s; }
.nav-button .nav-icon { width:30px; height:30px; border-radius:10px; transition:transform .18s,background .18s; }
.nav-button .icon-svg { width:20px; height:20px; }
.nav-button.active { background:linear-gradient(145deg,#ff9f3c2b,#ff6d3020); color:#ffb35b; }
.nav-button.active .nav-icon { transform:translateY(-2px) scale(1.08); background:#ff922e22; }
.nav-button.war-nav.active { background:linear-gradient(145deg,#3d9dff2b,#ff71351c); color:#67bdff; }
.nav-button:hover { transform:translateY(-2px); color:var(--ink); }
html[data-theme="light"] .bottom-nav { background:linear-gradient(145deg,#fffffffa,#eef5fbfa); border-color:#bdcede; box-shadow:0 12px 42px #63809a35, inset 0 1px #fff; }
html[data-theme="light"] .nav-button.active { background:linear-gradient(145deg,#fff1df,#eaf5ff); color:#be5c13; }
.friend-search-intro { display:flex; align-items:center; gap:11px; padding:11px; margin-bottom:12px; border:1px solid #5cb9ff45; border-radius:12px; background:linear-gradient(110deg,#152e49,#171f2e); }
.friend-search-intro .achievement-icon { margin:0; flex:0 0 auto; }
.friend-search-intro strong, .friend-search-intro small { display:block; }
.friend-search-intro small { color:var(--muted); font-size:11px; margin-top:3px; }
.search-field { position:relative; display:flex; align-items:center; margin-bottom:13px; }
.search-field .icon-svg { position:absolute; left:13px; width:18px; height:18px; color:var(--muted); }
.search-field input { width:100%; padding-left:40px; }
.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; }
.achievement-list { grid-template-columns: repeat(4, 1fr); }
.achievement { display:flex; flex-direction:column; justify-content:center; }
.achievement.is-locked { filter:grayscale(.35); }
.achievement-icon { background:linear-gradient(145deg,#ffb34720,#38a8ff18); color:#ffc365; border-color:#ffb34766; }
.modal { max-height:min(86vh, 760px); overflow:auto; overscroll-behavior:contain; }
input, select { min-height:44px; }
.action.primary { background:linear-gradient(110deg,#ffb347,#ff7135); }
html[data-theme="light"] body { color:#172334; }
html[data-theme="light"] .feed-toolbar { background:linear-gradient(105deg,#f5fbff,#fff8f0); border-color:#cbd9e5; }
html[data-theme="light"] .friend-search-intro { background:linear-gradient(110deg,#eef8ff,#fff7ef); border-color:#c3dae9; }
html[data-theme="light"] .routine-preset { background:#fff; color:#31506b; border-color:#a9c4d8; }
html[data-theme="light"] .war-habit-card { background:linear-gradient(110deg,#f3f9ff,#fff); border-color:#c1d5e4; }
html[data-theme="light"] .habit-library-intro { background:linear-gradient(110deg,#f3f9ff,#fff8f0); border-color:#cbd9e5; }
html[data-theme="light"] .score-rule { background:#fff; border-color:#d4e0ea; }
html[data-theme="light"] .score-rule-icon { color:#bd5f12; background:#ff922e18; }

/* Restauración de iconos vectoriales: el atlas no mantiene bien el recorte en todos los tamaños. */
.habit-icon,
.habit-icon-training, .habit-icon-movement, .habit-icon-reading, .habit-icon-study,
.habit-icon-mindfulness, .habit-icon-nutrition, .habit-icon-sleep, .habit-icon-selfcare,
.habit-icon-creativity, .habit-icon-home, .habit-icon-planning, .habit-icon-social, .habit-icon-other {
  background-image:linear-gradient(145deg,#38a8ff26,#ff922e18);
  background-size:auto;
  background-position:center;
  border-color:#5cb9ff45;
}
.habit-icon .icon-svg { display:inline-block; }
html[data-theme="light"] .friend-event:hover { background:linear-gradient(110deg,#eef7ff,#fff); border-color:#91b5d2; }
html[data-theme="light"] .panel, html[data-theme="light"] .habit-row, html[data-theme="light"] .leader, html[data-theme="light"] .friend-event, html[data-theme="light"] .stat, html[data-theme="light"] .achievement, html[data-theme="light"] .team { box-shadow:0 5px 18px #58738b12; }
html[data-theme="light"] .filters { background:#eef3f8; }
html[data-theme="light"] .filters button.active { color:#fff; }
html[data-theme="light"] .icon-button, html[data-theme="light"] .theme-toggle { color:#41566c; }
html[data-theme="light"] .notice { color:#245d58; }
@media (max-width:700px) {
  .feed-toolbar { align-items:stretch; flex-direction:column; }
  .feed-toolbar .action { width:100%; }
  .achievement-list { grid-template-columns:repeat(2,1fr); }
  .top-actions { gap:6px; }
  .app-shell { width:min(100% - 22px,1120px); }
  .score-rules { grid-template-columns:1fr; }
  .habit-library-intro { align-items:flex-start; }
  .quick-actions { grid-template-columns:1fr; }
  .war-screen .hex-board { gap:8px 7px; }
  .war-screen .hex-zone { min-height:102px; }
  .war-screen .hex-zone .icon-svg { width:30px; height:30px; }
  .war-screen .hex-zone span { font-size:9px; }
}

/* BITA visual system */
:root {
  color-scheme: dark;
  --ink: #f5f7fb;
  --muted: #a4afbf;
  --dim: #748197;
  --bg: #111827;
  --panel: #182233;
  --panel-raised: #202c3d;
  --line: #2c394b;
  --lime: #ff782b;
  --cyan: #3989ff;
  --coral: #ff5b5b;
  --violet: #9c83ff;
  --radius: 18px;
  --font-display: "Space Grotesk", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ui: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-ui);
}

body {
  background:
    radial-gradient(ellipse at 86% 0%, #233755 0, transparent 34rem),
    radial-gradient(ellipse at 8% 35%, #15223a 0, transparent 42rem),
    #111827;
  color: var(--ink);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

h1, h2, h3, .brand, .metric-copy .big-number, .ring-inner strong {
  font-family: var(--font-display);
}

h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 700; letter-spacing: -.055em; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -.035em; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.eyebrow { color: #ff9a61; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.tiny { color: var(--muted); font-size: 12px; }

.app-shell {
  width: min(calc(100% - 48px), 1060px);
  padding-top: max(28px, env(safe-area-inset-top));
  padding-bottom: calc(108px + env(safe-area-inset-bottom));
}

.topbar { margin-bottom: 34px; }
.brand { gap: 12px; font-size: 15px; font-weight: 700; letter-spacing: .17em; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  transform: none;
  color: #fff;
  background: linear-gradient(145deg, #ff9656, #ff782b);
  box-shadow: 0 7px 22px #ff782b35;
}
.brand-mark span { transform: none; font-family: var(--font-display); font-size: 17px; }
.top-link, .theme-toggle, .icon-button {
  border-color: #354357;
  border-radius: 13px;
  background: #192437;
  box-shadow: none;
}
.top-link { color: #d3dbea; }
.top-link:hover, .top-link:focus-visible { color: #ff9a61; border-color: #ff782b; }
.avatar { color: #fff; background: linear-gradient(145deg, #3989ff, #2366ca); }
.top-actions { gap: 8px; }

.page-head { align-items: center; margin-bottom: 25px; }
.page-head h1 { line-height: 1.05; }
.page-head .eyebrow { margin-bottom: 8px; }
.page-head .tiny { text-align: right; }
.action {
  min-height: 44px;
  border-radius: 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.action.primary {
  color: #fff;
  background: linear-gradient(115deg, #ff8b45, #ff7023);
  box-shadow: 0 7px 20px #ff782b2b;
}
.action.primary:hover { box-shadow: 0 9px 24px #ff782b45; }
.action.secondary { color: #e8eef8; border-color: #36465d; background: #202c3d; }
.action.quiet { color: #aab8ca; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #65a2ff;
  outline-offset: 3px;
}

.habit-goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.habit-goal-grid .habit-card { grid-template-columns: minmax(0, 1fr); min-height: 0; align-content: initial; }
.habit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  min-height: 0;
  padding: 17px;
  overflow: hidden;
  border: 1px solid #2b3a4e;
  border-radius: 18px;
  background: linear-gradient(145deg, #1b2739, #161f2e 80%);
  box-shadow: 0 9px 26px #050a1326, inset 0 1px #ffffff08;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.habit-card:hover {
  transform: translateY(-2px);
  border-color: #425572;
  box-shadow: 0 13px 30px #050a1338, inset 0 1px #ffffff0b;
}
.habit-card-heading {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.habit-card-heading.is-compact { grid-template-columns: 46px minmax(0, 1fr); }
.habit-card .habit-icon {
  width: 46px;
  height: 46px;
  border: 1px solid #3989ff45;
  border-radius: 14px;
  color: #72acff;
  background: linear-gradient(145deg, #3989ff25, #3989ff0d);
  filter: none;
}
.habit-card-title { min-width: 0; }
.habit-card-title h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.habit-target { margin-top: 5px; color: var(--muted); font-size: 11px; }
.habit-target strong { margin-left: 3px; color: #dce5f2; font-weight: 600; }
.habit-card .habit-menu { width: 40px !important; height: 40px !important; border-radius: 12px; }
.habit-card-progress { min-width: 0; }
.habit-progress-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 44px;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.habit-progress-label strong { color: #e6edf7; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.habit-progress-label strong span { color: var(--muted); font-weight: 500; }
.habit-progress-label b { color: var(--ink); text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.habit-card .bar { height: 7px; margin-top: 9px; background: #2b3748; }
.habit-card .bar > i { transition: width .55s cubic-bezier(.2,.8,.2,1), background-color .25s ease; }
.habit-card .progress-bar-low > i { background: #f06464 !important; }
.habit-card .progress-bar-mid > i { background: #f2bf4d !important; }
.habit-card .progress-bar-complete > i { background: #43c98b !important; }
.habit-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.habit-status { display: inline-flex; align-items: center; gap: 7px; color: #d0d8e5; font-size: 11px; font-weight: 600; }
.habit-status i, .streak-legend i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f06464;
  box-shadow: 0 0 0 3px #f0646419;
}
.habit-status-partial .habit-status i { background: #f2bf4d; box-shadow: 0 0 0 3px #f2bf4d1c; }
.habit-status-complete .habit-status i { background: #43c98b; box-shadow: 0 0 0 3px #43c98b1c; }
.habit-status-paused .habit-status i { background: #8693a4; box-shadow: 0 0 0 3px #8693a41c; }
.habit-card .check-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 122px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #ff782b;
  border-radius: 12px;
  color: #fff;
  background: #ff782b;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 5px 15px #ff782b23;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.habit-card .check-button > span:first-child { font-size: 18px; line-height: 1; }
.habit-card .check-button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px #ff782b3c; }
.habit-card .check-button.done { border-color: #35ad78; background: #248b61; color: #fff; }
.habit-card .check-button:disabled { cursor: not-allowed; opacity: .58; box-shadow: none; }

.habit-progress-dashboard {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid #2b3a4e;
  border-radius: 20px;
  background: linear-gradient(145deg, #1a2638, #151e2c);
  box-shadow: 0 12px 32px #050a1326;
}
.habit-progress-dashboard > .section-title { margin-bottom: 17px; }
.habit-progress-dashboard .section-title h2 { font-size: 21px; }
.streak-overview { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.streak-current { display: inline-flex; align-items: center; gap: 9px; min-width: 112px; }
.streak-flame { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #ff782b45; border-radius: 13px; color: #ff975c; background: #ff782b15; }
.streak-flame .icon-svg { width: 19px; height: 19px; }
.streak-current strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 20px; line-height: 1; }
.streak-current small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.streak-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 13px; }
.streak-legend > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.streak-legend i { width: 7px; height: 7px; box-shadow: none; }
.streak-legend .legend-complete, .streak-day.is-complete i { background: #43c98b; }
.streak-legend .legend-partial, .streak-day.is-partial i { background: #f2bf4d; }
.streak-legend .legend-missed, .streak-day.is-missed i { background: #f06464; }
.streak-legend .legend-future, .streak-day.is-future i { background: #46566b; }
.streak-dots { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 7px; }
.streak-day {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 8px 2px 6px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--muted);
  font-size: 9px;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.streak-day i {
  width: 20px;
  height: 20px;
  border: 2px solid #f06464;
  border-radius: 50%;
  background: #f0646418;
  box-shadow: inset 0 0 0 4px #182233;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.streak-day.is-complete i { border-color: #43c98b; background: #43c98b; }
.streak-day.is-partial i { border-color: #f2bf4d; background: #f2bf4d; }
.streak-day.is-rest i { border-color: #59677a; background: #263246; }
.streak-day.is-future i { border: 1px dashed #607188; background: transparent; }
.streak-day.is-today { border-color: #3989ff55; background: #3989ff0d; color: #e4edfc; }
.streak-day.is-today i { transform: scale(1.08); box-shadow: 0 0 0 4px #3989ff18; }
.streak-day.is-complete.is-today i { animation: streak-pop .42s ease-out; }
.streak-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.streak-day small { color: var(--dim); font-size: 9px; line-height: 1; }
.streak-day.is-today small { color: #75aaff; font-weight: 700; }

.journey-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 20px 2px 8px; }
.journey-heading .eyebrow { margin-bottom: 4px; }
.journey-heading h3 { font-family: var(--font-display); font-size: 16px; }
.journey-completion { padding: 6px 9px; border: 1px solid #3989ff36; border-radius: 999px; color: #82b4ff; background: #3989ff12; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mountain-journey {
  position: relative;
  height: 205px;
  overflow: hidden;
  border: 1px solid #324258;
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 82% 17%, #ffb26720, transparent 24%),
    linear-gradient(180deg, #1b3049 0%, #202c3b 64%, #1c2837 100%);
  isolation: isolate;
}
.mountain-journey::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 18% 19%, #3989ff18, transparent 34%);
  content: "";
}
.journey-landscape { display: block; width: 100%; height: 100%; }
.journey-ground { fill: #26384a; }
.journey-face { fill: #10213a; fill-opacity: .18; }
.journey-snow { fill: #e9f2f4; fill-opacity: .92; }
.journey-trail {
  fill: none;
  stroke: #f8d4a9;
  stroke-width: 4;
  stroke-dasharray: 1 13;
  stroke-linecap: round;
  opacity: .92;
}
.journey-checkpoint { fill: #fff; stroke: #1c3048; stroke-width: 4; }
.journey-position {
  position: absolute;
  z-index: 2;
  top: var(--journey-y);
  left: var(--journey-x);
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px #fff3, 0 2px 9px #11182799, 0 0 18px #fff9;
  transform: translate(-50%, -50%);
  transition: left .7s cubic-bezier(.2,.8,.2,1), top .7s cubic-bezier(.2,.8,.2,1);
}

.bottom-nav {
  width: min(calc(100% - 32px), 350px);
  padding: 6px;
  gap: 6px;
  border: 1px solid #3a485a;
  border-radius: 19px;
  background: #151f2eeF;
  box-shadow: 0 12px 38px #050a1380, inset 0 1px #ffffff0c;
  backdrop-filter: blur(18px);
}
.nav-button { height: 51px; gap: 2px; border-radius: 14px; color: #98a6ba; font-size: 10px; font-weight: 600; }
.nav-button .nav-icon { width: 29px; height: 27px; border: 0; background: transparent; filter: none; }
.nav-button .icon-svg { width: 19px; height: 19px; }
.nav-button.active { color: #ff9a61; background: #ff782b17; }
.nav-button.active .nav-icon { background: transparent; box-shadow: none; transform: translateY(-1px); }
.nav-button.war-nav .nav-icon { color: #75aaff; border: 0; background: transparent; }
.nav-button.war-nav.active { color: #75aaff; background: #3989ff18; }
.nav-button:hover { color: var(--ink); transform: translateY(-1px); }

.panel, .habit-row, .leader, .stat, .achievement, .team, .log-item {
  border-color: var(--line);
}
.progress-panel {
  border-color: #31435b;
  border-radius: 20px;
  background: linear-gradient(130deg, #1d314b, #182334 76%);
}
.ring { background: conic-gradient(var(--lime) var(--progress), #34445a 0); box-shadow: 0 0 28px #ff782b20; }
.ring::before { background: #192538; }
.war-panel { border-color: #384b61; border-radius: 20px; }
.badge, .war-tag { font-family: var(--font-ui); }
.screen { transform-origin: center top; }
.screen.active { animation: appear .24s ease-out; }
.auth-card { border-color: #34445a; border-radius: 24px; background: #182233; }
.auth-card h1 { font-family: var(--font-display); letter-spacing: -.06em; }
.auth-card h1 span { color: var(--lime); }
.auth-tabs { background: #111827; }
.auth-tabs button.active { background: #26354a; }
.celebration-card { border-color: #43c98b66; border-radius: 22px; background: #192538; }
.celebration-icon { color: #ffb25d; }
.toast { border-color: #3a4b61; border-radius: 13px; background: #1b293b; }

@keyframes streak-pop {
  0% { transform: scale(.75); }
  65% { transform: scale(1.22); }
  100% { transform: scale(1.08); }
}

html[data-theme="light"] {
  color-scheme: light;
  --ink: #172334;
  --muted: #657387;
  --dim: #8390a1;
  --bg: #f4f7fb;
  --panel: #fff;
  --panel-raised: #edf2f8;
  --line: #dce3ec;
  --lime: #ff782b;
  --cyan: #3989ff;
  --coral: #db5252;
}
html[data-theme="light"] body { color: var(--ink); background: linear-gradient(155deg, #f8fafd, #edf2f8); }
html[data-theme="light"] .top-link,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .icon-button { color: #45566d; border-color: #d7e0eb; background: #fff; }
html[data-theme="light"] .habit-card {
  border-color: #e0e6ee;
  background: linear-gradient(145deg, #fff, #f8fafd);
  box-shadow: 0 8px 24px #31435b0d;
}
html[data-theme="light"] .habit-card:hover { border-color: #c2d0e0; box-shadow: 0 12px 26px #31435b18; }
html[data-theme="light"] .habit-target strong,
html[data-theme="light"] .habit-progress-label strong,
html[data-theme="light"] .habit-progress-label b,
html[data-theme="light"] .habit-status { color: #26364a; }
html[data-theme="light"] .habit-card .bar { background: #e9edf3; }
html[data-theme="light"] .habit-progress-dashboard { border-color: #dce3ec; background: linear-gradient(145deg, #fff, #f5f8fc); box-shadow: 0 10px 28px #31435b0d; }
html[data-theme="light"] .streak-day.is-today { border-color: #3989ff55; background: #3989ff0b; color: #26364a; }
html[data-theme="light"] .streak-day i { box-shadow: inset 0 0 0 4px #fff; }
html[data-theme="light"] .streak-day.is-complete i { box-shadow: none; }
html[data-theme="light"] .streak-day.is-partial i { box-shadow: none; }
html[data-theme="light"] .streak-day.is-rest i { box-shadow: inset 0 0 0 4px #fff; }
html[data-theme="light"] .streak-day.is-future i { background: transparent; box-shadow: none; }
html[data-theme="light"] .mountain-journey { border-color: #d5dfeb; background: linear-gradient(180deg, #eaf3ff, #dce7f1 72%, #d2e0eb); }
html[data-theme="light"] .journey-ground { fill: #c6d6e3; }
html[data-theme="light"] .journey-face { fill: #648099; fill-opacity: .17; }
html[data-theme="light"] .journey-trail { stroke: #fff; }
html[data-theme="light"] .journey-checkpoint { stroke: #dce8f3; }
html[data-theme="light"] .journey-position { border-color: #fff; background: #fff; box-shadow: 0 0 0 4px #3989ff4d, 0 2px 9px #17233466, 0 0 18px #fff; }
html[data-theme="light"] .bottom-nav { border-color: #d4dee9; background: #fffffff0; box-shadow: 0 10px 32px #4b617a2b, inset 0 1px #fff; }
html[data-theme="light"] .nav-button { color: #64748b; }
html[data-theme="light"] .nav-button.active { color: #c55d1b; background: #ff782b12; }
html[data-theme="light"] .nav-button.war-nav.active { color: #236bc2; background: #3989ff12; }
html[data-theme="light"] .progress-panel { background: linear-gradient(130deg, #e8f1ff, #fff); }
html[data-theme="light"] .ring::before { background: #fff; }
html[data-theme="light"] .war-panel { background: linear-gradient(105deg, #edf5ff, #fff5ed); }
html[data-theme="light"] .auth-card { background: #fff; }
html[data-theme="light"] .auth-tabs { background: #f1f4f8; }
html[data-theme="light"] .auth-tabs button.active { background: #e5ebf3; }
html[data-theme="light"] .celebration-card { background: #fff; }
html[data-theme="light"] .toast { border-color: #d9e2ec; background: #fff; }

.frequency-field {
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid #35445a;
  border-radius: 14px;
  background: #111a28;
}
.frequency-field legend { padding: 0 5px; color: var(--ink); font-size: 12px; font-weight: 700; }
.frequency-hint { margin: -2px 0 11px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.weekday-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.weekday-chip { position: relative; display: block; min-width: 0; cursor: pointer; }
.weekday-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.weekday-chip span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid #35445a;
  border-radius: 12px;
  color: #aab6c7;
  background: #1a2637;
  font-size: 12px;
  font-weight: 700;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}
.weekday-chip input:checked + span {
  border-color: #ff782b;
  color: #fff;
  background: linear-gradient(145deg, #ff8b45, #ff7023);
  box-shadow: 0 5px 13px #ff782b24;
}
.weekday-chip input:focus-visible + span { outline: 3px solid #65a2ff; outline-offset: 3px; }
.weekday-chip:active span { transform: scale(.96); }
.habit-status-rest .habit-status i { background: #8290a4; box-shadow: 0 0 0 3px #8290a41c; }
.habit-status-rest .check-button { border-color: #3a485a; color: #a4afbf; background: #263345; box-shadow: none; }
.habit-status-rest .check-button:disabled { opacity: 1; }
html[data-theme="light"] .frequency-field { border-color: #dce3ec; background: #f7f9fc; }
html[data-theme="light"] .frequency-field legend { color: #243248; }
html[data-theme="light"] .weekday-chip span { border-color: #d5deea; color: #53647b; background: #fff; }
html[data-theme="light"] .weekday-chip input:checked + span { border-color: #ff782b; color: #fff; background: linear-gradient(145deg, #ff8b45, #ff7023); }
html[data-theme="light"] .habit-status-rest .check-button { border-color: #d7e0eb; color: #68778c; background: #f0f3f7; }

@media (max-width: 760px) {
  .app-shell { width: min(calc(100% - 28px), 560px); padding-top: max(16px, env(safe-area-inset-top)); }
  .topbar { margin-bottom: 22px; }
  .page-head { gap: 12px; margin-bottom: 17px; }
  .page-head h1 { font-size: clamp(28px, 7.5vw, 34px); }
  .habit-goal-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .habit-card { gap: 12px; padding: 13px; border-radius: 16px; }
  .habit-card-heading { grid-template-columns: 44px minmax(0, 1fr) 38px; gap: 10px; }
  .habit-card .habit-icon { width: 44px; height: 44px; }
  .habit-card-title h3 { font-size: 15px; }
  .weekday-picker { gap: 5px; }
  .weekday-chip span { min-height: 40px; }
  .habit-progress-dashboard { margin-top: 20px; padding: 14px 12px; border-radius: 18px; }
  .habit-progress-dashboard > .section-title { margin-bottom: 13px; }
  .streak-overview { align-items: flex-start; }
  .streak-legend { justify-content: flex-end; gap: 7px 10px; max-width: 210px; }
  .streak-legend > span { font-size: 9px; }
  .streak-dots { gap: 2px; }
  .streak-day { padding-inline: 0; }
  .streak-day i { width: 18px; height: 18px; }
  .mountain-journey { height: 154px; }
  .journey-position { width: 15px; height: 15px; }
  .bottom-nav { bottom: max(8px, env(safe-area-inset-bottom)); width: min(calc(100% - 20px), 350px); }
  .app-shell { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  .app-shell { width: min(calc(100% - 22px), 560px); }
  .top-actions { gap: 5px; }
  .icon-button, .theme-toggle { width: 39px; min-width: 39px; height: 39px; min-height: 39px; padding: 0; justify-content: center; }
  .timer-dock { min-height: 36px; padding-inline: 6px; }
  .habit-progress-label { grid-template-columns: minmax(0, 1fr) auto 38px; gap: 5px; font-size: 10px; }
  .habit-progress-label strong, .habit-progress-label b { font-size: 11px; }
  .habit-card .check-button { min-width: 112px; min-height: 44px; padding-inline: 10px; }
  .streak-current { min-width: 95px; }
  .streak-legend { max-width: 186px; gap: 7px; }
  .streak-legend > span { font-size: 8px; }
  .streak-date { font-size: 7px; letter-spacing: -.025em; }
  .streak-day small { font-size: 8px; }
}

@media (max-width: 350px) {
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 27px; }
  .page-head .action { min-height: 42px; padding-inline: 10px; }
  .habit-card-heading { grid-template-columns: 40px minmax(0, 1fr) 36px; gap: 8px; }
  .habit-card .habit-icon { width: 40px; height: 40px; }
  .habit-card .habit-menu { width: 36px !important; height: 36px !important; }
  .habit-progress-label { grid-template-columns: minmax(0, 1fr) auto 34px; }
  .habit-card .check-button { min-width: 104px; }
  .streak-day i { width: 16px; height: 16px; }
  .streak-date { font-size: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .habit-card, .habit-card .bar > i, .habit-card .check-button, .streak-day, .streak-day i, .journey-position { transition: none !important; }
  .streak-day.is-complete.is-today i { animation: none; }
}

/* Inicio: diseño claro y compacto de progreso diario */
body.home-screen-active {
  --ink: #101b32;
  --muted: #627087;
  --dim: #8491a4;
  --bg: #fff;
  --panel: #fff;
  --line: #e7edf5;
  --cyan: #147fe8;
  color-scheme: light;
  background: #fff;
  color: #101b32;
}
body.home-screen-active .app-shell { width: min(calc(100% - 40px), 900px); padding: max(18px, env(safe-area-inset-top)) 0 calc(94px + env(safe-area-inset-bottom)); }
body.home-screen-active .topbar { margin-bottom: 20px; }
body.home-screen-active .brand { gap: 9px; color: #10203d; font-size: 23px; letter-spacing: 1.5px; }
body.home-screen-active .brand-mark { display: none; }
body.home-screen-active .bita-logo { width: 48px; height: 34px; }
body.home-screen-active .top-link,
body.home-screen-active .theme-toggle,
body.home-screen-active .timer-dock { display: none !important; }
body.home-screen-active .top-actions { gap: 12px; }
body.home-screen-active .icon-button#notificationsButton { position: relative; width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: #111b31; }
body.home-screen-active .icon-button#notificationsButton .icon-svg { width: 25px; height: 25px; }
body.home-screen-active .notification-dot { position: absolute; top: 5px; right: 6px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: #ff922e; }
body.home-screen-active .avatar { width: 46px; height: 46px; color: #176fcb; background: #eaf2fd; font-size: 16px; }
body.home-screen-active .home-hero { position: relative; display: flex; align-items: center; min-height: 184px; margin: 0 -2px 14px; overflow: hidden; }
body.home-screen-active .home-hero-copy { position: relative; z-index: 1; width: 74%; padding: 18px 0 24px; }
body.home-screen-active .home-hero h1 { max-width: 650px; font-size: clamp(29px, 5vw, 48px); line-height: 1.12; letter-spacing: -.04em; font-weight: 750; }
body.home-screen-active .home-hero-copy p { margin: 12px 0 0; color: #627087; font-size: clamp(17px, 2.5vw, 24px); line-height: 1.35; }
body.home-screen-active .home-hero-copy .tiny { display: none; }
body.home-screen-active .home-mountains { position: absolute; right: -9%; bottom: -6px; width: 49%; height: 164px; opacity: .8; }
body.home-screen-active .weekly-plan-card { position: relative; display: grid; grid-template-columns: 78px minmax(0, 1fr) 32px; align-items: center; gap: 18px; width: 100%; min-height: 124px; margin: 0 0 42px; padding: 22px 28px 22px 32px; overflow: hidden; border: 0; border-radius: 25px; background: #edf6ff; color: #111b31; text-align: left; cursor: pointer; }
body.home-screen-active .weekly-plan-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; border-radius: 6px; background: #1683ee; }
body.home-screen-active .weekly-plan-card:hover { background: #e6f2ff; }
body.home-screen-active .weekly-plan-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 22px; background: #dceeff; color: #1677dc; }
body.home-screen-active .weekly-plan-icon .icon-svg { width: 38px; height: 38px; stroke-width: 1.8; }
body.home-screen-active .weekly-plan-copy { display: grid; gap: 7px; min-width: 0; }
body.home-screen-active .weekly-plan-copy strong { font-size: clamp(21px, 3vw, 29px); line-height: 1.1; }
body.home-screen-active .weekly-plan-copy small { color: #627087; font-size: clamp(14px, 2vw, 19px); line-height: 1.35; }
body.home-screen-active .weekly-plan-arrow { width: 25px; height: 25px; color: #17243b; }
body.home-screen-active .home-progress-link { display: grid; grid-template-columns: 58px minmax(0, 1fr) 24px; align-items: center; gap: 14px; width: 100%; margin: -22px 0 34px; padding: 14px 18px; border: 1px solid #e8edf4; border-radius: 18px; background: #fff; color: #101b32; text-align: left; box-shadow: 0 2px 8px #18355308; cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s; }
body.home-screen-active .home-progress-link:hover { transform: translateY(-1px); border-color: #b8d7f8; box-shadow: 0 7px 20px #18355312; }
body.home-screen-active .home-progress-link-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: #eaf4ff; color: #147fe8; }
body.home-screen-active .home-progress-link-icon .icon-svg { width: 24px; height: 24px; }
body.home-screen-active .home-progress-link > span:nth-child(2) { display: grid; gap: 4px; }
body.home-screen-active .home-progress-link strong { font-size: 16px; }
body.home-screen-active .home-progress-link small { color: #627087; font-size: 13px; }
body.home-screen-active .home-progress-link-arrow { width: 19px; height: 19px; color: #8491a4; }
body.home-screen-active .home-day-section { margin: 0 0 38px; }
body.home-screen-active .home-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 17px; }
body.home-screen-active .home-section-heading h2 { margin: 0; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.04em; }
body.home-screen-active .home-week-link { display: inline-flex; align-items: center; gap: 9px; border: 0; padding: 8px 0 8px 8px; background: transparent; color: #627087; font-size: clamp(15px, 2vw, 19px); cursor: pointer; white-space: nowrap; }
body.home-screen-active .home-week-link .icon-svg { width: 21px; height: 21px; color: #24334c; }
body.home-screen-active .home-activities { padding: 8px 18px; border: 1px solid #e8edf4; border-radius: 25px; background: #fff; box-shadow: 0 2px 8px #18355308; }
body.home-screen-active .home-activity { display: grid; grid-template-columns: 94px minmax(0, 1fr) 64px; align-items: center; gap: 20px; min-height: 118px; padding: 12px 4px; }
body.home-screen-active .home-activity + .home-activity { border-top: 1px solid #edf0f5; }
body.home-screen-active .home-activity-icon { display: grid; place-items: center; width: 76px; height: 76px; margin-left: 8px; border-radius: 22px; }
body.home-screen-active .home-activity-icon .icon-svg { width: 42px; height: 42px; stroke-width: 1.8; }
body.home-screen-active .home-tone-blue { color: #147fe8; background: #eaf4ff; }
body.home-screen-active .home-tone-orange { color: #ed801d; background: #fff2e8; }
body.home-screen-active .home-tone-violet { color: #7545cf; background: #f3edff; }
body.home-screen-active .home-activity-copy { display: grid; gap: 6px; min-width: 0; }
body.home-screen-active .home-activity-copy strong { overflow: hidden; color: #101b32; font-size: clamp(20px, 3vw, 28px); line-height: 1.18; text-overflow: ellipsis; }
body.home-screen-active .home-activity-copy small { color: #627087; font-size: clamp(16px, 2.3vw, 20px); }
body.home-screen-active .home-check { display: grid; place-items: center; width: 56px; height: 56px; justify-self: center; border: 2px solid #d6deea; border-radius: 15px; background: #fff; color: #fff; font-size: 30px; font-weight: 700; cursor: pointer; transition: background .16s, border-color .16s, transform .16s; }
body.home-screen-active .home-check:hover:not(:disabled) { transform: scale(1.05); border-color: #1683ee; }
body.home-screen-active .home-check.is-complete { border-color: #1683ee; background: #1683ee; }
body.home-screen-active .home-check:disabled { cursor: default; }
body.home-screen-active .home-empty { display: grid; justify-items: start; gap: 10px; padding: 22px 14px; color: #627087; }
body.home-screen-active .home-empty strong { color: #101b32; font-size: 18px; }
body.home-screen-active .home-empty .action { margin-top: 4px; }
body.home-screen-active .home-week-progress { margin-bottom: 20px; padding: 24px 28px 28px; border: 1px solid #e8edf4; border-radius: 25px; background: #fff; box-shadow: 0 2px 8px #18355308; }
body.home-screen-active .home-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 21px; }
body.home-screen-active .home-progress-heading h2 { margin: 0; font-size: clamp(21px, 3vw, 28px); letter-spacing: -.03em; }
body.home-screen-active .home-progress-heading strong { font-size: clamp(23px, 3vw, 30px); white-space: nowrap; }
body.home-screen-active .home-progress-track { height: 18px; overflow: hidden; border-radius: 99px; background: #eaf1fa; }
body.home-screen-active .home-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #278cf3, #1683ee); transition: width .3s ease; }
body.home-screen-active .bottom-nav { position: fixed; z-index: 20; left: 0; bottom: 0; transform: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; width: 100%; max-width: none; padding: 9px 10px max(9px, env(safe-area-inset-bottom)); border: 0; border-top: 1px solid #e8edf4; border-radius: 0; background: #fffffff5; box-shadow: 0 -5px 22px #334e6b0d; backdrop-filter: blur(15px); }
body.home-screen-active .bottom-nav > .nav-button { display: grid !important; align-content: center; justify-items: center; gap: 4px; min-width: 0; height: 62px; border: 0; border-radius: 12px; background: transparent; color: #78859a; font-size: 12px; font-weight: 500; }
body.home-screen-active .bottom-nav > .nav-button .nav-icon { display: grid; place-items: center; width: 100%; height: 31px; border: 0; background: transparent; color: currentColor; }
body.home-screen-active .bottom-nav > .nav-button .icon-svg { width: 25px; height: 25px; stroke-width: 2; }
body.home-screen-active .bottom-nav > .nav-button.active { color: #147fe8; background: transparent; font-weight: 700; }
body.home-screen-active .bottom-nav > .nav-button.active .nav-icon { border: 0; box-shadow: none; }
body.home-screen-active .modal-backdrop { background: #14223866; }
body.home-screen-active .modal { border-color: #e7edf5; background: #fff; color: #101b32; box-shadow: 0 24px 80px #1027462e; }
body.home-screen-active .modal-head { border-color: #edf0f5; }
body.home-screen-active .modal-head h2 { color: #101b32; }
.week-plan-list { display: grid; gap: 10px; max-height: min(65vh, 560px); overflow: auto; }
.week-plan-day { padding: 12px 14px; border: 1px solid #e8edf4; border-radius: 14px; background: #fff; }
.week-plan-day h3 { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 8px; color: #101b32; font-size: 14px; text-transform: capitalize; }
.week-plan-day h3 time { color: #8491a4; font-size: 12px; font-weight: 500; }
.week-plan-day ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.week-plan-day li { display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; align-items: center; gap: 10px; color: #34445c; font-size: 13px; }
.week-plan-day li small, .week-plan-empty { margin: 0; color: #8491a4; font-size: 12px; }
.week-plan-day li b { color: #1683ee; text-align: center; }
.week-plan-day li.is-complete span { color: #8491a4; text-decoration: line-through; }
@media (max-width: 640px) {
  body.home-screen-active .app-shell { width: min(calc(100% - 32px), 540px); padding-top: max(14px, env(safe-area-inset-top)); }
  body.home-screen-active .topbar { margin-bottom: 10px; }
  body.home-screen-active .bita-logo { width: 43px; height: 31px; }
  body.home-screen-active .brand { font-size: 21px; }
  body.home-screen-active .home-hero { min-height: 150px; margin-bottom: 10px; }
  body.home-screen-active .home-hero-copy { width: 82%; padding: 15px 0 21px; }
  body.home-screen-active .home-hero h1 { max-width: 420px; font-size: clamp(27px, 7vw, 36px); }
  body.home-screen-active .home-hero-copy p { max-width: 310px; margin-top: 8px; font-size: 17px; }
  body.home-screen-active .home-mountains { right: -19%; bottom: -6px; width: 63%; height: 128px; opacity: .7; }
  body.home-screen-active .weekly-plan-card { grid-template-columns: 58px minmax(0, 1fr) 23px; gap: 13px; min-height: 94px; margin-bottom: 30px; padding: 15px 15px 15px 22px; border-radius: 20px; }
  body.home-screen-active .home-progress-link { grid-template-columns: 48px minmax(0, 1fr) 20px; gap: 11px; margin: -15px 0 25px; padding: 12px; border-radius: 16px; }
  body.home-screen-active .home-progress-link-icon { width: 42px; height: 42px; border-radius: 13px; }
  body.home-screen-active .home-progress-link strong { font-size: 15px; }
  body.home-screen-active .home-progress-link small { font-size: 12px; }
  body.home-screen-active .weekly-plan-icon { width: 56px; height: 56px; border-radius: 17px; }
  body.home-screen-active .weekly-plan-icon .icon-svg { width: 30px; height: 30px; }
  body.home-screen-active .weekly-plan-copy { gap: 5px; }
  body.home-screen-active .weekly-plan-copy strong { font-size: 20px; }
  body.home-screen-active .weekly-plan-copy small { font-size: 13px; }
  body.home-screen-active .home-day-section { margin-bottom: 27px; }
  body.home-screen-active .home-section-heading { margin-bottom: 12px; }
  body.home-screen-active .home-section-heading h2 { font-size: 28px; }
  body.home-screen-active .home-week-link { gap: 5px; font-size: 15px; }
  body.home-screen-active .home-activities { padding: 5px 12px; border-radius: 20px; }
  body.home-screen-active .home-activity { grid-template-columns: 64px minmax(0, 1fr) 46px; gap: 12px; min-height: 96px; padding: 10px 2px; }
  body.home-screen-active .home-activity-icon { width: 56px; height: 56px; margin-left: 2px; border-radius: 18px; }
  body.home-screen-active .home-activity-icon .icon-svg { width: 31px; height: 31px; }
  body.home-screen-active .home-activity-copy strong { font-size: 19px; }
  body.home-screen-active .home-activity-copy small { font-size: 15px; }
  body.home-screen-active .home-check { width: 44px; height: 44px; border-radius: 13px; font-size: 25px; }
  body.home-screen-active .home-week-progress { padding: 18px 17px 19px; border-radius: 20px; }
  body.home-screen-active .home-progress-heading { margin-bottom: 16px; }
  body.home-screen-active .home-progress-heading h2 { font-size: 20px; }
  body.home-screen-active .home-progress-heading strong { font-size: 22px; }
  body.home-screen-active .home-progress-track { height: 13px; }
  body.home-screen-active .bottom-nav { padding-inline: 5px; }
  body.home-screen-active .bottom-nav > .nav-button { height: 56px; font-size: 11px; }
}
@media (max-width: 360px) {
  body.home-screen-active .home-activity { grid-template-columns: 53px minmax(0, 1fr) 42px; gap: 9px; }
  body.home-screen-active .home-activity-icon { width: 49px; height: 49px; }
  body.home-screen-active .home-activity-icon .icon-svg { width: 27px; height: 27px; }
  body.home-screen-active .home-activity-copy strong { font-size: 17px; }
  body.home-screen-active .home-activity-copy small { font-size: 14px; }
  body.home-screen-active .home-check { width: 40px; height: 40px; }
}

.progress-page-head { margin-bottom: 20px; }
.progress-page-head .eyebrow { margin-bottom: 6px; }
.progress-level-card {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 3vw, 28px);
  border-color: #3a526e;
  background: radial-gradient(ellipse at 100% 0%, #3989ff22, transparent 38%), linear-gradient(130deg, #1a2a3e, #141e2c 72%);
}
.progress-level-card::after {
  position: absolute;
  top: -50px;
  right: -40px;
  width: 180px;
  height: 180px;
  border: 1px solid #ff782b1f;
  border-radius: 50%;
  box-shadow: 0 0 0 24px #ff782b09, 0 0 0 48px #3989ff08;
  content: "";
  pointer-events: none;
}
.progress-level-top, .progress-level-main, .progress-level-badge, .progress-mission-heading, .progress-mission-progress, .progress-mountain-modal-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.progress-level-badge {
  justify-content: flex-start;
  color: #ff9a61;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}
.progress-level-badge .icon-svg { width: 17px; height: 17px; }
.progress-xp-today { color: #ffb27b; font-size: 12px; font-weight: 700; }
.progress-level-main { align-items: flex-end; margin: 20px 0 16px; }
.progress-level-main h2 { margin: 2px 0 0; font-size: clamp(36px, 7vw, 52px); line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.progress-level-main h2 small { color: #ff9a61; font-family: var(--font-ui); font-size: 15px; letter-spacing: .04em; }
.progress-level-main .tiny { margin-top: 7px; }
.progress-level-next { display: grid; gap: 5px; max-width: 46%; text-align: right; }
.progress-level-next span, .progress-mountain-levels, .progress-mission-status {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.progress-level-next strong { color: var(--ink); font-size: 12px; }
.progress-xp-bar { display: block; width: 100%; height: 8px; overflow: hidden; border-radius: 999px; background: #344255; }
.progress-xp-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff782b, #ffb04f); box-shadow: 0 0 14px #ff782b55; transition: width .65s cubic-bezier(.2,.8,.2,1); }
.progress-level-footnote { margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.progress-section { margin-top: 24px; }
.progress-section > .section-title { margin-bottom: 12px; }
.progress-section > .section-title h2 { font-size: 19px; }
.progress-journey-card {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #30445e;
  border-radius: 18px;
  color: inherit;
  background: linear-gradient(145deg, #1b2b40, #151f2d);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.progress-journey-card:hover, .progress-journey-card:focus-visible { transform: translateY(-2px); border-color: #5685b3; box-shadow: 0 12px 30px #03081335; }
.progress-map {
  position: relative;
  height: clamp(172px, 25vw, 252px);
  overflow: hidden;
  border: 1px solid #354c68;
  border-radius: 13px;
  background: radial-gradient(ellipse at 82% 17%, #ffb26720, transparent 24%), linear-gradient(180deg, #1b3049, #202c3b 68%, #1c2837);
  isolation: isolate;
}
.progress-map::before { position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 18% 19%, #3989ff18, transparent 34%); content: ""; }
.progress-map .journey-landscape { width: 100%; height: 100%; }
.progress-map-position {
  position: absolute;
  z-index: 2;
  top: var(--journey-y);
  left: var(--journey-x);
  width: 17px;
  height: 17px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px #fff3, 0 2px 9px #11182799, 0 0 18px #fff9;
  transform: translate(-50%, -50%);
  transition: left .7s cubic-bezier(.2,.8,.2,1), top .7s cubic-bezier(.2,.8,.2,1);
  animation: progress-marker-glow 2.8s ease-in-out infinite;
}
.progress-map-level, .progress-map-hint {
  position: absolute;
  z-index: 3;
  bottom: 10px;
  padding: 6px 9px;
  border: 1px solid #ffffff24;
  border-radius: 999px;
  color: #f7fbff;
  background: #101c2cce;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.progress-map-level { left: 10px; }
.progress-map-hint { right: 10px; color: #ffc08f; }
.progress-map.is-expanded { height: clamp(235px, 44vw, 400px); }
.progress-journey-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; padding: 12px 5px 3px; }
.progress-journey-meta strong { color: var(--ink); font-size: 13px; }
.progress-journey-meta > span { grid-column: 1; color: var(--muted); font-size: 10px; }
.progress-journey-meta b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #82b4ff; font-size: 12px; }
.progress-consistency-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.progress-stat-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 3px 11px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #2c3d53;
  border-radius: 15px;
  background: linear-gradient(145deg, #1a2738, #151f2d);
}
.progress-stat-icon, .progress-achievement-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #ff782b3c;
  border-radius: 12px;
  color: #ff9a61;
  background: #ff782b13;
}
.progress-stat-icon .icon-svg, .progress-achievement-icon .icon-svg { width: 19px; height: 19px; }
.progress-stat-icon.blue { border-color: #3989ff45; color: #80b2ff; background: #3989ff14; }
.progress-stat-icon.orange { border-color: #ff782b45; color: #ff9a61; background: #ff782b14; }
.progress-stat-label { color: var(--muted); font-size: 10px; font-weight: 600; }
.progress-stat-card > strong { grid-column: 2; color: var(--ink); font-family: var(--font-display); font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.progress-stat-card > small { grid-column: 2; color: var(--muted); font-size: 10px; }
.progress-stat-card > .progress-stat-icon { grid-column: 1; grid-row: 1 / span 3; }
.progress-stat-card.progress-stat-wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; }
.progress-stat-wide .progress-stat-label, .progress-stat-wide > strong, .progress-stat-wide > small { grid-column: 1; }
.progress-stat-wide > strong { grid-row: 2; }
.progress-stat-wide .progress-xp-bar { grid-column: 1 / -1; margin-top: 8px; }
.progress-mission-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.progress-mission-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid #304057;
  border-radius: 16px;
  background: linear-gradient(145deg, #1b2739, #151e2b);
}
.progress-mission-card.is-main { grid-column: 1 / -1; border-color: #6b4c37; background: radial-gradient(ellipse at 100% 0, #ff782b17, transparent 40%), linear-gradient(145deg, #252b34, #191f29); }
.progress-mission-card.is-complete { border-color: #398b6a; }
.progress-mission-heading { justify-content: flex-start; margin-bottom: 11px; }
.progress-mission-card h3 { margin: 7px 0 5px; color: var(--ink); font-size: 14px; }
.progress-mission-card p { min-height: 32px; margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.progress-mission-progress { gap: 10px; }
.progress-mission-progress .progress-xp-bar { flex: 1; height: 6px; }
.progress-mission-progress strong { min-width: 42px; color: var(--ink); font-size: 10px; text-align: right; }
.progress-mission-card > small { display: block; margin-top: 9px; color: var(--muted); font-size: 9px; }
.progress-evolution-card { padding: 15px; }
.progress-evolution-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.progress-evolution-stats > div { display: grid; gap: 5px; min-width: 0; }
.progress-evolution-stats span { color: var(--muted); font-size: 10px; }
.progress-evolution-stats strong { color: var(--ink); font-size: 20px; font-variant-numeric: tabular-nums; }
.progress-insight { display: flex; align-items: flex-start; gap: 11px; margin-top: 14px; padding: 12px; border: 1px solid #3989ff32; border-radius: 13px; background: #3989ff0b; }
.progress-insight .progress-stat-icon { flex: 0 0 auto; width: 32px; height: 32px; }
.progress-insight p { margin: 1px 0 0; color: var(--ink); font-size: 11px; line-height: 1.6; }
.progress-achievements-link, .progress-recovery {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #34485f;
  border-radius: 16px;
  background: linear-gradient(105deg, #1a2738, #1a2431);
}
.progress-achievements-link h2, .progress-recovery h2 { margin: 2px 0 4px; font-size: 16px; }
.progress-achievements-link p, .progress-recovery p { margin: 0; }
.progress-recovery { margin: 0 0 16px; border-color: #3989ff55; }
.progress-recovery > div { max-width: 540px; }
.progress-recovery > div > p:last-child { color: var(--muted); font-size: 11px; line-height: 1.5; }
.progress-data-note { margin: 18px 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.progress-subpage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 18px; }
.progress-subpage-head h2 { margin: 3px 0 0; font-size: 26px; }
.progress-journey-detail { padding: 14px; }
.progress-journey-detail > .progress-map { margin-top: 13px; }
.progress-journey-detail > .tiny { margin: 10px 0 1px; line-height: 1.5; }
.progress-mountain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 14px; }
.progress-mountain-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #31435b;
  border-radius: 15px;
  color: var(--ink);
  background: linear-gradient(145deg, #1a2738, #141e2b);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}
.progress-mountain-card:hover { transform: translateY(-2px); border-color: #6684a5; }
.progress-mountain-card.is-locked { opacity: .7; }
.progress-mountain-number { grid-column: 2; grid-row: 1 / span 2; color: #ff9a61; font-family: var(--font-display); font-size: 27px; font-weight: 700; }
.progress-mountain-name { grid-column: 1; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.progress-mountain-levels { grid-column: 1 / -1; letter-spacing: .04em; }
.progress-mountain-card .progress-xp-bar { grid-column: 1 / -1; height: 6px; margin-top: 4px; }
.progress-mountain-footer { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.progress-mountain-modal h3 { margin: 10px 0; font-size: 17px; line-height: 1.4; }
.progress-mountain-modal-state { margin: 16px 0 9px; }
.progress-mountain-modal-state strong { color: #ff9a61; font-size: 18px; }
.progress-mountain-modal > p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.55; }
.progress-mission-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.progress-mission-summary h3 { margin: 4px 0; }
.progress-mission-summary p:last-child { max-width: 620px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.progress-mission-summary > .progress-stat-icon { flex: 0 0 auto; }
.progress-mission-list-full { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.progress-unlock-list { display: grid; gap: 9px; }
.progress-unlock-list > div { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid #2c3d53; border-radius: 12px; background: #182334; }
.progress-unlock-list p { display: grid; gap: 3px; margin: 0; }
.progress-unlock-list small { color: var(--muted); font-size: 10px; }
.progress-statistics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.progress-statistic-panel { min-width: 0; }
.progress-statistic-panel > strong { display: block; margin: 7px 0; color: var(--ink); font-family: var(--font-display); font-size: 32px; font-variant-numeric: tabular-nums; }
.progress-statistic-panel > p:not(.eyebrow) { min-height: 34px; margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.progress-performance-list { display: grid; gap: 9px; }
.progress-performance-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px 12px; padding: 12px; border: 1px solid #2c3d53; border-radius: 13px; background: #182334; }
.progress-performance-row > div { display: grid; gap: 3px; }
.progress-performance-row small { color: var(--muted); font-size: 10px; }
.progress-performance-row > strong { color: #85b7ff; font-size: 12px; }
.progress-performance-row .progress-xp-bar { grid-column: 1 / -1; height: 5px; }
.progress-achievement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.progress-achievement-card { display: grid; justify-items: start; align-content: start; gap: 8px; min-width: 0; padding: 15px; border: 1px solid #304057; border-radius: 15px; background: linear-gradient(145deg, #1a2738, #151e2b); }
.progress-achievement-card.is-locked { opacity: .65; }
.progress-achievement-card.is-unlocked { border-color: #8d6a43; background: linear-gradient(145deg, #332b26, #1b242e); }
.progress-achievement-icon { width: 42px; height: 42px; }
.progress-achievement-card h3 { margin: 3px 0 0; font-size: 13px; }
.progress-achievement-card p { min-height: 32px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.progress-achievement-status { color: #ffad76; font-size: 9px; font-weight: 700; }

@keyframes progress-marker-glow {
  0%, 100% { box-shadow: 0 0 0 4px #fff3, 0 2px 9px #11182799, 0 0 18px #fff9; }
  50% { box-shadow: 0 0 0 7px #fff2, 0 2px 9px #11182799, 0 0 22px #fff; }
}

html[data-theme="light"] .progress-level-card { border-color: #c9d8e6; background: radial-gradient(ellipse at 100% 0%, #3989ff15, transparent 38%), linear-gradient(130deg, #fff, #eef5fb 72%); }
html[data-theme="light"] .progress-level-card::after { border-color: #ff782b20; box-shadow: 0 0 0 24px #ff782b08, 0 0 0 48px #3989ff08; }
html[data-theme="light"] .progress-journey-card { border-color: #cbd9e6; background: linear-gradient(145deg, #f8fbff, #edf3f8); }
html[data-theme="light"] .progress-map { border-color: #c8d8e7; }
html[data-theme="light"] .progress-stat-card, html[data-theme="light"] .progress-mission-card, html[data-theme="light"] .progress-mountain-card, html[data-theme="light"] .progress-achievement-card, html[data-theme="light"] .progress-performance-row, html[data-theme="light"] .progress-unlock-list > div { border-color: #d7e1eb; background: #fff; }
html[data-theme="light"] .progress-mission-card.is-main { border-color: #f1cfb5; background: radial-gradient(ellipse at 100% 0, #ff782b0d, transparent 40%), #fff; }
html[data-theme="light"] .progress-achievement-card.is-unlocked { border-color: #e4c49d; background: linear-gradient(145deg, #fffaf3, #fff); }
html[data-theme="light"] .progress-achievements-link, html[data-theme="light"] .progress-recovery { border-color: #d2deea; background: linear-gradient(105deg, #fff, #f1f6fb); }
html[data-theme="light"] .progress-evolution-card, html[data-theme="light"] .progress-statistic-panel, html[data-theme="light"] .progress-journey-detail, html[data-theme="light"] .progress-mission-summary { background: #fff; border-color: #d7e1eb; }
html[data-theme="light"] .progress-insight { border-color: #c9dff5; background: #f2f8ff; }
html[data-theme="light"] .progress-insight p { color: var(--ink); }

@media (max-width: 700px) {
  .progress-page-head { margin-bottom: 15px; }
  .progress-section { margin-top: 19px; }
  .progress-level-card { padding: 16px; }
  .progress-level-main { align-items: flex-start; gap: 10px; }
  .progress-level-main h2 { font-size: 39px; }
  .progress-level-next { padding-top: 10px; }
  .progress-level-next strong { font-size: 10px; }
  .progress-map { height: 180px; }
  .progress-map.is-expanded { height: clamp(220px, 68vw, 300px); }
  .progress-consistency-grid { gap: 8px; }
  .progress-stat-card { padding: 12px; }
  .progress-mission-list, .progress-mission-list-full { grid-template-columns: minmax(0, 1fr); }
  .progress-mission-card.is-main { grid-column: auto; }
  .progress-statistics-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .progress-statistic-panel > p:not(.eyebrow) { min-height: 0; }
  .progress-achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-achievements-link, .progress-recovery { align-items: flex-start; flex-direction: column; }
  .progress-subpage-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .progress-mountain-grid { gap: 8px; }
}
html[data-theme="light"] body.home-screen-active { background: #fff; background-image: none; }
html[data-theme="light"] body.challenge-screen-active { background: #fff; background-image: none; }
body.home-screen-active .home-mountains {
  -webkit-mask-image: linear-gradient(to bottom, #000 36%, #0008 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 36%, #0008 62%, transparent 100%);
}
body.home-screen-active .avatar .icon-svg { width: 23px; height: 23px; }
.bottom-nav {
  left: 0;
  bottom: 0;
  transform: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: none;
  padding: 9px 10px max(9px, env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid #e8edf4;
  border-radius: 0;
  background: #fffffff5;
  box-shadow: 0 -5px 22px #334e6b0d;
}
.bottom-nav > .nav-button { display: grid !important; }
.bottom-nav .nav-icon { width: 100%; height: 31px; border: 0; background: transparent; }
.bottom-nav .nav-button.active { color: #147fe8; background: transparent; }
@media (max-width: 380px) {
  .progress-level-main { flex-direction: column; }
  .progress-level-next { max-width: 100%; padding: 0; text-align: left; }
  .progress-level-next span { font-size: 8px; }
  .progress-consistency-grid { grid-template-columns: 1fr; }
  .progress-stat-card.progress-stat-wide { grid-column: auto; }
  .progress-mountain-grid { grid-template-columns: 1fr; }
  .progress-achievement-grid { grid-template-columns: 1fr; }
  .progress-achievement-card p { min-height: 0; }
  .progress-evolution-stats { gap: 5px; }
  .progress-evolution-stats strong { font-size: 17px; }
  .progress-evolution-stats span { font-size: 9px; }
  .progress-journey-meta { grid-template-columns: minmax(0, 1fr); }
  .progress-journey-meta b { grid-column: 1; grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .progress-map-position, .progress-xp-bar > i, .progress-journey-card, .progress-mountain-card { animation: none !important; transition: none !important; }
}

/* Retos diarios, semanales y mensuales */
body.challenge-screen-active {
  --ink: #101b32;
  --muted: #627087;
  --dim: #8491a4;
  --line: #e7edf5;
  --cyan: #147fe8;
  color-scheme: light;
  background: #fff;
  color: #101b32;
}
body.challenge-screen-active .app-shell { color: #101b32; }
body.challenge-screen-active .top-link,
body.challenge-screen-active .theme-toggle { color: #627087; }
body.challenge-screen-active .bottom-nav > .nav-button { display: grid !important; color: #78859a; }
body.challenge-screen-active .bottom-nav > .nav-button .nav-icon { display: grid; place-items: center; border: 0; background: transparent; }
body.challenge-screen-active .bottom-nav > .nav-button.active { color: #147fe8; background: transparent; }
body.challenge-screen-active #screen-challenges { color: #101b32; }
body.challenge-screen-active #screen-challenges .page-head { align-items: flex-start; margin-bottom: 20px; }
body.challenge-screen-active #screen-challenges .page-head h1 { font-size: clamp(30px, 5vw, 42px); }
body.challenge-screen-active #screen-challenges .eyebrow { color: #147fe8; }
body.challenge-screen-active #screen-challenges .action.primary { border-color: #147fe8; background: #147fe8; color: #fff; }
body.challenge-screen-active #screen-challenges .action.primary:hover { background: #086dcc; box-shadow: 0 7px 18px #147fe833; }
body.challenge-screen-active #screen-challenges .action.secondary { border-color: #d6e1ef; background: #fff; color: #627087; }
body.war-screen-active {
  --ink: #101b32;
  --muted: #627087;
  --dim: #8491a4;
  --line: #e7edf5;
  --cyan: #147fe8;
  color-scheme: light;
  background: #fff;
  color: #101b32;
}
body.war-screen-active .app-shell { color: #101b32; }
body.war-screen-active .top-link,
body.war-screen-active .theme-toggle { color: #627087; }
body.war-screen-active .bottom-nav > .nav-button { color: #78859a; }
body.war-screen-active .bottom-nav > .nav-button.active { color: #147fe8; background: transparent; }
body.war-screen-active #screen-wars .page-head { align-items: flex-start; margin-bottom: 22px; }
body.war-screen-active #screen-wars .page-head h1 { font-size: clamp(30px, 5vw, 42px); }
body.war-screen-active #screen-wars .eyebrow { color: #147fe8; }
.wars-empty-state { display: grid; justify-items: center; max-width: 680px; margin: clamp(24px, 7vh, 68px) auto 30px; padding: clamp(25px, 6vw, 54px); border: 1px solid #e7edf5; border-radius: 25px; background: radial-gradient(ellipse at 50% 0, #eaf4ff 0, #fff 63%); text-align: center; box-shadow: 0 12px 36px #1835530b; }
.wars-empty-art { position: relative; display: grid; place-items: center; width: 128px; height: 112px; margin-bottom: 22px; }
.wars-empty-icon { position: absolute; display: grid; place-items: center; border: 1px solid #d6e6f8; border-radius: 22px; background: #fff; box-shadow: 0 9px 22px #18355312; }
.wars-empty-icon .icon-svg { width: 34px; height: 34px; }
.wars-empty-icon-back { top: 7px; left: 4px; width: 74px; height: 74px; color: #1683ee; transform: rotate(-8deg); }
.wars-empty-icon-front { right: 3px; bottom: 1px; width: 72px; height: 72px; border-color: #ffe1c9; color: #ed801d; transform: rotate(7deg); }
.wars-empty-state > .eyebrow { margin: 0 0 9px; color: #147fe8; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.wars-empty-state h2 { max-width: 480px; margin: 0; color: #101b32; font-size: clamp(23px, 4vw, 32px); line-height: 1.2; letter-spacing: -.04em; }
.wars-empty-copy { max-width: 470px; margin: 13px 0 22px; color: #627087; font-size: 15px; line-height: 1.6; }
.wars-create-button:disabled { border-color: #147fe8; background: #147fe8; color: #fff; opacity: .68; cursor: not-allowed; }
.wars-create-note { margin-top: 10px; color: #8491a4; font-size: 12px; }
.challenge-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0 0 22px; padding: 5px; border: 1px solid #e7edf5; border-radius: 14px; background: #f5f8fc; }
.challenge-tabs button { min-width: 0; min-height: 43px; border: 0; border-radius: 10px; background: transparent; color: #627087; font-size: 14px; font-weight: 650; cursor: pointer; }
.challenge-tabs button.active { background: #fff; color: #147fe8; box-shadow: 0 2px 8px #18355312; }
.challenge-content { display: grid; gap: 15px; }
.challenge-period-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 2px; }
.challenge-period-heading > div { display: grid; gap: 4px; }
.challenge-period-heading strong { color: #101b32; font-size: 20px; }
.challenge-period-heading > div > span { color: #8491a4; font-size: 13px; text-transform: capitalize; }
.challenge-completion-count { color: #627087; font-size: 13px; white-space: nowrap; }
.challenge-list { display: grid; gap: 11px; }
.challenge-card { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 15px; min-width: 0; padding: 15px; border: 1px solid #e8edf4; border-radius: 17px; background: #fff; box-shadow: 0 3px 12px #18355308; }
.challenge-card.is-complete { border-color: #d7e9fc; background: linear-gradient(110deg, #f8fbff, #fff 58%); }
.challenge-card-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; }
.challenge-card-icon .icon-svg { width: 27px; height: 27px; stroke-width: 1.8; }
.challenge-tone-blue { color: #147fe8; background: #eaf4ff; }
.challenge-tone-orange { color: #e98022; background: #fff2e8; }
.challenge-tone-violet { color: #7545cf; background: #f3edff; }
.challenge-card-body { display: grid; gap: 6px; min-width: 0; }
.challenge-card-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; color: #8491a4; font-size: 10px; }
.challenge-card-meta span + span::before { content: "·"; margin-right: 10px; color: #bac4d1; }
.challenge-card h3 { margin: 0; color: #101b32; font-size: 16px; line-height: 1.4; font-weight: 700; }
.challenge-card.is-complete h3 { color: #627087; }
.challenge-card-action { display: grid; justify-items: end; gap: 7px; }
.challenge-complete { min-height: 37px; padding: 0 11px; border: 1px solid #d6e1ef; border-radius: 11px; background: #fff; color: #627087; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.challenge-complete:hover { border-color: #147fe8; color: #147fe8; }
.challenge-complete.is-complete { border-color: #147fe8; background: #147fe8; color: #fff; }
.challenge-readonly-status { color: #8491a4; font-size: 11px; font-weight: 650; white-space: nowrap; }
.challenge-readonly-status.is-complete { color: #147fe8; }
.challenge-remove, .challenge-small-action { border: 0; background: transparent; color: #8491a4; font-size: 11px; cursor: pointer; }
.challenge-remove:hover { color: #c14949; }
.challenge-meter { display: grid; grid-template-columns: auto 1fr; gap: 5px 9px; align-items: center; margin-top: 2px; color: #8491a4; font-size: 11px; }
.challenge-meter strong { justify-self: end; color: #627087; font-size: 11px; }
.challenge-meter-track { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 99px; background: #eaf1fa; }
.challenge-meter-track i { display: block; height: 100%; border-radius: inherit; background: #1683ee; }
.challenge-progress-form { display: flex; align-items: end; gap: 8px; }
.challenge-progress-form label { display: grid; gap: 5px; color: #627087; font-size: 11px; }
.challenge-progress-form input, .monthly-challenge-picker select { min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #dce5ef; border-radius: 9px; outline: 0; background: #fff; color: #101b32; }
.challenge-progress-form input:focus, .monthly-challenge-picker select:focus { border-color: #1683ee; box-shadow: 0 0 0 3px #1683ee1c; }
.challenge-small-action { min-height: 36px; padding: 0 8px; border-radius: 8px; background: #eaf4ff; color: #147fe8; font-weight: 700; }
.monthly-challenge-picker { display: grid; gap: 10px; padding: 15px; border: 1px solid #e7edf5; border-radius: 16px; background: #f9fbfe; }
.monthly-challenge-picker > label { color: #101b32; font-size: 14px; font-weight: 700; }
.monthly-challenge-picker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.monthly-challenge-picker select { width: 100%; }
.monthly-challenge-picker-row .action { min-height: 38px; padding: 0 14px; border-radius: 10px; }
.monthly-challenge-picker p { margin: 0; color: #8491a4; font-size: 11px; line-height: 1.45; }
.challenge-empty, .challenge-empty-history, .challenge-load-message { padding: 21px; border: 1px dashed #dce5ef; border-radius: 15px; color: #8491a4; font-size: 13px; text-align: center; }
.challenge-load-error { padding: 18px; border: 1px solid #f0d7d2; border-radius: 15px; background: #fff9f7; color: #6f3430; }
.challenge-load-error strong { color: #7d332c; font-size: 14px; }
.challenge-load-error p { overflow-wrap: anywhere; color: #87534d; font-size: 12px; line-height: 1.5; }
.challenge-history { margin-top: 7px; border-top: 1px solid #e8edf4; }
.challenge-history > summary { padding: 15px 3px; color: #627087; font-size: 13px; font-weight: 700; cursor: pointer; }
.challenge-history-period { margin: 0 0 9px; padding: 11px 12px; border: 1px solid #e8edf4; border-radius: 13px; }
.challenge-history-period > summary { display: flex; justify-content: space-between; gap: 10px; color: #34445c; font-size: 12px; cursor: pointer; }
.challenge-history-period > summary small { color: #8491a4; white-space: nowrap; }
.challenge-history-period[open] > .challenge-list { margin-top: 10px; }
.challenge-history-period .challenge-card { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 9px; padding: 9px; box-shadow: none; }
.challenge-history-period .challenge-card-icon { width: 38px; height: 38px; border-radius: 11px; }
.challenge-history-period .challenge-card-icon .icon-svg { width: 20px; height: 20px; }
.challenge-history-period .challenge-card h3 { font-size: 12px; }
@media (max-width: 640px) {
  body.challenge-screen-active .app-shell { width: min(calc(100% - 32px), 540px); padding-top: max(14px, env(safe-area-inset-top)); }
  body.challenge-screen-active .topbar { margin-bottom: 20px; }
  body.war-screen-active .app-shell { width: min(calc(100% - 32px), 540px); padding-top: max(14px, env(safe-area-inset-top)); }
  body.war-screen-active .topbar { margin-bottom: 20px; }
  .wars-empty-state { margin: 18px auto 28px; padding: 28px 20px; border-radius: 20px; }
  .wars-empty-copy { font-size: 14px; }
  .challenge-tabs { margin-bottom: 17px; }
  .challenge-tabs button { min-height: 40px; font-size: 12px; }
  .challenge-period-heading { align-items: flex-start; }
  .challenge-period-heading strong { font-size: 17px; }
  .challenge-period-heading > div > span, .challenge-completion-count { font-size: 11px; }
  .challenge-card { grid-template-columns: 48px minmax(0, 1fr); gap: 10px 12px; padding: 12px; border-radius: 15px; }
  .challenge-card-icon { width: 46px; height: 46px; border-radius: 14px; }
  .challenge-card-icon .icon-svg { width: 23px; height: 23px; }
  .challenge-card h3 { font-size: 14px; }
  .challenge-card-action { grid-column: 2; justify-items: start; display: flex; align-items: center; gap: 12px; }
  .challenge-complete { min-height: 34px; }
  .challenge-history-period .challenge-card { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .challenge-history-period .challenge-card-action { grid-column: auto; justify-self: end; }
  .monthly-challenge-picker-row { grid-template-columns: minmax(0, 1fr); }
  .monthly-challenge-picker-row .action { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .challenge-card, .challenge-complete, .challenge-meter-track i { transition: none !important; }
}
.wars-content { display: grid; gap: 20px; color: #101b32; }
.wars-toolbar, .war-section-heading, .war-detail-toolbar, .war-action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wars-toolbar > p, .war-help, .war-catalog-note { color: #627087; font-size: 13px; line-height: 1.55; }
.wars-toolbar .action, .war-action-row .action, .war-detail-toolbar .action { min-height: 42px; }
.war-overview-section, .war-detail-section, .war-moderator-section { display: grid; gap: 12px; }
.war-section-heading h2, .war-section-heading h3 { color: #101b32; }
.war-section-heading > span { color: #8491a4; font-size: 12px; }
.war-list, .war-inbox-list { display: grid; gap: 10px; }
.war-list-card { position: relative; display: grid; gap: 8px; width: 100%; padding: 16px 52px 16px 16px; border: 1px solid #e3eaf3; border-radius: 16px; background: #fff; text-align: left; box-shadow: 0 4px 14px #18355308; cursor: pointer; }
.war-list-card:hover, .war-list-card:focus-visible { border-color: #1683ee; outline: 0; box-shadow: 0 0 0 3px #1683ee1c; }
.war-list-card > strong { color: #101b32; font-size: 17px; }
.war-list-card > strong span { color: #8491a4; font-size: 12px; }
.war-list-card > small, .war-team-count { color: #8491a4; font-size: 12px; }
.war-list-arrow { position: absolute; right: 18px; top: 50%; color: #1683ee; font-size: 22px; transform: translateY(-50%); }
.war-status-pill { display: inline-flex; width: fit-content; align-items: center; padding: 5px 9px; border: 1px solid #dce5ef; border-radius: 999px; background: #f5f8fc; color: #627087; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.war-status-pill.is-active { border-color: #c9ead8; background: #eefaf3; color: #27844d; }
.war-status-pill.is-completed, .war-status-pill.is-final { border-color: #d7e6fb; background: #eff6ff; color: #176bc0; }
.war-status-pill.is-provisional { border-color: #f2d8a6; background: #fff8e9; color: #9a6410; }
.war-status-pill.is-cancelled { border-color: #f2d4d0; background: #fff4f2; color: #a9473e; }
.war-inbox-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid #d8e9fc; border-radius: 15px; background: #f7fbff; }
.war-inbox-card > div:first-child { display: grid; gap: 5px; }
.war-inbox-card small { color: #8491a4; font-size: 11px; }
.war-empty-inline, .wars-loading, .wars-error { display: grid; gap: 8px; padding: 21px; border: 1px dashed #dce5ef; border-radius: 15px; background: #fff; color: #627087; text-align: center; }
.war-empty-inline strong, .wars-error strong { color: #101b32; }
.wars-error { border-style: solid; border-color: #f0d7d2; background: #fff9f7; text-align: left; }
.wars-error p, .wars-inline-error { overflow-wrap: anywhere; color: #87534d; font-size: 12px; line-height: 1.5; }
.wars-inline-error { padding: 11px; border-radius: 9px; background: #fff5f2; }
.war-detail-view { display: grid; gap: 17px; }
.war-detail-toolbar { justify-content: flex-start; }
.war-detail-toolbar .action { min-height: 36px; }
.war-detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; border: 1px solid #dce9f8; border-radius: 19px; background: radial-gradient(ellipse at 85% 0, #e5f2ff 0, #fff 58%); }
.war-detail-hero h2 { margin: 11px 0 7px; color: #101b32; font-size: clamp(20px, 4vw, 27px); line-height: 1.25; }
.war-detail-hero h2 span { color: #a0adbc; font-size: 13px; }
.war-detail-hero p, .war-date-range small { color: #8491a4; font-size: 12px; }
.war-date-range { display: grid; gap: 6px; min-width: 150px; text-align: right; }
.war-date-range strong { color: #176bc0; font-size: 14px; text-transform: capitalize; }
.war-date-range span { color: #627087; font-size: 12px; text-transform: capitalize; }
.war-scoreboard-card { padding: 17px; border: 1px solid #dce9f8; border-radius: 17px; background: #f7fbff; }
.war-scoreboard-teams { display: grid; grid-template-columns: minmax(0,1fr) 32px minmax(0,1fr); align-items: center; gap: 8px; text-align: center; }
.war-scoreboard-teams > div { display: grid; gap: 5px; min-width: 0; }
.war-scoreboard-teams small { overflow: hidden; color: #627087; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.war-scoreboard-teams strong { color: #101b32; font-size: clamp(24px, 6vw, 34px); font-variant-numeric: tabular-nums; }
.war-scoreboard-teams > span { color: #a0adbc; font-size: 10px; font-weight: 800; }
.war-scoreboard-card > p { margin-top: 9px; color: #627087; font-size: 12px; line-height: 1.5; text-align: center; }
.war-result-banner { padding: 12px 14px; border: 1px solid #f2d8a6; border-radius: 12px; background: #fff8e9; color: #8d5c10; font-size: 13px; line-height: 1.5; }
.war-team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.war-team-card { min-width: 0; padding: 16px; border: 1px solid #e5ebf3; border-radius: 17px; background: #fff; box-shadow: 0 4px 14px #18355307; }
.war-team-card > header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.war-team-kicker { color: #1683ee; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.war-team-card h3 { margin-top: 4px; color: #101b32; font-size: 17px; overflow-wrap: anywhere; }
.war-team-card header > strong { color: #176bc0; font-size: 17px; white-space: nowrap; }
.war-team-card header > strong small, .war-roster-member strong small { color: #8491a4; font-size: 9px; }
.war-team-count { margin: 8px 0 12px; }
.war-roster, .war-invitation-list, .war-activity-log, .war-report-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.war-roster-member { display: flex; align-items: center; gap: 8px; min-width: 0; padding-top: 9px; border-top: 1px solid #edf1f6; }
.war-member-avatar { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: #eaf4ff; color: #176bc0; font-size: 10px; font-weight: 800; }
.war-member-name { flex: 1; min-width: 0; overflow-wrap: anywhere; color: #34445c; font-size: 12px; }
.war-member-name small { color: #8491a4; font-size: 9px; font-weight: 600; }
.war-roster-member strong { color: #34445c; font-size: 12px; white-space: nowrap; }
.war-roster-member.is-left { opacity: .58; }
.war-no-members { color: #8491a4; font-size: 12px; }
.war-detail-section { padding: 16px; border: 1px solid #e5ebf3; border-radius: 16px; background: #fff; }
.war-detail-section > .war-help { margin-top: 2px; }
.war-setup-card { background: #fbfdff; }
.war-action-row { justify-content: flex-start; flex-wrap: wrap; }
.war-action-row .action:disabled { opacity: .5; cursor: not-allowed; }
.war-invitation-list { margin-top: 12px; }
.war-invitation-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 9px; border-top: 1px solid #edf1f6; color: #627087; font-size: 12px; }
.war-invitation-list li span { flex: 1; min-width: 150px; overflow-wrap: anywhere; }
.war-activity-form { display: grid; grid-template-columns: minmax(140px, .7fr) minmax(230px, 1.3fr) auto; align-items: end; gap: 10px; margin: 14px 0; }
.war-activity-form label, .war-form label { display: grid; gap: 6px; color: #627087; font-size: 12px; font-weight: 650; }
.war-activity-form input, .war-form input, .war-form select { width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid #dce5ef; border-radius: 10px; background: #fff; color: #101b32; }
.war-activity-form input:focus, .war-form input:focus, .war-form select:focus { border-color: #1683ee; outline: 0; box-shadow: 0 0 0 3px #1683ee1c; }
.war-activity-form .action { min-height: 42px; }
.war-proof-input input { padding: 7px; font-size: 11px; }
.war-log-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #edf1f6; }
.war-log-row > div:first-child { display: grid; gap: 4px; }
.war-log-row strong { color: #34445c; font-size: 12px; }
.war-log-row span, .war-log-row button { color: #8491a4; font-size: 10px; }
.war-text-button { padding: 5px; border: 0; background: transparent; color: #147fe8 !important; font-size: 11px; font-weight: 700; cursor: pointer; }
.war-text-button:hover { text-decoration: underline; }
.war-waiting-banner { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fff6e8; color: #a3610a; font-size: 13px; font-weight: 700; }
.war-link-block { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid #edf1f6; }
.war-link-block > strong { color: #101b32; font-size: 13px; }
.war-link-field { display: grid; gap: 8px; min-width: 0; }
.war-link-field input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #dfe6ef; border-radius: 10px; background: #f6f8fb; color: #34445c; font-size: 12px; text-overflow: ellipsis; }
.war-feed { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.war-feed-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px 0; border-top: 1px solid #edf1f6; }
.war-feed-item:first-child { border-top: 0; }
.war-feed-item.is-muted { opacity: .6; }
.war-feed-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #f1f5fa; font-size: 14px; }
.war-feed-body { display: grid; gap: 3px; min-width: 0; }
.war-feed-body p { margin: 0; color: #34445c; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.war-feed-body small { color: #8491a4; font-size: 11px; }
.war-feed-actions { display: flex; flex-direction: column; align-items: flex-end; }
.war-daily-list { display: grid; gap: 0; }
.war-daily-row { display: grid; grid-template-columns: minmax(0,1fr) 72px 72px; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid #edf1f6; color: #627087; font-size: 12px; }
.war-daily-row > :not(:first-child) { text-align: right; color: #34445c; font-variant-numeric: tabular-nums; }
.war-report-row { padding: 12px; border: 1px solid #edf1f6; border-radius: 12px; background: #fbfcfe; }
.war-report-row strong { color: #34445c; font-size: 12px; }
.war-report-row p { margin-top: 6px; color: #627087; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.war-report-row small { display: block; margin-top: 7px; color: #8491a4; font-size: 10px; }
.war-moderator-section { padding: 16px; border: 1px solid #f0dfc2; border-radius: 17px; background: #fffdf8; }
.war-moderation-card { display: grid; gap: 9px; padding: 13px; border: 1px solid #f0e5d3; border-radius: 13px; background: #fff; }
.war-moderation-card p { color: #627087; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.war-moderation-card > small { color: #8491a4; font-size: 10px; }
.war-moderation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.war-moderation-actions .action { min-height: 35px; padding: 0 10px; font-size: 11px; }
.war-history-note, .war-catalog-note { padding: 10px 12px; border-radius: 10px; background: #f5f8fc; }
.war-proof-preview { display: block; max-width: 100%; max-height: 70vh; margin: auto; border-radius: 12px; object-fit: contain; }
.war-form { gap: 13px; }
.war-form .war-help { font-size: 12px; }
@media (max-width: 760px) {
  .war-activity-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .war-activity-form .action { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .wars-toolbar { align-items: flex-start; }
  .wars-toolbar > p { max-width: 56%; font-size: 11px; }
  .wars-toolbar .action { min-height: 39px; padding: 0 12px; font-size: 12px; }
  .war-inbox-card, .war-detail-hero { align-items: flex-start; flex-direction: column; }
  .war-inbox-card { width: 100%; }
  .war-detail-hero { padding: 16px; }
  .war-date-range { min-width: 0; text-align: left; }
  .war-team-grid { grid-template-columns: 1fr; }
  .war-team-card { padding: 14px; }
  .war-detail-section { padding: 13px; }
  .war-activity-form { grid-template-columns: 1fr; }
  .war-activity-form .action { grid-column: auto; width: 100%; }
  .war-daily-row { grid-template-columns: minmax(0,1fr) 58px 58px; font-size: 11px; }
  .war-action-row .action { flex: 1 1 145px; }
  .war-moderation-actions { align-items: stretch; }
  .war-moderation-actions .action { flex: 1 1 110px; }
}
.habit-status-group { grid-column: 1 / -1; display: grid; gap: 12px; min-width: 0; }
.habit-status-group > h3 { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--ink); font-size: 15px; }
.habit-status-group > h3 span { color: var(--muted); font-size: 12px; font-weight: 500; }
.habit-status-group-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.habit-status-archived { opacity: .72; }
.habit-status-archived .habit-status i { background: #8491a4; box-shadow: 0 0 0 3px #8491a41c; }
@media (max-width: 700px) {
  .habit-status-group-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .habit-status-group > h3 { margin-top: 5px; }
}

/* Bottom navigation: Inicio, Guerras, Amigos */
.bottom-nav,
body.home-screen-active .bottom-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Logo in pure red (#FF0000), same in light and dark mode */
.brand,
body.home-screen-active .brand,
:root[data-theme="dark"] .brand,
:root[data-theme="dark"] body.home-screen-active .brand { color: #FF0000; }
.bita-logo path { fill: #FF0000; }

/* ===== FESHO: brand, stats and challenges on the home screen ===== */
.brand .fesho-wordmark { color: #FF0000; font-size: 20px; font-weight: 800; letter-spacing: 1px; line-height: 1; }
body.home-screen-active .brand .fesho-wordmark { font-size: 22px; }
.fesho-title, .launch-screen h1.fesho-title, .auth-card h1.fesho-title { color: #FF0000 !important; letter-spacing: 2px; }

.fesho-stats { display: none; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; }
body.home-screen-active .fesho-stats { display: flex; }
.fesho-stat { display: inline-flex; align-items: center; gap: 4px; line-height: 1; white-space: nowrap; }
.fesho-stat .icon-svg { width: 17px; height: 17px; flex-shrink: 0; }
.fesho-stat.is-streak { color: #F07A2B; }
.fesho-stat.is-xp { color: #1A8AD4; }

.fesho-home, .fesho-catalog-section {
  --f-card: #FFFFFF; --f-line: #E6E2DA; --f-text: #1C1E22; --f-text2: #3A3C42; --f-muted: #85827B;
  --f-accent: #B6F36A; --f-xp: #3DB5FF; --f-xp-text: #1A8AD4; --f-xp-shadow: #1E86C4;
  --f-easy: #3E8A12; --f-medium: #A67800; --f-hard: #D63636;
  --f-zebra: repeating-linear-gradient(135deg, #8C877E 0 6px, #E4DFD5 6px 12px);
  display: grid; gap: 0; margin: 4px 0 18px; color: var(--f-text);
}
/* The home screen always uses its light layout, in both themes. */
.fesho-home:empty { display: none; }
.fesho-muted, .fesho-h3 > span { color: var(--f-muted); font-size: 12px; }
.fesho-box { background: var(--f-card); border: 2px solid var(--f-line); border-radius: 14px; }
.fesho-message { padding: 14px; border: 2px solid var(--f-line); border-radius: 14px; background: var(--f-card); color: var(--f-muted); font-size: 13px; }
.fesho-message.is-error { display: grid; gap: 8px; color: var(--f-text2); }
.fesho-message.is-error .action { justify-self: start; }
.fesho-rank-row { display: flex; gap: 10px; align-items: stretch; }
.fesho-rank { flex: 1; min-width: 0; padding: 11px 12px; }
.fesho-rank-head { display: flex; align-items: center; gap: 10px; }
.fesho-rank-icon { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; background: var(--f-accent); color: #111; }
.fesho-rank-icon .icon-svg { width: 21px; height: 21px; }
.fesho-rank-name { margin: 0; font-size: 15px; font-weight: 700; }
.fesho-rank-head .fesho-muted { margin: 2px 0 0; }
.fesho-rank-head .fesho-muted b { color: var(--f-xp-text); font-weight: 700; }
.fesho-rank-track, .fesho-day-track, .fesho-meter-track { overflow: hidden; background: var(--f-line); }
.fesho-rank-track { height: 10px; margin-top: 10px; border-radius: 5px; }
.fesho-rank-track > i { display: block; height: 100%; border-radius: 5px; background: var(--f-xp); transition: width .3s; }
.fesho-today-xp { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 7px 14px; }
.fesho-today-xp small { color: var(--f-muted); font-size: 11px; }
.fesho-today-xp strong { display: inline-flex; align-items: center; gap: 4px; color: var(--f-xp-text); font-size: 16px; line-height: 1; white-space: nowrap; }
.fesho-today-xp strong .icon-svg { width: 16px; height: 16px; flex-shrink: 0; }
.fesho-today-xp em { font-size: 12px; font-style: normal; opacity: .65; }

.fesho-h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 20px 0 2px; }
.fesho-h3 h2 { margin: 0; color: var(--f-text); font-size: 16px; font-weight: 700; }
.fesho-h3 > span { text-align: right; }
.fesho-h3 > span b { color: var(--f-xp-text); font-weight: 700; }
.fesho-day-progress { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; }
.fesho-day-track { flex: 1; height: 4px; border-radius: 2px; }
.fesho-day-track > i { display: block; height: 100%; border-radius: 2px; background: var(--f-zebra); transition: width .3s; }
.fesho-day-progress > span { color: var(--f-muted); font-size: 12px; white-space: nowrap; }

.fesho-list { display: grid; gap: 8px; margin-top: 8px; }
.fesho-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--f-card); border: 2px solid var(--f-line); border-bottom-width: 4px; border-radius: 16px; }
.fesho-row-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 13px; background: var(--icon-bg); box-shadow: 0 4px 0 var(--icon-shadow); color: #fff; }
.fesho-row-icon .icon-svg { width: 22px; height: 22px; }
.fesho-row-body { flex: 1; min-width: 0; }
.fesho-row-meta { display: flex; align-items: center; gap: 6px; color: var(--f-muted); font-size: 12px; }
.fesho-tag { padding: 2px 7px; border-radius: 7px; font-size: 10px; font-weight: 700; line-height: 1.4; }
.fesho-tag.is-easy { background: #6BD12F2E; color: var(--f-easy); }
.fesho-tag.is-medium { background: #FFC21A2E; color: var(--f-medium); }
.fesho-tag.is-hard { background: #FF4D4D2E; color: var(--f-hard); }
.fesho-row-title { margin: 3px 0 0; color: var(--f-text); font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.fesho-row-xp { margin: 1px 0 0; color: var(--f-xp-text); font-size: 11px; font-weight: 700; }
.fesho-row.is-complete .fesho-row-title { color: var(--f-muted); }

.fesho-check { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; min-height: 36px; padding: 7px 10px; border: 2px solid var(--f-xp); border-radius: 12px; background: transparent; color: var(--f-text2); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; user-select: none; transition: background .2s; }
.fesho-check:active:not(.is-static) { transform: translateY(2px); }
.fesho-check.is-on { background: var(--f-xp); color: #fff; box-shadow: 0 3px 0 var(--f-xp-shadow); }
.fesho-check.is-static { cursor: default; }
.fesho-check-box { display: grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; border: 2px solid var(--f-xp); border-radius: 6px; }
.fesho-check-box .icon-svg { width: 14px; height: 14px; stroke-width: 3; }
.fesho-check.is-on .fesho-check-box { background: #fff; border-color: #fff; color: var(--f-xp); }

.fesho-meter { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.fesho-meter-track { flex: 1; height: 6px; border-radius: 3px; }
.fesho-meter-track > i { display: block; height: 100%; border-radius: 3px; background: var(--f-xp); }
.fesho-meter > span { color: var(--f-muted); font-size: 11px; white-space: nowrap; }
.fesho-progress-form { display: flex; gap: 6px; margin-top: 6px; }
.fesho-progress-form input { width: 80px; min-width: 0; padding: 6px 8px; border: 1px solid var(--f-line); border-radius: 8px; background: var(--f-card); color: var(--f-text); font-size: 13px; }
.fesho-small-button { padding: 6px 10px; border: 0; border-radius: 8px; background: var(--f-xp); color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }

.fesho-catalog-section { margin-top: 18px; }
.fesho-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.fesho-catalog-column { padding: 10px; background: var(--f-card); border: 2px solid var(--f-line); border-radius: 14px; }
.fesho-catalog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.fesho-catalog-level { font-size: 13px; font-weight: 700; }
.fesho-catalog-level.is-easy { color: var(--f-easy); }
.fesho-catalog-level.is-medium { color: var(--f-medium); }
.fesho-catalog-level.is-hard { color: var(--f-hard); }
.fesho-xp-badge { padding: 2px 7px; border-radius: 7px; background: #3DB5FF; color: #fff; font-size: 10px; font-weight: 700; }
.fesho-catalog ul { display: grid; margin: 0; padding: 0; list-style: none; }
.fesho-catalog li { display: flex; align-items: flex-start; gap: 6px; padding: 4px 0; border-top: 1px solid var(--f-line); color: var(--f-text2); font-size: 11px; line-height: 1.35; }
.fesho-dot { width: 6px; height: 6px; margin-top: 5px; flex-shrink: 0; border-radius: 50%; }

@media (max-width: 560px) {
  .fesho-catalog { grid-template-columns: 1fr; }
  .fesho-check { padding: 8px; }
}
@media (max-width: 360px) {
  .fesho-rank-row { flex-direction: column; }
  .fesho-today-xp { flex-direction: row; justify-content: space-between; }
}
@media (max-width: 560px) {
  .fesho-h3 { flex-wrap: wrap; row-gap: 2px; }
  .fesho-h3 > span { text-align: left; }
}

/* ===== FESHO: motion, feedback and accessibility pass ===== */
/* Readable secondary text: 4.5:1 or more on white. */
.fesho-home { --f-muted: #6F6B64; }

/* Touch targets of at least 44px and instant tap response. */
.fesho-check, .fesho-small-button, .bottom-nav .nav-button, .action { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.fesho-check { min-height: 44px; min-width: 44px; justify-content: center; }
.fesho-small-button { min-height: 36px; }
.fesho-progress-form input { min-height: 36px; }

/* Visible keyboard focus. */
.fesho-check:focus-visible, .fesho-small-button:focus-visible, .fesho-progress-form input:focus-visible,
.bottom-nav .nav-button:focus-visible { outline: 3px solid #1A8AD4; outline-offset: 2px; }

/* Rows react to touch and completion. */
.fesho-row { transition: border-color .2s ease, background-color .2s ease, transform .12s ease; }
.fesho-row:active { transform: scale(.99); }
.fesho-row.is-complete { border-color: #CDEFF9; background: #F6FCFF; }
.fesho-check { transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease; }
.fesho-row.just-completed .fesho-check-box { animation: fesho-check-pop .36s cubic-bezier(.34, 1.4, .64, 1); }
.fesho-row.just-completed .fesho-row-icon { animation: fesho-icon-bounce .42s cubic-bezier(.34, 1.4, .64, 1); }
@keyframes fesho-check-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes fesho-icon-bounce { 0% { transform: translateY(0); } 40% { transform: translateY(-5px); } 100% { transform: translateY(0); } }
.fesho-rank-track > i, .fesho-day-track > i, .fesho-meter-track > i { transition: width .45s cubic-bezier(.22, 1, .36, 1); }

/* Content enters softly instead of popping in. */
.fesho-rank-row, .fesho-h3, .fesho-day-progress, .fesho-list { animation: fesho-enter .28s ease-out both; }
.fesho-list .fesho-row { animation: fesho-enter .28s ease-out both; }
.fesho-list .fesho-row:nth-child(2) { animation-delay: .03s; }
.fesho-list .fesho-row:nth-child(3) { animation-delay: .06s; }
.fesho-list .fesho-row:nth-child(4) { animation-delay: .09s; }
.fesho-list .fesho-row:nth-child(5) { animation-delay: .12s; }
@keyframes fesho-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Loading skeleton with the same shape as the content. */
.fesho-skeleton { display: grid; gap: 10px; }
.fesho-skeleton-row { display: flex; gap: 10px; }
.fesho-skel { display: block; border-radius: 14px; background: linear-gradient(90deg, #EEF1F5 0%, #F7F9FB 50%, #EEF1F5 100%); background-size: 200% 100%; animation: fesho-shimmer 1.2s linear infinite; }
.fesho-skel.is-rank { flex: 1; height: 82px; }
.fesho-skel.is-xp { width: 96px; height: 82px; }
.fesho-skel.is-title { width: 45%; height: 18px; margin-top: 10px; border-radius: 6px; }
.fesho-skel.is-card { height: 68px; border-radius: 16px; }
@keyframes fesho-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* The toast should not hide behind the bottom bar on phones. */
#toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  .fesho-rank-row, .fesho-h3, .fesho-day-progress, .fesho-list, .fesho-list .fesho-row,
  .fesho-row.just-completed .fesho-check-box, .fesho-row.just-completed .fesho-row-icon, .fesho-skel { animation: none !important; }
  .fesho-row, .fesho-check, .fesho-rank-track > i, .fesho-day-track > i, .fesho-meter-track > i { transition: none !important; }
}

/* ===== Guerras y Amigos: contrast, touch and loading pass ===== */
/* Secondary text at 4.5:1 or more on white. */
.war-list-card > strong span, .war-list-card > small, .war-team-count,
.war-section-heading > span, .war-log-row span, .war-feed-body small { color: #5F6B7D; }
.action.quiet { color: #3A4A60; }

/* Touch: 44px targets, press feedback, no grey flash. */
.war-list-card, .war-text-button, [data-war-copy-link], [data-war-share-link] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.war-text-button { min-height: 44px; padding: 8px 10px; font-size: 13px; }
.war-detail-toolbar .action, .war-link-field .action, .war-action-row .action { min-height: 44px; }
.war-list-card { transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease; }
.war-list-card:active { transform: scale(.985); }
.war-list-arrow { transition: transform .2s ease; }
.war-list-card:hover .war-list-arrow { transform: translateX(3px); }
.war-link-field input:focus-visible, .war-list-card:focus-visible, .war-text-button:focus-visible,
.action:focus-visible { outline: 3px solid #1A8AD4; outline-offset: 2px; }

/* Content enters softly. */
.war-list-card, .war-detail-hero, .war-team-card, .war-detail-section { animation: fesho-enter .26s ease-out both; }
.war-list .war-list-card:nth-child(2) { animation-delay: .04s; }
.war-list .war-list-card:nth-child(3) { animation-delay: .08s; }
.war-team-grid .war-team-card:nth-child(2) { animation-delay: .04s; }

/* Loading skeletons for the wars screen. */
.war-skeleton { display: grid; gap: 12px; }
.fesho-skel.is-war-toolbar { height: 44px; width: 60%; border-radius: 12px; }
.fesho-skel.is-war-list { height: 104px; border-radius: 16px; }
.fesho-skel.is-war-hero { height: 150px; border-radius: 18px; }
.fesho-skel.is-war-card { height: 120px; border-radius: 16px; }

/* Waiting banner reads as a status, not a warning. */
.war-waiting-banner { line-height: 1.45; font-weight: 600; }
.war-date-range small { color: #5F6B7D; }

/* Amigos: empty feed centred and readable. */
#screen-community .friend-feed { min-height: 120px; }

@media (prefers-reduced-motion: reduce) {
  .war-list-card, .war-detail-hero, .war-team-card, .war-detail-section { animation: none !important; transition: none !important; }
}
.war-date-range.is-pending strong { text-transform: none; }

/* ===== Marcos de rango ===== */
.rank-frame { display: block; flex-shrink: 0; line-height: 0; }
.rank-frame svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Tarjeta de liga del inicio: toda la tarjeta abre la pantalla de rangos. */
button.fesho-rank { display: block; width: 100%; margin: 0; padding: 8px 12px 11px 6px; font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform .12s ease, border-color .2s ease; }
button.fesho-rank:hover { border-color: #3DB5FF; }
button.fesho-rank:active { transform: scale(.985); }
button.fesho-rank:focus-visible { outline: 3px solid #1A8AD4; outline-offset: 2px; }
button.fesho-rank .fesho-rank-head { display: flex; align-items: center; gap: 6px; }
.fesho-rank-copy { display: grid; gap: 2px; min-width: 0; }
.fesho-rank-copy .fesho-rank-name { display: block; margin: 0; }
.fesho-rank-copy .fesho-muted { display: block; margin: 0; }
.fesho-rank-more { color: #1A8AD4; font-size: 12px; font-weight: 700; }
button.fesho-rank .fesho-rank-track { display: block; margin: 4px 0 0 6px; }
.fesho-rank-row { align-items: stretch; }

/* Por encima de todo: hoja de rangos; y el modal de foto por encima de la hoja. */
.modal-backdrop { z-index: 50; }
.toast { z-index: 60; }
body.rank-sheet-open { overflow: hidden; }

/* ===== Pantalla de rangos ===== */
.rank-sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: #0B0C0F99; backdrop-filter: blur(4px); animation: rank-sheet-fade .2s ease-out; }
.rank-sheet[hidden] { display: none; }
.rank-sheet-panel { display: flex; flex-direction: column; width: 100%; max-width: 560px; height: 94vh; height: 94dvh; background: var(--bg, #f4f7fb); color: var(--ink, #172334); border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px #0006; overflow: hidden; animation: rank-sheet-up .28s cubic-bezier(.22, 1, .36, 1); }
.rank-sheet-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line, #d7e0ea); }
.rank-sheet-head h2 { margin: 0; text-align: center; font-size: 18px; font-weight: 800; color: var(--ink, #172334); }
.rank-sheet-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink, #172334); cursor: pointer; }
.rank-sheet-close .icon-svg { width: 22px; height: 22px; transform: rotate(180deg); }
.rank-sheet-close:focus-visible { outline: 3px solid #1A8AD4; outline-offset: 2px; }
.rank-sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
@keyframes rank-sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes rank-sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 720px) {
  .rank-sheet { align-items: center; }
  .rank-sheet-panel { height: min(88vh, 900px); border-radius: 22px; }
}

.rank-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line, #d7e0ea); border-radius: 16px; background: var(--panel, #fff); }
.rank-summary small { display: block; color: var(--muted, #5c6d80); font-size: 12px; }
.rank-summary strong { display: block; color: #1A8AD4; font-size: 22px; font-weight: 800; line-height: 1.2; }
.rank-summary p { margin: 2px 0 0; color: var(--muted, #5c6d80); font-size: 12px; line-height: 1.4; }
.rank-summary p b { color: #1A8AD4; }
.rank-summary .action { flex-shrink: 0; min-height: 44px; }

.rank-list { display: grid; gap: 12px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px solid var(--line, #d7e0ea); border-radius: 18px; background: var(--panel, #fff); scroll-margin: 80px; }
.rank-row.is-current { border-color: #3DB5FF; box-shadow: 0 0 0 3px #3DB5FF26; }
.rank-row.is-locked .rank-frame { opacity: .45; filter: grayscale(.6); }
.rank-row-body { flex: 1; min-width: 0; }
.rank-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rank-row-title h3 { margin: 0; color: var(--ink, #172334); font-size: 16px; font-weight: 700; }
.rank-phrase { margin: 2px 0 8px; color: var(--muted, #5c6d80); font-size: 12px; line-height: 1.4; }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 11px; font-weight: 800; }
.rank-badge.is-current { padding: 3px 8px; background: #3DB5FF; color: #fff; }
.rank-badge.is-passed { width: 22px; height: 22px; background: #6BD12F2E; color: #3E8A12; }
.rank-badge.is-locked { width: 22px; height: 22px; background: #8A8F982E; color: var(--muted, #5c6d80); }
.rank-badge .icon-svg { width: 14px; height: 14px; stroke-width: 2.6; }
.rank-levels { display: flex; gap: 6px; flex-wrap: wrap; }
.rank-level { min-width: 58px; padding: 4px 6px; border: 1px solid transparent; border-radius: 8px; background: var(--panel-raised, #eef3f8); text-align: center; font-size: 11px; }
.rank-level b { display: block; color: var(--ink, #172334); font-weight: 700; }
.rank-level span { color: #1A8AD4; font-weight: 700; white-space: nowrap; }
html:not([data-theme="light"]) .rank-level span, html:not([data-theme="light"]) .rank-summary strong { color: #3DB5FF; }
.rank-level.is-current { border-color: #3DB5FF; background: #3DB5FF1F; }
.rank-row.is-locked .rank-level { opacity: .75; }
@media (max-width: 400px) {
  .rank-row { gap: 8px; padding: 10px; }
  .rank-row .rank-frame { width: 112px !important; }
  .rank-level { min-width: 52px; }
}

/* Foto de perfil */
.photo-options { justify-items: center; }
.photo-preview { display: grid; place-items: center; }
.photo-pick { position: relative; overflow: hidden; cursor: pointer; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-rank-frame { flex-shrink: 0; padding: 0; border: 0; background: transparent; cursor: pointer; line-height: 0; border-radius: 16px; }
.profile-rank-frame:focus-visible { outline: 3px solid #1A8AD4; outline-offset: 2px; }
.profile-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.profile-photo-actions .action { min-height: 40px; }

@media (prefers-reduced-motion: reduce) {
  .rank-sheet, .rank-sheet-panel { animation: none !important; }
  .rank-frame svg * { animation: none !important; }
}
.rank-frame.is-compact svg { overflow: hidden; }
button.fesho-rank { padding-left: 10px; }
button.fesho-rank .fesho-rank-head { gap: 10px; }
/* Paleta propia de la hoja de rangos, según el tema de la app. */
.rank-sheet { --rs-bg: #F4F7FB; --rs-card: #FFFFFF; --rs-line: #DCE3EC; --rs-ink: #172334; --rs-muted: #5C6D80; --rs-chip: #EEF3F8; --rs-xp: #1A8AD4; }
html[data-theme="dark"] .rank-sheet { --rs-bg: #0B0C0F; --rs-card: #17191E; --rs-line: #262A31; --rs-ink: #EEF0F4; --rs-muted: #A0A6B0; --rs-chip: #0F1218; --rs-xp: #3DB5FF; }
.rank-sheet-panel { background: var(--rs-bg); color: var(--rs-ink); }
.rank-sheet-head { border-bottom-color: var(--rs-line); }
.rank-sheet-head h2, .rank-sheet-close, .rank-row-title h3, .rank-level b { color: var(--rs-ink); }
.rank-summary, .rank-row { background: var(--rs-card); border-color: var(--rs-line); }
.rank-row.is-current { border-color: #3DB5FF; }
.rank-summary small, .rank-summary p, .rank-phrase, .rank-badge.is-locked { color: var(--rs-muted); }
.rank-summary strong, .rank-summary p b, .rank-level span, html:not([data-theme="light"]) .rank-level span, html:not([data-theme="light"]) .rank-summary strong { color: var(--rs-xp); }
.rank-level { background: var(--rs-chip); }
.rank-level.is-current { background: #3DB5FF1F; }

/* ===== Logo FESHO ===== */
.fesho-logo-mark { display: block; width: 88px; height: 88px; margin: 0 auto 6px; border-radius: 22px; box-shadow: 0 10px 28px #0A62FF33; }
.brand { display: flex; align-items: center; gap: 8px; }
.fesho-brand-logo { display: block; width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; }
body.home-screen-active .fesho-brand-logo { width: 32px; height: 32px; }

/* ===== Comunidad (prototipo forus_comunidad_claro_oscuro_v4) =====
   Los botones llevan su color fijado aquí para que se vean sin pasar el dedo:
   blanco suave #C4C8CF en oscuro, negro suave #4A4C52 en claro. */
:root { --cm-bg:#0B0C0F; --cm-cd:#17191E; --cm-ln:#262A31; --cm-hv:#1F2228; --cm-tx:#F4F5F7; --cm-tx3:#D2D6DC; --cm-tx2:#C4C8CF; --cm-mu:#8A8F98; --cm-in:#0F1115; --cm-logo:#B6F36A; --cm-foru:#B6F36A; --cm-xp:#3DB5FF; --cm-fl:#FF8A3D; --cm-wk:#A970FF; --cm-easy:#6BD12F; --cm-medium:#FFC21A; --cm-hard:#FF4D4D; --cm-av:#2A2E36; --cm-tbon:#2C3038; }
html[data-theme="light"] { --cm-bg:#F6F4EF; --cm-cd:#FFFFFF; --cm-ln:#E6E2DA; --cm-hv:#F1EEE7; --cm-tx:#16181C; --cm-tx3:#2E3036; --cm-tx2:#4A4C52; --cm-mu:#85827B; --cm-in:#FBFAF7; --cm-logo:#4F7A12; --cm-foru:#3E7A0C; --cm-xp:#1A8AD4; --cm-fl:#E0661A; --cm-wk:#7C4BD6; --cm-easy:#3E8A12; --cm-medium:#A67800; --cm-hard:#D63636; --cm-av:#D9D4CA; --cm-tbon:#ECE8E0; }
.cm { color: var(--cm-tx3); }
.cm p { margin: 0; color: var(--cm-tx3); }
.cm button { appearance: none; background: none; border: 0; margin: 0; font: inherit; cursor: pointer; color: var(--cm-tx2); -webkit-text-fill-color: currentColor; opacity: 1; min-height: 0; box-shadow: none; }
html[data-theme="light"] .cm button { color: var(--cm-tx2); }
.cm button * { color: inherit; }
.cm button:hover { color: var(--cm-tx3); }
.cm button:focus-visible, .cm .cm-file:focus-within { outline: 2px solid var(--cm-xp); outline-offset: 2px; }
.cm .icon-svg { width: 20px; height: 20px; }
.cm-tabs { display: flex; background: var(--cm-cd); border: 1.5px solid var(--cm-ln); border-radius: 12px; padding: 3px; margin: 4px 0 12px; }
.cm .cm-tabs button { flex: 1; text-align: center; font-size: 14px; font-weight: 600; padding: 10px 0; border-radius: 9px; min-height: 40px; }
.cm .cm-tabs button.is-on, html[data-theme="light"] .cm .cm-tabs button.is-on { color: var(--cm-tx3); background: var(--cm-tbon); box-shadow: inset 0 -2px 0 var(--cm-logo); }
.cm-tabs.is-inner { margin: 0 0 8px; }
.cm-card { background: var(--cm-cd); border: 2px solid var(--cm-ln); border-bottom-width: 4px; border-radius: 18px; padding: 12px; margin-bottom: 10px; }
.cm-card.is-new { border-color: var(--cm-xp); }
.cm-card-head { display: flex; gap: 8px; align-items: center; }
.cm-card-who { flex: 1; min-width: 0; }
.cm .cm-name { font-size: 15px; font-weight: 600; color: var(--cm-tx); }
.cm .cm-rank { margin-top: 1px; font-size: 12px; font-weight: 600; color: var(--cm-rank); }
html[data-theme="light"] .cm .cm-rank { color: var(--cm-rank-light); }
.cm .cm-muted, .cm .cm-muted b { font-size: 12px; color: var(--cm-mu); margin-top: 1px; }
.cm .cm-muted b { font-weight: 600; }
.cm-demo { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--cm-hv); font-size: 11px; font-weight: 600; }
.cm .cm-icon-btn { padding: 6px; border-radius: 10px; align-self: flex-start; }
.cm .cm-icon-btn .icon-svg { width: 22px; height: 22px; }
.cm .cm-title { margin-top: 10px; font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--cm-tx); }
.cm .cm-title-sm { margin: 0 0 8px; font-size: 15px; }
.cm .cm-desc { margin-top: 4px; font-size: 14px; line-height: 1.5; }
.cm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 10px 0; }
.cm-stats dt { font-size: 11px; color: var(--cm-mu); }
.cm-stats dd { margin: 2px 0 0; display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.cm-stats dd .icon-svg { width: 16px; height: 16px; }
.cm-highlight { display: flex; align-items: center; gap: 10px; background: var(--cm-hv); border-radius: 12px; padding: 9px 11px; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.cm-highlight .icon-svg { width: 22px; height: 22px; color: #E3AD2F; }
.cm-photo { border-radius: 12px; overflow: hidden; margin-bottom: 8px; }
.cm-photo-img { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.cm-social { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.cm-social-forus { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cm-faces { display: flex; }
.cm-faces .cm-mini-av + .cm-mini-av { margin-left: -10px; }
.cm .cm-link { font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--cm-tx2); display: inline-flex; align-items: center; gap: 4px; }
.cm .cm-link .icon-svg { width: 16px; height: 16px; }
.cm button.cm-link { padding: 6px 2px; }
.cm-mini-av { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; border-radius: 50%; background: var(--cm-av); color: var(--cm-tx3); border: 1.5px solid var(--cm-rank); font-size: 9px; font-weight: 700; letter-spacing: -.3px; line-height: 1; box-shadow: 0 0 0 1.5px var(--cm-cd); }
html[data-theme="light"] .cm-mini-av { border-color: var(--cm-rank-light); }
.cm-mini-av img { width: 100%; height: 100%; object-fit: cover; }
.cm-actions { display: flex; border-top: 1.5px solid var(--cm-ln); margin-top: 10px; padding-top: 6px; }
.cm .cm-act { flex: 1; display: flex; justify-content: center; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; padding: 8px 0; border-radius: 10px; min-height: 44px; }
.cm .cm-act:hover { background: var(--cm-hv); }
.cm .cm-act .icon-svg { width: 21px; height: 21px; }
.cm .cm-act[aria-pressed="true"], html[data-theme="light"] .cm .cm-act[aria-pressed="true"] { color: var(--cm-foru); }
.cm-comments { margin-top: 6px; }
.cm-comment { display: flex; gap: 6px; margin: 8px 0; align-items: flex-start; }
.cm-bubble { flex: 1; background: var(--cm-hv); border-radius: 12px; padding: 7px 10px; }
.cm-bubble p { font-size: 13px; }
.cm .cm-bubble-name { font-weight: 600; color: var(--cm-tx); }
.cm-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.cm-input { width: 100%; min-width: 0; background: var(--cm-in); border: 1.5px solid var(--cm-ln); border-radius: 12px; color: var(--cm-tx3); padding: 10px 11px; font: inherit; font-size: 15px; outline: none; }
html[data-theme="light"] .cm .cm-input { background: var(--cm-in); color: var(--cm-tx3); border-color: var(--cm-ln); }
.cm-input::placeholder { color: var(--cm-mu); }
.cm-input:focus { border-color: var(--cm-xp); }
textarea.cm-input { resize: vertical; }
.cm .cm-error { min-height: 0; margin: 4px 2px 0; font-size: 12px; color: #E5484D; }
.cm .cm-error:empty { margin: 0; }
.cm .cm-bp, html[data-theme="light"] .cm .cm-bp, .cm .cm-bp:hover { color: #fff; background: #3DB5FF; font-weight: 600; font-size: 14px; padding: 10px 14px; border-radius: 12px; box-shadow: 0 3px 0 #1E86C4; text-align: center; white-space: nowrap; min-height: 42px; }
.cm .cm-bs { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 2px solid #3DB5FF; font-weight: 600; font-size: 13px; padding: 7px 11px; border-radius: 12px; white-space: nowrap; min-height: 38px; }
.cm .cm-bs .icon-svg { width: 17px; height: 17px; }
.cm .cm-bg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: 13px; padding: 9px 12px; border-radius: 12px; border: 2px solid var(--cm-ln); min-height: 42px; }
.cm .cm-send { padding: 10px 12px; }
.cm .cm-send .icon-svg { width: 18px; height: 18px; }
.cm-hint { display: flex; align-items: center; gap: 8px; background: var(--cm-cd); border: 1.5px dashed var(--cm-xp); border-radius: 14px; padding: 9px 11px; margin-bottom: 10px; }
.cm-hint > .icon-svg { color: var(--cm-xp); }
.cm-hint span { flex: 1; font-size: 13px; }
.cm .cm-summary { margin: 0 4px 8px; font-size: 13px; font-weight: 600; }
.cm-mine { display: flex; gap: 10px; align-items: center; }
.cm-thumb { width: 54px; height: 54px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.cm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-thumb.is-empty { display: flex; align-items: center; justify-content: center; background: var(--cm-hv); }
.cm-thumb.is-empty .icon-svg { width: 24px; height: 24px; }
.cm-mine-body { flex: 1; min-width: 0; }
.cm .cm-mine-title { font-size: 15px; font-weight: 600; color: var(--cm-tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm .cm-mine-social { margin-top: 2px; font-size: 12px; font-weight: 600; }
.cm-empty { text-align: center; padding: 22px 16px; }
.cm-empty .cm-title { margin-top: 0; }
.cm-empty .cm-desc { margin: 6px 0 14px; }
.cm .cm-edit-meta { margin: 2px 0 12px; }
.cm .cm-label { display: block; margin: 10px 0 4px; font-size: 13px; font-weight: 600; color: var(--cm-tx3); }
.cm .cm-file { flex: 1; cursor: pointer; color: var(--cm-tx2); }
.cm-edit-actions .cm-bg { flex: 1; }
.cm-edit-actions .cm-bp { flex: 2; }
.cm-person { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.cm-card.cm-person { margin-top: 0; }
.cm-person-body { flex: 1; min-width: 0; }
.cm-friend { padding: 8px 11px; }
.cm-friend > .icon-svg { color: var(--cm-tx2); }
.cm .cm-invite { width: 100%; margin-top: 10px; border-style: dashed; }
.cm .cm-section { margin: 6px 4px 8px; font-size: 13px; font-weight: 600; }
.cm .cm-footnote { margin: 4px 4px 0; font-size: 12px; color: var(--cm-mu); }
@keyframes cm-pop { from { transform: scale(.96); } to { transform: scale(1); } }
.cm-card.is-new { animation: cm-pop .6s ease-out; }
@media (prefers-reduced-motion: reduce) { .cm-card.is-new { animation: none; } }
@media (max-width: 380px) { .cm .cm-act { font-size: 13px; gap: 3px; } .cm-stats dd { font-size: 13px; } }
/* Comunidad conectada: estados de carga, insignia de solicitudes y textos de ayuda. */
.cm-badge { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; align-items: center; justify-content: center; border-radius: 9px; background: #FF4D4D; color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.cm .cm-hint-text { margin: 4px 2px 0; font-size: 12px; color: var(--cm-mu); }
.cm .cm-more { width: 100%; margin-bottom: 10px; }
.cm .cm-comments-status { margin: 8px 2px; }
.cm button:disabled { opacity: .55; cursor: default; }
.cm-skel { height: 180px; background: linear-gradient(100deg, var(--cm-cd) 30%, var(--cm-hv) 50%, var(--cm-cd) 70%); background-size: 300% 100%; animation: cm-shimmer 1.4s linear infinite; }
@keyframes cm-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .cm-skel { animation: none; } }
/* ===== Comunidad: Supabase (perfiles, amigos, actividades) ===== */
.cm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cm-head-actions { display: flex; gap: 6px; }
.cm-head-btn { appearance: none; position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--cm-ln); background: var(--cm-cd); color: var(--cm-tx2); -webkit-text-fill-color: currentColor; cursor: pointer; }
html[data-theme="light"] .cm-head-btn { color: var(--cm-tx2); background: var(--cm-cd); border-color: var(--cm-ln); }
.cm-head-btn:hover { color: var(--cm-tx3); }
.cm-head-btn:focus-visible { outline: 2px solid var(--cm-xp); outline-offset: 2px; }
.cm-head-btn .icon-svg { width: 21px; height: 21px; }
.cm-head-btn .cm-badge { position: absolute; top: -6px; right: -6px; margin: 0; }
.cm-pull { margin: 0 0 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--cm-tx2); }
.rank-frame.is-mini svg { width: 100%; height: 100%; }
.cm .cm-title-edit { margin: 0 0 2px; font-size: 16px; }
.cm-comment { position: relative; }
.cm .cm-comment-del { align-self: center; padding: 10px; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.cm .cm-comment-del .icon-svg { width: 18px; height: 18px; }
.cm-sent { display: inline-flex; align-items: center; gap: 8px; }
.cm .cm-cancel { min-height: 44px; padding: 0 4px; text-decoration: underline; text-underline-offset: 3px; }
.cm .cm-handle { color: var(--cm-mu); font-weight: 500; }
.cm-friend .cm-icon-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.cm-at-field { display: flex; align-items: center; gap: 6px; }
.cm-at-field > span { font-size: 16px; font-weight: 600; color: var(--cm-tx2); }
.cm-sheet .cm-desc { margin: 4px 0 6px; }
.cm .cm-icon-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.cm-invite-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 6px 0 4px; }
.cm-invite-card .cm-name { font-size: 18px; }
.cm-invite-card .action { margin-top: 10px; }
.phone-panel { display: grid; gap: 10px; }
.phone-label { font-weight: 600; }
.phone-toggle { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; cursor: pointer; }
.phone-toggle input { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; accent-color: #3DB5FF; }
.phone-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.phone-status { margin: 0; font-size: 13px; }
.phone-status.is-error { color: #E5484D; }

/* ===== Escudos 3D (Perfil: vitrina y detalle) ===== */
.shield-showcase .shield-head h2 { margin: 0; color: var(--cm-tx); font-size: 20px; font-weight: 800; }
.shield-showcase .shield-head p { margin: 4px 0 0; color: var(--cm-mu); font-size: 14px; }
.shield-vitrina { margin-top: 14px; padding: 18px 14px; background: var(--cm-cd); border: 2px solid var(--cm-ln); border-bottom-width: 4px; border-radius: 20px; }
.shield-empty { margin: 0; text-align: center; color: var(--cm-mu); font-size: 14px; line-height: 1.45; }
.shield-divider { display: flex; align-items: center; gap: 12px; margin: 24px 4px 12px; color: var(--cm-tx2); font-size: 15px; font-weight: 600; }
.shield-divider::after { content: ""; flex: 1; height: 1px; background: var(--cm-ln); }
.shield-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 6px; }
.shield-item { appearance: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 0; border-radius: 14px; background: none; color: var(--cm-tx); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
html[data-theme="light"] .shield-item { color: var(--cm-tx); background: none; }
.shield-item:focus-visible { outline: 2px solid var(--cm-xp); outline-offset: 2px; }
.shield-item-name { margin-top: 6px; color: var(--cm-tx); font-size: 15px; font-weight: 700; }
.shield-item-lock { color: var(--cm-mu); font-size: 12px; }
.shield-item.is-locked .shield-mini { filter: grayscale(1) brightness(.45); }
.shield-mini-wrap { display: block; padding: 16px 26px 4px; perspective: 700px; }

.shield3d { position: relative; display: block; width: var(--w); height: calc(var(--w) * 1.32); transform-style: preserve-3d; will-change: transform; }
.shield3d > * { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.shield3d svg { display: block; width: 100%; height: 100%; overflow: visible; }
.shield-front, .shield-back { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.shield-front { transform: translateZ(calc(var(--t) / 2 + .5px)); }
/* rotateY(180deg): el texto del reverso se lee bien, no en espejo. */
.shield-back { transform: rotateY(180deg) translateZ(calc(var(--t) / 2 + .5px)); }
.shield-deco { transform: translateZ(0); }
.shield-mini { --w: 110px; --t: 7px; pointer-events: none; }

body.shield-detail-open { overflow: hidden; }
.shield-detail:not([hidden]) { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; overflow: auto; background: var(--cm-bg); }
.shield-detail-inner { display: flex; flex-direction: column; width: 100%; max-width: 440px; min-height: 100%; padding: max(12px, env(safe-area-inset-top)) 16px 32px; }
.shield-topbar { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.shield-iconbtn { appearance: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--cm-hv); color: var(--cm-tx2); cursor: pointer; }
html[data-theme="light"] .shield-iconbtn { background: var(--cm-hv); color: var(--cm-tx2); }
.shield-iconbtn svg { width: 22px; height: 22px; }
.shield-iconbtn:focus-visible, .shield-stage:focus-visible { outline: 2px solid var(--cm-xp); outline-offset: 2px; }
.shield-stage { position: relative; display: grid; place-items: center; height: calc(min(62vw, 250px) * 1.32 + 110px); margin-top: 8px; perspective: 1100px; touch-action: pan-y; -webkit-user-select: none; user-select: none; cursor: grab; border-radius: 20px; }
.shield-stage:active { cursor: grabbing; }
.shield-big { --w: min(62vw, 250px); --t: calc(var(--w) * .07); }
.shield-floor { position: absolute; bottom: 26px; width: 55%; height: 18px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .7), transparent); filter: blur(4px); transform: scaleX(var(--shadow-w, 1)); }
.shield-halo { position: absolute; width: 80%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, var(--halo, transparent), transparent); opacity: .35; filter: blur(10px); }
.shield-hint { position: absolute; bottom: 0; color: var(--cm-mu); font-size: 13px; transition: opacity .4s; }
.shield-hint.is-hidden { opacity: 0; }
.shield-info { margin-top: 6px; text-align: center; }
.shield-info h2 { margin: 0; color: var(--cm-tx); font-size: 24px; font-weight: 800; }
.shield-info p { margin: 8px 0 0; padding: 0 8px; color: var(--cm-mu); font-size: 15px; line-height: 1.45; }
.shield-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.shield-chip { padding: 6px 12px; border: 1px solid var(--cm-ln); border-radius: 999px; background: var(--cm-hv); color: var(--cm-tx2); font-size: 13px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .shield-hint { transition: none; } }
.shield-chip.is-rank { color: var(--chip-dark); }
html[data-theme="light"] .shield-chip.is-rank { color: var(--chip-light); }

/* ===== Perfil estilo Strava ===== */
#screen-profile { --sv-accent: #FC5200; --sv-accent-press: #E04900; }
.sv-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sv-hero { display: flex; align-items: center; gap: 16px; padding: 8px 0 4px; }
.sv-photo { flex: 0 0 auto; }
.sv-identity { min-width: 0; flex: 1; }
.sv-identity h2 { margin: 0; color: var(--cm-tx); font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sv-handle { margin: 4px 0 0; color: var(--cm-mu); font-size: 14px; }
.sv-rank-line { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--sv-accent); font-size: 14px; font-weight: 700; }
.sv-rank-line .icon-svg { width: 16px; height: 16px; }
.sv-follow { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; }
.sv-follow > div { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; border-left: 1px solid var(--cm-ln); }
.sv-follow > div:first-child { padding-left: 0; border-left: 0; }
.sv-follow span { color: var(--cm-mu); font-size: 13px; }
.sv-follow strong { color: var(--cm-tx); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.sv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--cm-ln); border-radius: 6px; background: var(--cm-cd); color: var(--cm-tx); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.sv-btn .icon-svg { width: 18px; height: 18px; }
.sv-btn.is-primary { border-color: var(--sv-accent); background: var(--sv-accent); color: #fff; }
.sv-btn.is-primary:active { background: var(--sv-accent-press); }
.sv-btn:focus-visible, .sv-row:focus-visible { outline: 3px solid var(--cm-xp); outline-offset: 2px; }
.sv-logout { width: 100%; color: #E5484D; }
.sv-card { margin-top: 18px; padding: 16px; border: 1px solid var(--cm-ln); border-radius: 8px; background: var(--cm-cd); }
.sv-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sv-card-head h2 { margin: 0; color: var(--cm-tx); font-size: 17px; font-weight: 800; }
.sv-chip { color: var(--cm-mu); font-size: 12px; font-weight: 600; }
.sv-week-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.sv-week-stats > div { display: flex; flex-direction: column; gap: 2px; }
.sv-week-stats span, .sv-totals dt { color: var(--cm-mu); font-size: 12px; }
.sv-week-stats strong { color: var(--cm-tx); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sv-week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 96px; margin-top: 16px; }
.sv-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.sv-bar i { display: block; width: 100%; max-width: 26px; border-radius: 3px 3px 0 0; background: var(--cm-ln); }
.sv-bar.is-on i { background: var(--sv-accent); }
.sv-bar span { color: var(--cm-mu); font-size: 11px; font-weight: 600; }
.sv-totals { margin: 8px 0 0; }
.sv-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--cm-ln); }
.sv-totals dt { font-size: 14px; }
.sv-totals dd { margin: 0; color: var(--cm-tx); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sv-goal { margin-top: 14px; }
.sv-goal-top { display: flex; justify-content: space-between; gap: 10px; color: var(--cm-tx2); font-size: 13px; font-weight: 600; }
.sv-goal-top span:last-child { color: var(--cm-mu); font-variant-numeric: tabular-nums; }
.sv-goal-track { height: 8px; margin-top: 8px; border-radius: 99px; background: var(--cm-ln); overflow: hidden; }
.sv-goal-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--sv-accent); transition: width .4s ease; }
.sv-list { margin-top: 18px; border: 1px solid var(--cm-ln); border-radius: 8px; background: var(--cm-cd); overflow: hidden; }
.sv-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 14px; border: 0; border-top: 1px solid var(--cm-ln); background: none; color: var(--cm-tx); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.sv-row:first-child { border-top: 0; }
.sv-row:active { background: var(--cm-hv); }
.sv-row-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--sv-accent) 14%, transparent); color: var(--sv-accent); }
.sv-row-icon .icon-svg { width: 18px; height: 18px; }
.sv-row-text { flex: 1; }
.sv-chev { width: 18px; height: 18px; color: var(--cm-mu); }
@media (prefers-reduced-motion: reduce) { .sv-goal-track i { transition: none; } }

/* ===== Sesión 2026-12-02: tema completo en Inicio y barra, móvil y celebraciones ===== */
/* Inicio: mismos tokens que Comunidad, en claro y en oscuro. */
html:not([data-theme="light"]) body { background: var(--cm-bg) !important; background-image: none !important; color: var(--cm-tx3); }
html[data-theme="light"] body.home-screen-active { background: var(--cm-bg); }
html:not([data-theme="light"]) .fesho-home, html:not([data-theme="light"]) .fesho-catalog-section {
  --f-card: #17191E; --f-line: #262A31; --f-text: #F4F5F7; --f-text2: #C4C8CF; --f-muted: #8A8F98;
  --f-xp-text: #3DB5FF; --f-easy: #6BD12F; --f-medium: #FFC21A; --f-hard: #FF4D4D;
}
.fesho-home, .fesho-catalog-section { --f-zebra: repeating-linear-gradient(135deg, #55524C 0 6px, #EEEAE3 6px 12px); }
html[data-theme="light"] .fesho-home, html[data-theme="light"] .fesho-catalog-section { --f-text: #16181C; --f-text2: #4A4C52; }
html:not([data-theme="light"]) body.home-screen-active #homeTitle { color: var(--cm-tx) !important; }
html:not([data-theme="light"]) body.home-screen-active .home-hero-copy p { color: var(--cm-mu); }
html:not([data-theme="light"]) .home-mountains { opacity: .1; }
html:not([data-theme="light"]) body.home-screen-active .avatar { background: var(--cm-hv); color: var(--cm-tx2); }
.fesho-home .fesho-rank, .fesho-home .fesho-rank-name { color: var(--f-text); }
.fesho-stat.is-streak { color: #E0661A; } .fesho-stat.is-streak b { color: inherit; }
html:not([data-theme="light"]) .fesho-stat.is-streak { color: #FF8A3D; }
html:not([data-theme="light"]) .fesho-stat.is-xp { color: #3DB5FF; }
.fesho-season { margin: 10px 2px 0; color: var(--f-muted); font-size: 12px; }
.fesho-small-button { min-height: 44px; }
.fesho-progress-form input { min-height: 44px; }
/* El texto del botón no debe ensanchar la página: en móvil pasa debajo del título. */
.fesho-home, .fesho-list { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 560px) {
  .fesho-row { flex-wrap: wrap; }
  .fesho-row-body { flex: 1 1 calc(100% - 60px); }
  .fesho-row > .fesho-check { width: 100%; justify-content: center; }
  .fesho-rank-row { flex-direction: row; }
  .fesho-rank-row > .fesho-rank { min-width: 0; }
}
/* Barra inferior */
html:not([data-theme="light"]) .bottom-nav, html:not([data-theme="light"]) body.home-screen-active .bottom-nav { background: #17191EF5; border-top-color: #262A31; box-shadow: none; }
html:not([data-theme="light"]) .bottom-nav .nav-button, html:not([data-theme="light"]) body[class] .bottom-nav > .nav-button { color: #C4C8CF; }
html:not([data-theme="light"]) .bottom-nav .nav-button.active, html:not([data-theme="light"]) body[class] .bottom-nav > .nav-button.active { color: #3DB5FF; background: transparent; }
html:not([data-theme="light"]) .bottom-nav .nav-icon { background: transparent !important; border-color: transparent !important; }
html[data-theme="light"] .bottom-nav .nav-button, html[data-theme="light"] body[class] .bottom-nav > .nav-button { color: #4A4C52; }
html[data-theme="light"] .bottom-nav .nav-button.active, html[data-theme="light"] body[class] .bottom-nav > .nav-button.active { color: #0F6FC0; background: transparent; }
html[data-theme="light"] .bottom-nav .nav-icon { background: transparent !important; border-color: transparent !important; }
/* Avisos */
.toast, html[data-theme="light"] .toast { background: var(--cm-cd); border: 2px solid var(--cm-ln); color: var(--cm-tx); font-size: 14px; }
html:not([data-theme="light"]) .celebration-card h2 { color: var(--cm-tx); }
/* Botón grueso de juego */
.game-button { min-height: 48px; padding: 0 28px; border: 0; border-radius: 14px; background: #3DB5FF; box-shadow: 0 4px 0 #1E86C4; color: #FFFFFF; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; }
.game-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #1E86C4; }
.game-button:focus-visible, .theme-choice button:focus-visible { outline: 3px solid var(--cm-tx); outline-offset: 2px; }
.game-link { min-height: 44px; border: 0; background: none; color: var(--cm-tx2); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.xp-fly { position: fixed; z-index: 70; pointer-events: none; color: #3DB5FF; font-size: 18px; font-weight: 800; text-shadow: 0 1px 0 #0006; }
/* Subida de rango */
.rank-up:not([hidden]) { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: #0B0C0FE6; overflow: hidden auto; }
.rank-up-card { position: relative; display: grid; justify-items: center; gap: 10px; width: min(100%, 360px); padding: 26px 20px; border: 2px solid var(--cm-ln); border-bottom-width: 4px; border-radius: 22px; background: var(--cm-cd); text-align: center; animation: rank-up-in .45s cubic-bezier(.34,1.3,.64,1); }
.rank-up-kicker { margin: 0; color: #3DB5FF; font-weight: 800; } html[data-theme="light"] .rank-up-kicker { color: #1A8AD4; }
.rank-up-card h2 { margin: 0; color: var(--cm-tx); font-size: 28px; } .rank-up-card p { color: var(--cm-tx3); }
.rank-up-confetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; animation: rank-up-fall 2.4s ease-in both; }
@keyframes rank-up-in { from { transform: scale(.8); opacity: 0; } }
@keyframes rank-up-fall { to { transform: translateY(110vh) rotate(540deg); opacity: .2; } }
/* Apariencia */
.theme-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-choice button { min-height: 44px; border: 2px solid var(--cm-ln); border-radius: 12px; background: var(--cm-cd); color: var(--cm-tx2); font: inherit; font-weight: 700; cursor: pointer; }
.theme-choice button[aria-pressed="true"] { border-color: #3DB5FF; color: var(--cm-tx); }
/* Trofeos */
.shield-item-xp { color: var(--cm-xp); font-size: 14px; font-weight: 700; } .shield-item-best { color: #8A6200; font-size: 12px; font-weight: 700; }
html:not([data-theme="light"]) .shield-item-best { color: #F2C94C; }
.shield-chip.is-xp { color: var(--cm-xp); } .shield-chip.is-best { color: #8A6200; } html:not([data-theme="light"]) .shield-chip.is-best { color: #F2C94C; }
.shield3d.is-medal { height: var(--w); }
.shield-item { min-width: 0; } .shield-item-lock { text-align: center; }
.shield-divider span { color: var(--cm-mu); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .rank-up-card, .rank-up-confetti i { animation: none; } }

html:not([data-theme="light"]) body[class] #screen-wars h1, html:not([data-theme="light"]) #screen-wars .war-help { color: var(--cm-tx); }
html:not([data-theme="light"]) body[class] .action.quiet { background: var(--cm-cd); border-color: var(--cm-ln); color: var(--cm-tx2); }
html[data-theme="light"] .eyebrow { color: #B4510F; }
.rank-up-card .rank-up-kicker { color: #3DB5FF; } html[data-theme="light"] .rank-up-card .rank-up-kicker { color: #1A8AD4; }
.onboarding:not([hidden]) { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 20px; background: var(--cm-bg); overflow: auto; }
.onboarding-card { display: grid; justify-items: center; gap: 14px; width: min(100%, 380px); text-align: center; }
.onboarding-icon { display: grid; place-items: center; width: 112px; height: 112px; border-radius: 32px; background: #3DB5FF; box-shadow: 0 6px 0 #1E86C4; color: #FFFFFF; }
.onboarding-icon .icon-svg { width: 56px; height: 56px; }
.onboarding-card h2 { margin: 14px 0 0; color: var(--cm-tx); font-size: 26px; line-height: 1.2; }
.onboarding-card p { margin: 0; color: var(--cm-tx3); font-size: 16px; line-height: 1.5; }
.onboarding-dots { display: flex; gap: 8px; margin: 8px 0; } .onboarding-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--cm-ln); } .onboarding-dots i.is-on { width: 24px; background: #3DB5FF; }
.onboarding-card .game-button { width: 100%; }
.sv-delete { width: 100%; color: #C62F35; } html:not([data-theme="light"]) .sv-delete { color: #FF6B70; }
.offline-bar:not([hidden]) { position: fixed; z-index: 75; top: 0; left: 0; right: 0; margin: 0; padding: max(8px, env(safe-area-inset-top)) 12px 8px; background: #3A2A05; color: #FFE7A8; font-size: 13px; font-weight: 600; text-align: center; }

html:not([data-theme="light"]) .fesho-row, html:not([data-theme="light"]) .fesho-row.is-complete { background: var(--f-card) !important; border-color: var(--f-line) !important; }
html:not([data-theme="light"]) .rank-summary .action.secondary { background: var(--cm-hv); border-color: var(--cm-ln); color: var(--cm-tx2); }
.cm .cm-bp { min-height: 44px; }

.shield-mini { will-change: auto; }
.shield-item { content-visibility: auto; contain-intrinsic-size: auto 210px; }

.modal .close-button { width: 44px; height: 44px; min-width: 44px; }
.modal input:not([type=checkbox]):not([type=radio]), .modal select { min-height: 44px; }

/* =====================================================================
   FESHO · Diseño 2026-12 (estilo Strava / Nike / Apple con la paleta propia)
   Capa final: manda sobre las anteriores. Tokens --cm-* (claro y oscuro).
   ===================================================================== */
:root { --ds-radius: 20px; --ds-radius-sm: 14px; --ds-num: "Space Grotesk", Inter, system-ui, sans-serif; --ds-brand: #B6F36A; --ds-xp: #3DB5FF; --ds-shadow: 0 1px 0 #ffffff08 inset, 0 10px 30px #00000040; }
html[data-theme="light"] { --ds-brand: #4F7A12; --ds-xp: #1A8AD4; --ds-shadow: 0 1px 2px #16181C0f, 0 8px 24px #16181C0d; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
body:not(.auth-locked) { background: var(--cm-bg) !important; color: var(--cm-tx3); }
.app-shell, body[class] .app-shell { width: min(100% - 32px, 560px) !important; margin: 0 auto; padding-top: max(10px, env(safe-area-inset-top)) !important; padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important; color: var(--cm-tx3); }

/* Barra superior */
.topbar, body[class] .topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; margin: 0 -16px 14px !important; padding: 10px 16px; background: color-mix(in srgb, var(--cm-bg) 86%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.topbar .theme-toggle { display: none !important; }
.avatar, body[class] .avatar { width: 40px !important; height: 40px !important; border: 2px solid var(--cm-ln) !important; border-radius: 50% !important; background: var(--cm-cd) !important; color: var(--cm-tx2) !important; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.fesho-stats { gap: 14px; font-family: var(--ds-num); font-size: 15px; }

/* Barra inferior: 4 pestañas, cristal, indicador */
.bottom-nav, body[class] .bottom-nav { position: fixed !important; left: 50% !important; right: auto !important; bottom: max(10px, env(safe-area-inset-bottom)) !important; transform: translateX(-50%) !important; width: min(calc(100% - 24px), 520px) !important; display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 4px !important; padding: 6px !important; border: 1px solid var(--cm-ln) !important; border-radius: 24px !important; background: color-mix(in srgb, var(--cm-cd) 88%, transparent) !important; backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 12px 40px #0000004d !important; }
html[data-theme="light"] .bottom-nav, html[data-theme="light"] body[class] .bottom-nav { box-shadow: 0 12px 32px #16181C1f !important; }
.bottom-nav > .nav-button, body[class] .bottom-nav > .nav-button { display: grid !important; justify-items: center; align-content: center; gap: 3px; height: 56px !important; min-width: 0; border: 0 !important; border-radius: 18px !important; background: transparent !important; color: var(--cm-tx2) !important; font-size: 11.5px !important; font-weight: 600 !important; letter-spacing: .01em; }
.bottom-nav .nav-icon, body[class] .bottom-nav .nav-icon { display: grid !important; place-items: center; width: auto !important; height: 26px !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: currentColor !important; transform: none !important; }
.bottom-nav .icon-svg { width: 24px !important; height: 24px !important; }
.bottom-nav > .nav-button.active, body[class] .bottom-nav > .nav-button.active { color: var(--cm-tx) !important; background: color-mix(in srgb, var(--ds-brand) 16%, transparent) !important; }
.bottom-nav > .nav-button.active .nav-icon { color: var(--ds-brand) !important; }

/* Títulos de pantalla */
.page-head h1, #communityTitle, #warsTitle { color: var(--cm-tx) !important; font-size: 32px !important; font-weight: 800 !important; letter-spacing: -.03em; }
.page-head .eyebrow, .eyebrow { color: var(--ds-brand) !important; font-size: 12px !important; font-weight: 800 !important; letter-spacing: .12em; }

/* Inicio */
body.home-screen-active .home-hero { min-height: 0 !important; margin: 4px 0 18px !important; }
body.home-screen-active .home-hero-copy { width: 100% !important; padding: 6px 0 0 !important; }
body.home-screen-active #homeTitle, body.home-screen-active .home-hero h1 { color: var(--cm-tx) !important; font-size: clamp(28px, 8vw, 36px) !important; font-weight: 800 !important; letter-spacing: -.035em; }
body.home-screen-active .home-hero-copy p { margin-top: 6px !important; color: var(--cm-mu) !important; font-size: 16px !important; }
.home-mountains { display: none !important; }
.fesho-box, .fesho-row, .fesho-message, .fesho-catalog-column { border-radius: var(--ds-radius) !important; box-shadow: var(--ds-shadow); }
.fesho-rank { padding: 16px !important; background: linear-gradient(135deg, color-mix(in srgb, var(--ds-xp) 14%, var(--f-card)), var(--f-card) 60%) !important; }
.fesho-rank-name { font-size: 18px !important; font-weight: 800 !important; letter-spacing: -.01em; }
.fesho-rank-track { height: 10px !important; border-radius: 99px !important; }
.fesho-rank-track > i { border-radius: 99px !important; background: linear-gradient(90deg, var(--ds-xp), color-mix(in srgb, var(--ds-xp) 70%, #fff)) !important; }
.fesho-today-xp { position: relative; min-width: 108px; padding: 12px !important; }
.fesho-today-xp::before { content: ""; position: absolute; inset: 10px; margin: auto; width: 78px; height: 78px; border-radius: 50%; background: conic-gradient(var(--ds-xp) calc(var(--p, 0) * 1%), color-mix(in srgb, var(--ds-xp) 16%, transparent) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); }
.fesho-today-xp small, .fesho-today-xp strong { position: relative; }
.fesho-today-xp strong { font-family: var(--ds-num); font-size: 20px !important; }
.fesho-h3 h2 { font-size: 19px !important; font-weight: 800 !important; letter-spacing: -.02em; }
.fesho-season { color: var(--cm-mu); font-weight: 600; }
.fesho-row { padding: 14px !important; gap: 14px !important; }
.fesho-row-title { font-size: 16px !important; font-weight: 700 !important; }
.fesho-row-icon { width: 46px !important; height: 46px !important; border-radius: 15px !important; }
.fesho-check { border-radius: 14px !important; min-height: 46px !important; font-size: 14px !important; font-weight: 700 !important; }
.fesho-xp-badge { background: #0F7BC4 !important; }

/* Tarjetas genéricas */
.cm-card, .sv-card, .sv-list, .panel, .war-team-card, .war-detail-section, .war-list-card, .war-inbox-card, .wars-toolbar { border-radius: var(--ds-radius) !important; box-shadow: var(--ds-shadow); }
html:not([data-theme="light"]) .panel, html:not([data-theme="light"]) .sv-card, html:not([data-theme="light"]) .sv-list { background: var(--cm-cd) !important; border-color: var(--cm-ln) !important; }
.section-title h2, .pf-section-title { margin: 26px 2px 10px; color: var(--cm-tx); font-size: 19px; font-weight: 800; letter-spacing: -.02em; }

/* Perfil */
.pf-hero { position: relative; display: grid; justify-items: center; padding: 0 0 8px; text-align: center; }
.pf-cover { position: absolute; inset: -16px -16px auto; height: 120px; border-radius: 0 0 28px 28px; background: radial-gradient(120% 140% at 20% 0%, color-mix(in srgb, var(--cm-rank, var(--ds-xp)) 55%, transparent), transparent 65%), radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--ds-brand) 40%, transparent), transparent 60%), var(--cm-cd); }
.pf-photo { position: relative; margin-top: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.pf-photo .rank-frame { width: 132px !important; }
.pf-name { margin: 6px 0 0; color: var(--cm-tx); font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.pf-handle { margin: 2px 0 0; color: var(--cm-mu); font-size: 15px; font-weight: 600; }
.pf-rank { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 5px 12px; border: 1px solid var(--cm-ln); border-radius: 99px; background: var(--cm-cd); color: var(--cm-rank, var(--ds-brand)); font-size: 13px; font-weight: 800; }
html[data-theme="light"] .pf-rank { color: var(--cm-rank-light, var(--ds-brand)); }
.pf-rank .icon-svg { width: 16px; height: 16px; }
.pf-bio { max-width: 34ch; margin: 12px auto 0; color: var(--cm-tx3); font-size: 15px; line-height: 1.45; }
.pf-actions { display: flex; justify-content: center; gap: 10px; width: 100%; margin-top: 16px; }
.pf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1; max-width: 220px; min-height: 46px; padding: 0 16px; border: 2px solid var(--cm-ln); border-radius: 14px; background: var(--cm-cd); color: var(--cm-tx2); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.pf-btn.is-primary { border-color: transparent; background: #3DB5FF; box-shadow: 0 4px 0 #1E86C4; color: #FFFFFF; }
.pf-btn .icon-svg { width: 18px; height: 18px; }
.pf-relation { display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px; border: 2px solid var(--cm-ln); border-radius: 14px; color: var(--cm-tx2); font-weight: 700; }
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0 4px; padding: 14px 4px; border: 1px solid var(--cm-ln); border-radius: var(--ds-radius); background: var(--cm-cd); box-shadow: var(--ds-shadow); }
.pf-stats > * { display: grid; justify-items: center; gap: 2px; min-width: 0; padding: 0 4px; border: 0; border-left: 1px solid var(--cm-ln); background: none; color: inherit; font: inherit; cursor: default; }
.pf-stats > :first-child { border-left: 0; }
.pf-stats > button { cursor: pointer; }
.pf-stats strong { color: var(--cm-tx); font-family: var(--ds-num); font-size: 22px; font-weight: 700; line-height: 1.1; }
.pf-stats > :first-child strong { color: var(--ds-xp); }
.pf-stats span { color: var(--cm-mu); font-size: 11.5px; font-weight: 600; text-align: center; }
.pf-tabs { position: sticky; top: 60px; z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px 0 12px; border-bottom: 1px solid var(--cm-ln); background: var(--cm-bg); }
.pf-tabs button { min-height: 48px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--cm-tx2); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.pf-tabs button[aria-selected="true"] { border-bottom-color: var(--ds-brand); color: var(--cm-tx); }
.pf-list { display: grid; gap: 10px; }
.pf-post { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--cm-ln); border-radius: var(--ds-radius-sm); background: var(--cm-cd); }
.pf-post-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; }
.pf-post-title { margin: 0; color: var(--cm-tx); font-size: 15.5px; font-weight: 700; }
.pf-post-meta, .pf-post-social { margin: 3px 0 0; color: var(--cm-mu); font-size: 13px; }
.pf-post-meta b { color: var(--ds-xp); }
.pf-more { min-height: 46px; border: 0; background: none; color: var(--ds-xp); font: inherit; font-weight: 700; cursor: pointer; }
.pf-empty { display: grid; justify-items: center; gap: 8px; padding: 28px 16px; border: 1px dashed var(--cm-ln); border-radius: var(--ds-radius); text-align: center; }
.pf-empty strong { color: var(--cm-tx); font-size: 17px; } .pf-empty span { color: var(--cm-mu); }
.pf-loading { padding: 40px; color: var(--cm-mu); text-align: center; }
#screen-profile .sv-card { margin-top: 0; margin-bottom: 12px; }
#screen-profile .shield-showcase { margin-top: 0; }

/* Perfil de otra persona */
.user-sheet:not([hidden]) { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; overflow: auto; background: var(--cm-bg); }
.user-sheet-inner { width: 100%; max-width: 520px; padding: max(8px, env(safe-area-inset-top)) 16px 40px; }
.pf-hero.is-sheet .pf-cover { inset: 0 -16px auto; }
.pf-hero.is-sheet .pf-photo { margin-top: 40px; cursor: default; }
.cm-user-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cm-user-link .cm-card-who > span { display: block; }
.cm-person > .cm-user-link { flex: 0 0 auto; }

/* Guerras */
.wars-toolbar { padding: 18px !important; border: 1px solid var(--cm-ln) !important; background: linear-gradient(135deg, color-mix(in srgb, var(--ds-xp) 18%, var(--cm-cd)), var(--cm-cd)) !important; }
.wars-toolbar p { color: var(--cm-tx) !important; font-size: 16px; font-weight: 700; }
.war-list-card, .war-team-card, .war-detail-section, .war-inbox-card { border: 1px solid var(--cm-ln) !important; background: var(--cm-cd) !important; color: var(--cm-tx3) !important; }
.war-list-card strong, .war-team-card h3, .war-detail-section h3, .war-section-heading h2 { color: var(--cm-tx) !important; }
.war-detail-hero { border-radius: var(--ds-radius) !important; }
.war-scoreboard-card { padding: 20px 16px !important; border: 1px solid var(--cm-ln) !important; border-radius: var(--ds-radius) !important; background: radial-gradient(100% 120% at 0% 0%, color-mix(in srgb, var(--ds-xp) 22%, transparent), transparent 60%), radial-gradient(100% 120% at 100% 0%, color-mix(in srgb, #FF4D4D 20%, transparent), transparent 60%), var(--cm-cd) !important; color: var(--cm-tx3); }
.war-scoreboard-teams { display: grid !important; grid-template-columns: 1fr auto 1fr; align-items: end; text-align: center; }
.war-scoreboard-teams strong { display: block; color: var(--cm-tx) !important; font-family: var(--ds-num); font-size: 40px !important; line-height: 1; }
.war-scoreboard-teams em { color: var(--cm-mu); font-size: 12px; font-style: normal; font-weight: 700; }
.war-scoreboard-teams small { color: var(--cm-tx2) !important; font-weight: 700; }
.war-scoreboard-teams > span { color: var(--cm-mu); font-weight: 800; }
.war-tug { height: 10px; margin: 16px 0 10px; overflow: hidden; border-radius: 99px; background: #FF4D4D; }
.war-tug > i { display: block; height: 100%; border-radius: 99px 0 0 99px; background: var(--ds-xp); transition: width .5s cubic-bezier(.22,1,.36,1); }
.war-rule-list { display: grid; gap: 10px; margin: 10px 0 14px; padding: 0; list-style: none; counter-reset: rule; }
.war-rule-list li { display: grid; grid-template-columns: 32px 1fr; column-gap: 10px; counter-increment: rule; }
.war-rule-list li::before { content: counter(rule); grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--ds-xp) 18%, transparent); color: var(--ds-xp); font-weight: 800; }
.war-rule-list strong { color: var(--cm-tx); } .war-rule-list span { color: var(--cm-mu); font-size: 14px; }
.war-go-challenges { width: 100%; }
.war-xp { color: var(--ds-xp); }
.war-help { color: var(--cm-mu) !important; }

/* Ventanas */
.modal { border: 1px solid var(--cm-ln) !important; border-radius: 24px !important; background: var(--cm-cd) !important; color: var(--cm-tx3) !important; }
.modal-head h2, .modal label { color: var(--cm-tx) !important; }
.modal input, .modal select, .modal textarea { border: 1.5px solid var(--cm-ln) !important; border-radius: 12px !important; background: var(--cm-bg) !important; color: var(--cm-tx) !important; }
.modal .close-button { border-radius: 50% !important; background: var(--cm-hv) !important; color: var(--cm-tx2) !important; }
.action.primary { border: 0 !important; border-radius: 14px !important; background: #3DB5FF !important; box-shadow: 0 4px 0 #1E86C4 !important; color: #FFFFFF !important; font-weight: 800 !important; }
.action.secondary { border-radius: 14px !important; }

/* Acceso */
body.auth-locked { background: var(--cm-bg) !important; }
.auth-screen, .launch-screen { background: radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--ds-xp) 22%, transparent), transparent 70%), var(--cm-bg) !important; color: var(--cm-tx3) !important; }
.auth-card { border: 1px solid var(--cm-ln) !important; border-radius: 28px !important; background: var(--cm-cd) !important; box-shadow: 0 24px 60px #0000004d !important; color: var(--cm-tx3) !important; }
.auth-card p, .launch-screen p { color: var(--cm-tx3) !important; }
.auth-card .footnote { color: var(--cm-mu) !important; }
.auth-tabs { border-radius: 14px !important; background: var(--cm-hv) !important; }
.auth-tabs button { border-radius: 11px !important; color: var(--cm-tx2) !important; font-weight: 700 !important; }
.auth-tabs button.active { background: var(--cm-cd) !important; color: var(--cm-tx) !important; }
.auth-card label { color: var(--cm-tx) !important; font-weight: 600; }
.auth-card input { min-height: 48px; border: 1.5px solid var(--cm-ln) !important; border-radius: 12px !important; background: var(--cm-bg) !important; color: var(--cm-tx) !important; }
.auth-error { color: #FF6B70 !important; }
.launch-skip { min-height: 48px; padding: 0 32px; border: 0; border-radius: 14px; background: #3DB5FF; box-shadow: 0 4px 0 #1E86C4; color: #FFFFFF; font-weight: 800; }

@media (max-width: 380px) { .pf-stats strong { font-size: 19px; } .war-scoreboard-teams strong { font-size: 32px !important; } }
@media (prefers-reduced-motion: reduce) { .war-tug > i { transition: none; } }.cm-badge[hidden] { display: none !important; }
.war-detail-hero, html:not([data-theme="light"]) .war-detail-hero { border: 1px solid var(--cm-ln) !important; background: linear-gradient(135deg, color-mix(in srgb, var(--ds-xp) 14%, var(--cm-cd)), var(--cm-cd)) !important; color: var(--cm-tx3) !important; box-shadow: var(--ds-shadow); }
.war-detail-hero h2 { color: var(--cm-tx) !important; } .war-detail-hero h2 span, .war-detail-hero p, .war-date-range span, .war-date-range small { color: var(--cm-mu) !important; }
.war-date-range strong { color: var(--ds-xp) !important; }
.war-catalog-note, .war-history-note { border: 1px solid var(--cm-ln) !important; border-radius: var(--ds-radius-sm) !important; background: var(--cm-cd) !important; color: var(--cm-tx2) !important; }
.war-roster-member { border-color: var(--cm-ln) !important; }
.war-roster-member, .war-roster { border-top-color: var(--cm-ln) !important; }
.war-roster li + li, .war-roster { border-color: var(--cm-ln) !important; }
.war-member-name, .war-roster-member .war-member-name { color: var(--cm-tx) !important; font-weight: 600; }
.war-member-name small { color: var(--cm-mu) !important; }
.war-member-avatar { background: color-mix(in srgb, var(--ds-xp) 20%, var(--cm-hv)) !important; color: var(--cm-tx) !important; border: 0 !important; }
.war-roster-member strong, .war-team-card header strong { color: var(--ds-xp) !important; font-family: var(--ds-num); }
.war-team-count, .war-team-kicker { color: var(--cm-mu) !important; }
.war-feed-item { border-color: var(--cm-ln) !important; }
.war-feed-body p, .war-feed-body p strong { color: var(--cm-tx3) !important; } .war-feed-body p strong { color: var(--cm-tx) !important; }
.war-feed-body small, .war-section-heading span { color: var(--cm-mu) !important; }
.war-daily-row { border-color: var(--cm-ln) !important; color: var(--cm-tx3) !important; } .war-daily-row strong { color: var(--cm-tx) !important; font-family: var(--ds-num); }
.war-detail-toolbar .action { min-height: 44px; }
html[data-theme="light"] .war-scoreboard-teams strong { color: var(--cm-tx) !important; }.cm .cm-bs { min-height: 44px !important; }
.cm button.cm-link { min-height: 44px; padding: 0 4px; }.auth-card { text-align: center; }
.auth-card form { text-align: left; }
.auth-card .auth-error:not(:empty) { margin: 2px 0 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #E5484D 14%, transparent); color: #FF8A8D !important; font-size: 14px; font-weight: 600; }
html[data-theme="light"] .auth-card .auth-error:not(:empty) { color: #B4262B !important; }
.auth-forgot { min-height: 44px; border: 0; background: none; color: var(--ds-xp); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
#authSubmit:disabled { opacity: .6; }
/* ===== Trofeos premium: vitrina de museo ===== */
.shield-showcase .shield-head p { color: var(--cm-mu); }
.shield-divider { margin: 26px 2px 12px !important; color: var(--cm-tx) !important; font-family: Cinzel, Georgia, serif; font-size: 13px !important; font-weight: 700 !important; letter-spacing: .16em; text-transform: uppercase; }
.shield-divider::after { background: linear-gradient(90deg, var(--cm-ln), transparent) !important; }
.shield-grid { gap: 12px !important; }
.shield-item, html[data-theme="light"] .shield-item { position: relative; padding: 12px 6px 16px !important; border: 1px solid #2A2D35 !important; border-radius: 22px !important; background: radial-gradient(90% 70% at 50% 18%, #343943 0%, #1A1D23 48%, #0D0E12 100%) !important; box-shadow: inset 0 1px 0 #FFFFFF14, inset 0 -18px 30px #00000059, 0 12px 28px #0B0C0F2E !important; overflow: hidden; }
.shield-item::before { content: ""; position: absolute; left: 50%; top: -30%; width: 120%; height: 80%; transform: translateX(-50%); background: radial-gradient(closest-side, #FFFFFF1F, transparent); pointer-events: none; }
.shield-item::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 52px; height: 10px; border-radius: 50%; background: radial-gradient(closest-side, #000000B3, transparent); filter: blur(2px); pointer-events: none; }
.shield-item.is-locked::after { opacity: .5; }
.shield-mini-wrap { position: relative; z-index: 1; padding: 12px 22px 6px !important; }
.shield-item-name, html[data-theme="light"] .shield-item-name { position: relative; z-index: 1; color: #F4F5F7 !important; font-family: Cinzel, Georgia, serif; font-size: 13.5px !important; font-weight: 700 !important; letter-spacing: .06em; }
.shield-item-lock, html[data-theme="light"] .shield-item-lock { position: relative; z-index: 1; padding: 0 8px; color: #9BA0A9 !important; font-size: 11.5px !important; line-height: 1.35; }
.shield-item-xp, html[data-theme="light"] .shield-item-xp { position: relative; z-index: 1; color: #3DB5FF !important; }
.shield-item-best, html[data-theme="light"] .shield-item-best { position: relative; z-index: 1; color: #F2C94C !important; }
.shield-item.is-locked .shield-mini { filter: grayscale(1) brightness(.42) contrast(1.1) !important; }
.shield-item:focus-visible { outline: 3px solid #3DB5FF; outline-offset: 3px; }
.shield-vitrina { border: 1px solid var(--cm-ln) !important; background: var(--cm-cd) !important; }
.shield-empty { color: var(--cm-mu) !important; }
/* Detalle: escenario oscuro con foco, como una vitrina */
.shield-detail:not([hidden]) { --cm-bg: #08090B; --cm-cd: #17191E; --cm-ln: #262A31; --cm-hv: #1F2228; --cm-tx: #F4F5F7; --cm-tx2: #C4C8CF; --cm-tx3: #D2D6DC; --cm-mu: #8A8F98; background: radial-gradient(80% 55% at 50% 28%, #2A2E37 0%, #121419 55%, #08090B 100%) !important; color: #D2D6DC; }
.shield-detail .shield-info h2 { font-family: Cinzel, Georgia, serif; letter-spacing: .04em; }
.shield-detail .shield-halo { opacity: .5 !important; }

.shield-detail .shield-chip.is-rank, html[data-theme="light"] .shield-detail .shield-chip.is-rank { color: var(--chip-dark) !important; border-color: color-mix(in srgb, var(--chip-dark) 40%, transparent) !important; background: color-mix(in srgb, var(--chip-dark) 12%, transparent) !important; }


/* ===== Guerras por hábitos ===== */
.wh-view { --wh-one: var(--cm-xp); --wh-two: var(--cm-fl); display: grid; gap: 14px; }
.wh-card { padding: 16px; border: 1px solid var(--cm-ln); border-radius: var(--ds-radius); background: var(--cm-cd); box-shadow: var(--ds-shadow); color: var(--cm-tx); }
.wh-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.wh-card-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.wh-card-head > span { color: var(--cm-mu); font-size: 12.5px; font-weight: 600; }
.wh-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--cm-hv); color: var(--cm-tx2); font-size: 13px; line-height: 1.45; }
.wh-avatar { display: inline-grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--cm-av); color: var(--cm-tx); font-size: 12.5px; font-weight: 800; }
.is-one > .wh-avatar, .wh-entry.is-one .wh-avatar { box-shadow: 0 0 0 2px var(--cm-cd), 0 0 0 4px var(--wh-one); }
.is-two > .wh-avatar, .wh-entry.is-two .wh-avatar { box-shadow: 0 0 0 2px var(--cm-cd), 0 0 0 4px var(--wh-two); }

/* Marcador */
.wh-hero { position: relative; overflow: hidden; padding: 20px 18px 18px; border-radius: 26px; background: radial-gradient(120% 90% at 50% 0%, #2B3038 0%, #15171C 60%, #0D0E11 100%); color: #F4F5F7; box-shadow: 0 18px 40px #0B0C0F2E; text-align: center; }
.wh-hero h2 { margin: 12px 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.wh-hero h2 span, .wh-hero p { color: #9BA0A9; }
.wh-hero p { margin: 0; font-size: 13px; }
.wh-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #FFFFFF14; color: #D2D6DC; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.wh-pill.is-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #FF4D4D; box-shadow: 0 0 0 4px #FF4D4D33; animation: whPulse 1.6s ease-in-out infinite; }
.wh-pill.is-done { background: #F2C94C22; color: #F2C94C; }
@keyframes whPulse { 50% { box-shadow: 0 0 0 7px #FF4D4D10; } }
@media (prefers-reduced-motion: reduce) { .wh-pill.is-live::before { animation: none; } }
.wh-winner { margin: 12px 0 0 !important; color: #F4F5F7 !important; font-size: 17px !important; }
.wh-winner strong { color: #F2C94C; }
.wh-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; margin-top: 16px; }
.wh-score > span { padding-bottom: 14px; color: #6E737C; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.wh-score > div { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.wh-score small { overflow: hidden; max-width: 100%; color: #C4C8CF; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.wh-score strong { font-family: var(--ds-num); font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.wh-score .is-one strong { color: #6CC8FF; }
.wh-score .is-two strong { color: #FFA066; }
.wh-score em { display: inline-flex; align-items: center; gap: 3px; color: #FFB26B; font-size: 12px; font-style: normal; font-weight: 700; }
.wh-score em .icon-svg, .wh-day .icon-svg { width: 13px; height: 13px; }
.wh-tug { position: relative; height: 8px; margin: 16px 0 2px; overflow: hidden; border-radius: 999px; background: #FF8A3D; }
.wh-tug i { position: absolute; inset: 0 auto 0 0; border-radius: 999px 0 0 999px; background: linear-gradient(90deg, #1A8AD4, #3DB5FF); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.wh-hero .action.primary { margin-top: 16px; }
.wh-hero .wh-note { background: #FFFFFF10; color: #C4C8CF; text-align: left; }
.wh-hero.is-forming { padding-bottom: 20px; }

/* Equipos en preparación */
.wh-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wh-team { padding: 14px; border: 1px solid var(--cm-ln); border-top: 3px solid var(--wh-one); border-radius: var(--ds-radius-sm); background: var(--cm-cd); }
.wh-team.is-two { border-top-color: var(--wh-two); }
.wh-team-kicker { color: var(--cm-mu); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.wh-team h3 { margin: 4px 0 10px; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.wh-team ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; font-weight: 600; }
.wh-team li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wh-team li small { color: var(--cm-mu); font-weight: 600; }
.wh-team .wh-avatar { width: 28px; height: 28px; font-size: 11px; }

/* Hábitos */
.wh-icon { display: inline-grid; flex: none; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--cm-xp) 12%, transparent); color: var(--cm-xp); }
.wh-icon .icon-svg { width: 20px; height: 20px; }
.wh-icon.is-photo { background: color-mix(in srgb, var(--cm-medium) 16%, transparent); color: var(--cm-medium); }
.wh-icon.is-honor { background: var(--cm-hv); color: var(--cm-tx2); }
.wh-icon.is-lg { width: 48px; height: 48px; border-radius: 15px; }
.wh-icon.is-lg .icon-svg { width: 24px; height: 24px; }
.wh-habit-list, .wh-today, .wh-ranking, .wh-feed { display: grid; margin: 0; padding: 0; list-style: none; }
.wh-habit-list { gap: 10px; }
.wh-habit-list li { display: flex; align-items: center; gap: 12px; }
.wh-habit-list li > span { display: grid; flex: 1; min-width: 0; }
.wh-habit-list strong, .wh-today-row strong { font-size: 15px; font-weight: 700; }
.wh-habit-list small, .wh-today-row small { color: var(--cm-mu); font-size: 12.5px; }
.wh-habit-list em { color: var(--cm-tx2); font-family: var(--ds-num); font-size: 13px; font-style: normal; font-weight: 700; }
.wh-level-tag { padding: 3px 9px; border-radius: 999px; background: var(--cm-hv); color: var(--cm-tx2) !important; }

/* Tu registro */
.wh-day-block + .wh-day-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--cm-ln); }
.wh-day-block h4 { margin: 0 0 8px; color: var(--cm-mu); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.wh-today { gap: 8px; }
.wh-today-row { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.wh-today-row > span:not(.wh-icon):not(.wh-points) { display: grid; flex: 1; min-width: 0; }
.wh-register, .wh-edit { flex: none; min-height: 40px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--cm-tx); color: var(--cm-cd); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.wh-edit { background: var(--cm-hv); color: var(--cm-tx2); }
.wh-register:focus-visible, .wh-edit:focus-visible, .wh-chip:focus-visible, .wh-react:focus-visible { outline: 3px solid var(--cm-xp); outline-offset: 2px; }
.wh-points { flex: none; padding: 4px 9px; border-radius: 999px; background: var(--cm-hv); color: var(--cm-tx2); font-family: var(--ds-num); font-size: 13px; font-weight: 700; }
.wh-points.is-full { background: color-mix(in srgb, var(--cm-easy) 16%, transparent); color: var(--cm-easy); }
.wh-points.is-void { background: color-mix(in srgb, var(--cm-hard) 14%, transparent); color: var(--cm-hard); }

/* Clasificación */
.wh-ranking { gap: 4px; }
.wh-ranking li { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.wh-ranking b { width: 18px; color: var(--cm-mu); font-family: var(--ds-num); font-size: 14px; text-align: center; }
.wh-rank-name { display: grid; flex: 1; min-width: 0; }
.wh-rank-name strong { overflow: hidden; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.wh-rank-name strong small, .wh-rank-name > small { color: var(--cm-mu); font-size: 12px; font-weight: 600; }
.wh-mvp { justify-self: start; margin-top: 2px; padding: 2px 7px; border-radius: 999px; background: linear-gradient(135deg, #F7D774, #D9A936); color: #3D2A05; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.wh-bars { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.wh-bars i { width: 5px; border-radius: 3px; background: color-mix(in srgb, var(--wh-one) 55%, transparent); }
.wh-ranking li.is-two .wh-bars i { background: color-mix(in srgb, var(--wh-two) 55%, transparent); }
.wh-bars i.is-today { background: var(--wh-one); }
.wh-ranking li.is-two .wh-bars i.is-today { background: var(--wh-two); }
.wh-ranking em { width: 56px; font-family: var(--ds-num); font-size: 17px; font-style: normal; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* Día a día */
.wh-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wh-day { display: grid; gap: 4px; padding: 8px 2px; border-radius: 12px; background: var(--cm-hv); text-align: center; }
.wh-day.is-today { background: var(--cm-cd); box-shadow: inset 0 0 0 2px var(--cm-tx); }
.wh-day.is-future { opacity: .55; }
.wh-day span { color: var(--cm-mu); font-size: 11px; font-weight: 800; }
.wh-day span b { color: var(--cm-fl); }
.wh-day strong { display: inline-flex; align-items: center; justify-content: center; gap: 1px; font-family: var(--ds-num); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.wh-day strong.is-one { color: var(--wh-one); }
.wh-day strong.is-two { color: var(--wh-two); }

/* Registros */
.wh-feed { gap: 0; }
.wh-entry { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--cm-ln); }
.wh-entry:first-child { border-top: 0; padding-top: 2px; }
.wh-entry-body { flex: 1; min-width: 0; }
.wh-entry-body p { margin: 0; font-size: 14.5px; line-height: 1.35; }
.wh-entry-value { color: var(--cm-tx2); font-weight: 600; }
.wh-entry-body > small { display: block; margin-top: 2px; color: var(--cm-mu); font-size: 12px; }
.wh-entry.is-void .wh-entry-value { text-decoration: line-through; }
.wh-entry-actions, .wh-reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wh-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 11px; border: 1px solid var(--cm-ln); border-radius: 999px; background: var(--cm-cd); color: var(--cm-tx2); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.wh-chip .icon-svg { width: 14px; height: 14px; }
.wh-chip.is-on { border-color: var(--cm-hard); color: var(--cm-hard); }
.wh-chip.is-static { cursor: default; color: var(--cm-mu); }
.wh-chip:disabled { opacity: .5; cursor: not-allowed; }
.wh-react { display: inline-flex; align-items: center; gap: 3px; min-width: 36px; min-height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 999px; background: var(--cm-hv); font: inherit; font-size: 15px; cursor: pointer; }
.wh-react small { color: var(--cm-tx2); font-size: 12px; font-weight: 700; }
.wh-react.is-on { border-color: var(--cm-tx); background: var(--cm-cd); }

/* Reglas */
.wh-rules summary { font-size: 15px; font-weight: 800; cursor: pointer; }
.wh-rules ul { display: grid; gap: 9px; margin: 12px 0 0; padding-left: 18px; color: var(--cm-tx2); font-size: 13.5px; line-height: 1.5; }

/* Formularios */
.wh-form-title { margin: 6px 0 -2px; font-size: 15px; font-weight: 800; }
.wh-picker { display: grid; gap: 12px; }
.wh-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--cm-hv); }
.wh-level { display: grid; place-items: center; min-height: 40px; border-radius: 11px; color: var(--cm-tx2); font-size: 14px; font-weight: 700; cursor: pointer; }
.wh-level input { position: absolute; opacity: 0; pointer-events: none; }
.wh-level.is-on { background: var(--cm-cd); color: var(--cm-tx); box-shadow: 0 1px 3px #16181C1F; }
.wh-level:has(input:focus-visible) { outline: 3px solid var(--cm-xp); outline-offset: 1px; }
.wh-picker-count { margin: 0; color: var(--cm-mu); font-size: 12.5px; font-weight: 700; }
.wh-mode { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.wh-mode legend { margin-bottom: 6px; padding: 0; color: var(--cm-mu); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.wh-pick { position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px; border: 1.5px solid var(--cm-ln); border-radius: 16px; background: var(--cm-cd); cursor: pointer; transition: border-color .15s, background .15s; }
.wh-pick input { position: absolute; opacity: 0; pointer-events: none; }
.wh-pick.is-on { border-color: var(--cm-tx); background: var(--cm-hv); }
.wh-pick.is-on::after { content: "✓"; position: absolute; top: -7px; right: -7px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--cm-tx); color: var(--cm-cd); font-size: 12px; font-weight: 800; }
.wh-pick.is-disabled { opacity: .45; cursor: not-allowed; }
.wh-pick:has(input:focus-visible) { outline: 3px solid var(--cm-xp); outline-offset: 2px; }
.wh-pick-copy { display: grid; flex: 1; min-width: 0; }
.wh-pick-copy strong { font-size: 14.5px; font-weight: 700; }
.wh-pick-copy small { color: var(--cm-mu); font-size: 12.5px; }
.wh-tier { flex: none; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; }
.wh-tier.is-verified { background: color-mix(in srgb, var(--cm-easy) 14%, transparent); color: var(--cm-easy); }
.wh-tier.is-photo { background: color-mix(in srgb, var(--cm-medium) 16%, transparent); color: var(--cm-medium); }
.wh-tier.is-honor { background: var(--cm-hv); color: var(--cm-mu); }
.wh-entry-head { display: flex; align-items: center; gap: 12px; }
.wh-entry-head > div { display: grid; }
.wh-entry-head strong { font-size: 17px; }
.wh-entry-head small { color: var(--cm-mu); font-size: 13px; }
.wh-time-input { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wh-honor { display: flex !important; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 14px; background: var(--cm-hv); font-weight: 600; line-height: 1.4; }
.wh-honor input { width: 22px; height: 22px; margin: 0; accent-color: var(--cm-tx); }
.wh-proof small { display: block; margin: 2px 0 6px; color: var(--cm-mu); font-weight: 500; }
.wh-proof-preview { display: block; margin-top: 8px; color: var(--cm-mu); font-size: 12.5px; }
.wh-proof-preview img { max-width: 100%; max-height: 200px; border-radius: 12px; object-fit: cover; }
.wh-delete { justify-self: center; color: var(--cm-hard) !important; }
@media (max-width: 380px) { .wh-score strong { font-size: 36px; } .wh-bars { display: none; } }

.wh-habit-list li > span:not(.wh-icon):not(.wh-tier) { display: grid; flex: 1; min-width: 0; }
.wh-habit-list li > span.wh-icon { flex: none; }
.wh-form label.wh-pick { display: flex !important; grid-template-columns: none; align-items: center; gap: 12px; margin: 0; }
.wh-form label.wh-level { display: grid !important; margin: 0; }
.wh-form .wh-pick-copy small, .wh-form .wh-tier { font-weight: 700; }
.wh-proof input[type="file"] { width: 100%; padding: 10px; border: 1.5px dashed var(--cm-ln); border-radius: 14px; background: var(--cm-in); color: var(--cm-mu); font: inherit; font-size: 13px; }
.wh-proof input[type="file"]::file-selector-button { margin-right: 10px; padding: 8px 14px; border: 0; border-radius: 10px; background: var(--cm-tx); color: var(--cm-cd); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }

.wh-habit-list li > span.wh-tier { display: inline-block; flex: none; }


/* ===== Denunciar y bloquear ===== */
.mod-reasons { display: grid; gap: 6px; }
.mod-form label.mod-reason { display: flex !important; align-items: center; gap: 10px; min-height: 46px; margin: 0; padding: 0 14px; border: 1.5px solid var(--cm-ln); border-radius: 14px; background: var(--cm-cd); color: var(--cm-tx); font-size: 14.5px; font-weight: 600; cursor: pointer; }
.mod-reason input { width: 18px; height: 18px; margin: 0; accent-color: var(--cm-tx); }
.mod-reason:has(input:checked) { border-color: var(--cm-tx); background: var(--cm-hv); }
.mod-form textarea { width: 100%; resize: vertical; }
.mod-block { display: grid; gap: 10px; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--cm-ln); }
.mod-block p { margin: 0; color: var(--cm-tx2); font-size: 13.5px; line-height: 1.45; }
.pf-mod { display: flex; justify-content: center; gap: 8px; margin-top: 12px; color: var(--cm-mu); font-size: 13px; }
.pf-mod button { min-height: 32px; padding: 0 6px; border: 0; background: none; color: var(--cm-mu); font: inherit; font-weight: 700; cursor: pointer; }
.pf-mod button:hover { color: var(--cm-hard); }
.mod-blocked { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.mod-blocked-row { display: flex; align-items: center; gap: 12px; }
.mod-blocked-row > span:not(.wh-avatar) { display: grid; flex: 1; min-width: 0; }
.mod-blocked-row small { color: var(--cm-mu); }

.mod-form textarea { font: inherit; font-size: 14.5px; }
.mod-form label .tiny { display: inline; }


.auth-legal { display: flex !important; align-items: flex-start; gap: 10px; margin: 2px 0; color: var(--cm-tx2, #4A4C52); font-size: 13px; font-weight: 500; line-height: 1.45; text-align: left; }
.auth-legal[hidden] { display: none !important; }
.auth-legal input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: #1A8AD4; }
.auth-legal a, .sv-legal-link { color: #1A8AD4; font-weight: 700; }

/* ===== Instalar la app ===== */
.install-guide { display: grid; gap: 16px; }
.install-hero { display: flex; align-items: center; gap: 14px; }
.install-hero img { flex: none; border-radius: 16px; }
.install-hero p { margin: 0; color: var(--cm-tx2); font-size: 14.5px; line-height: 1.45; }
.install-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: paso; }
.install-steps li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: 14px; background: var(--cm-hv); color: var(--cm-tx); font-size: 14.5px; line-height: 1.4; counter-increment: paso; }
.install-steps li::before { content: counter(paso); display: grid; flex: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--cm-tx); color: var(--cm-cd); font-size: 13px; font-weight: 800; }
.install-glyph { display: inline-block; width: 20px; height: 20px; margin: 0 2px; color: #1A8AD4; vertical-align: -4px; }

/* Foto de perfil de arriba a la derecha: redonda, centrada y a tamaño completo */
.avatar, body[class] .avatar { padding: 0 !important; flex: none; }
.avatar img, body[class] .avatar img { display: block; width: 100% !important; height: 100% !important; border-radius: 50%; object-fit: cover; object-position: center; }
.avatar, body[class] .avatar { position: relative; overflow: hidden; } .avatar img, body[class] .avatar img { position: absolute; inset: 0; }

/* =====================================================================
   PULIDO VISUAL v2 · tipografía, círculo de XP, retos y cabecera del perfil
   ===================================================================== */
:root, html[data-theme] {
  --font-ui: "Plus Jakarta Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ds-num: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}
body, button, input, select, textarea { font-family: var(--font-ui) !important; }
body { letter-spacing: -.01em; font-feature-settings: "ss01" on; }
h1, h2, h3, .pf-name, .fesho-row-title { letter-spacing: -.025em; }
h1 { font-weight: 800 !important; }
.fesho-title, .brand-mark span { font-family: var(--font-display) !important; font-weight: 800 !important; letter-spacing: -.03em; }
strong, .fesho-today-xp strong, .pf-stats strong { font-variant-numeric: tabular-nums; }

/* --- Círculo de XP de hoy: con aire y sin solaparse --- */
.fesho-rank-row { gap: 12px !important; align-items: stretch !important; flex-direction: row !important; }
.fesho-today-xp { flex: 0 0 128px !important; min-width: 0 !important; display: grid !important; place-items: center !important; padding: 12px !important; }
.fesho-today-xp::before { content: none !important; display: none !important; }
.fx-ring { position: relative; display: grid; place-items: center; width: 104px; height: 104px; border-radius: 50%;
  background: conic-gradient(var(--ds-xp) calc(var(--p, 0) * 1%), color-mix(in srgb, var(--ds-xp) 14%, transparent) 0); }
.fx-ring::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--cm-cd, #fff); }
.fx-in { position: relative; z-index: 1; display: grid; justify-items: center; gap: 1px; line-height: 1; }
.fx-in small { display: inline-flex !important; align-items: center; gap: 3px; color: var(--cm-mu) !important; font-size: 11px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.fx-in small .icon-svg { width: 12px; height: 12px; color: var(--ds-xp); fill: currentColor; stroke-width: 0; }
.fx-in strong { display: block !important; margin: 3px 0 2px; color: var(--cm-tx) !important; font-size: 30px !important; font-weight: 800; letter-spacing: -.04em; }
.fx-in em { color: var(--cm-mu); font-size: 11.5px; font-style: normal; font-weight: 600; opacity: 1 !important; }
@media (max-width: 360px) { .fesho-today-xp { flex-basis: 112px !important; } .fx-ring { width: 92px; height: 92px; } .fx-in strong { font-size: 26px !important; } }

/* --- Tarjetas de retos: limpias, icono suave y check redondo a la derecha --- */
.fesho-list { gap: 10px !important; }
.fesho-row { flex-wrap: nowrap !important; align-items: center !important; gap: 14px !important; padding: 14px 14px 14px 14px !important;
  border: 1px solid var(--cm-ln) !important; border-radius: 20px !important; background: var(--cm-cd) !important; box-shadow: var(--ds-shadow) !important; }
.fesho-row-body { flex: 1 1 auto !important; min-width: 0; }
.fesho-row-icon { width: 48px !important; height: 48px !important; border-radius: 15px !important; box-shadow: none !important;
  background: color-mix(in srgb, var(--icon-bg) 16%, var(--cm-cd, #fff)) !important; color: var(--icon-shadow) !important; }
html:not([data-theme="light"]) .fesho-row-icon { background: color-mix(in srgb, var(--icon-bg) 20%, transparent) !important; color: var(--icon-bg) !important; }
.fesho-row-icon .icon-svg { width: 24px !important; height: 24px !important; }
.fesho-row-meta { gap: 6px !important; font-size: 12px !important; font-weight: 600; }
.fesho-row-title { margin-top: 4px !important; font-size: 15.5px !important; font-weight: 700 !important; line-height: 1.28 !important; color: var(--cm-tx) !important; }
.fesho-row-xp { margin-top: 3px !important; font-size: 12.5px !important; font-weight: 800 !important; color: var(--ds-xp) !important; }
.fesho-row > .fesho-check { order: 3; flex: none !important; width: 46px !important; min-width: 46px !important; height: 46px !important; min-height: 46px !important; padding: 0 !important;
  border-radius: 50% !important; border: 2px solid color-mix(in srgb, var(--ds-xp) 45%, var(--cm-ln)) !important; background: transparent !important; box-shadow: none !important; justify-content: center !important; }
.fesho-row > .fesho-check .fesho-check-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fesho-row > .fesho-check .fesho-check-box { width: 100%; height: 100%; border: 0 !important; border-radius: 50%; background: transparent !important; color: var(--ds-xp); }
.fesho-row > .fesho-check:not(.is-on):hover { background: color-mix(in srgb, var(--ds-xp) 10%, transparent) !important; }
.fesho-row > .fesho-check.is-on { border-color: var(--ds-xp) !important; background: var(--ds-xp) !important; }
.fesho-row > .fesho-check.is-on .fesho-check-box { color: #fff !important; }
.fesho-row > .fesho-check .fesho-check-box .icon-svg { width: 22px !important; height: 22px !important; stroke-width: 3 !important; }
.fesho-row.is-complete { background: color-mix(in srgb, var(--ds-xp) 6%, var(--cm-cd)) !important; border-color: color-mix(in srgb, var(--ds-xp) 30%, var(--cm-ln)) !important; }
.fesho-row.is-complete .fesho-row-title { color: var(--cm-tx2) !important; }

/* --- Cabecera del perfil --- */
.pf-cover { inset: -16px -16px auto !important; height: 156px !important; border-radius: 0 0 32px 32px !important; overflow: hidden;
  background: radial-gradient(90% 120% at 85% -10%, #ffffff40, transparent 55%),
              radial-gradient(70% 90% at 0% 100%, #00000026, transparent 60%),
              linear-gradient(135deg, #1A8AD4 0%, #3F6FE8 48%, #7A5CE6 100%) !important; }
.pf-cover::before { content: ""; position: absolute; inset: 0; opacity: .18;
  background-image: radial-gradient(#fff 1.2px, transparent 1.3px); background-size: 18px 18px;
  -webkit-mask: linear-gradient(180deg, #000, transparent 85%); mask: linear-gradient(180deg, #000, transparent 85%); }
.pf-cover::after { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid #ffffff14; }
.pf-photo { margin-top: 66px !important; filter: drop-shadow(0 10px 22px #16181C33); }
.pf-name { margin-top: 10px !important; font-size: 27px !important; font-weight: 800 !important; letter-spacing: -.035em !important; }
.pf-handle { font-size: 14.5px !important; font-weight: 600 !important; }
.pf-rank { margin-top: 10px !important; padding: 6px 14px !important; box-shadow: var(--ds-shadow); }
.pf-stats { border-radius: 22px !important; padding: 16px 4px !important; }
.pf-stats strong { font-weight: 800 !important; letter-spacing: -.03em; }

/* ===== Marcar sin parpadeo y recompensa al completar ===== */
#feshoHome[data-ready] .fesho-rank-row, #feshoHome[data-ready] .fesho-h3, #feshoHome[data-ready] .fesho-day-progress,
#feshoHome[data-ready] .fesho-list, #feshoHome[data-ready] .fesho-list .fesho-row:not(.just-completed), #feshoHome[data-ready] .fesho-season { animation: none !important; }
#feshoHome[data-ready] .fesho-day-track > i, #feshoHome[data-ready] .fesho-rank-track > i { transition: none !important; }
.fesho-row.just-completed { animation: fx-row-glow .7s ease-out !important; }
.fesho-row.just-completed > .fesho-check { animation: fx-check-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes fx-check-pop { 0% { transform: scale(.7); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes fx-row-glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ds-xp) 45%, transparent), var(--ds-shadow); } 100% { box-shadow: 0 0 0 14px transparent, var(--ds-shadow); } }
.fesho-today-xp.fx-pulse .fx-ring { animation: fx-ring-pulse .7s ease-out; }
@keyframes fx-ring-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ds-xp) 50%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.fx-spark { position: fixed; z-index: 75; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; }

.fx-reward { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 80; display: grid; justify-items: center; gap: 4px;
  max-width: min(88vw, 340px); padding: 10px 18px 11px; border-radius: 20px; background: #16181C; color: #fff; text-align: center;
  box-shadow: 0 12px 30px #16181C40; opacity: 0; transform: translate(-50%, 16px) scale(.96); pointer-events: none;
  transition: opacity .22s ease, transform .3s cubic-bezier(.34, 1.4, .64, 1); }
.fx-reward.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.fx-reward strong { display: inline-flex; align-items: center; gap: 6px; color: #7CCBFF; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.fx-reward strong .icon-svg { width: 18px; height: 18px; fill: currentColor; stroke-width: 0; }
.fx-reward span { color: #C9CCD3; font-size: 12.5px; font-weight: 500; font-style: italic; line-height: 1.35; }
html:not([data-theme="light"]) .fx-reward { background: #F4F5F7; } html:not([data-theme="light"]) .fx-reward strong { color: #1A8AD4; } html:not([data-theme="light"]) .fx-reward span { color: #4A4C52; }

.fx-perfect { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px; background: #0B0C0FB3; overflow: hidden; animation: fx-fade-in .2s ease-out; cursor: pointer; }
.fx-perfect.out { opacity: 0; transition: opacity .25s ease; }
.fx-perfect-card { position: relative; display: grid; justify-items: center; gap: 8px; width: min(100%, 320px); padding: 28px 22px 24px; border-radius: 26px; background: var(--cm-cd, #fff); color: var(--cm-tx, #16181C); text-align: center; box-shadow: 0 24px 60px #00000055; animation: fx-perfect-in .5s cubic-bezier(.34, 1.45, .64, 1); }
.fx-perfect-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(145deg, #FFD54A, #F5A300); color: #fff; box-shadow: 0 10px 24px #F5A30066; }
.fx-perfect-icon .icon-svg { width: 38px; height: 38px; stroke-width: 2.4; }
.fx-perfect-card strong { margin-top: 6px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.fx-perfect-card p { margin: 0; color: var(--cm-tx2, #4A4C52); font-size: 15px; font-weight: 600; }
.fx-perfect-confetti i { position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px; animation: fx-confetti linear forwards; }
@keyframes fx-confetti { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(540deg); opacity: .8; } }
@keyframes fx-perfect-in { 0% { opacity: 0; transform: scale(.7) translateY(20px); } 100% { opacity: 1; transform: none; } }
@keyframes fx-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fx-reward, .fx-perfect-card, .fesho-row.just-completed, .fesho-row.just-completed > .fesho-check, .fesho-today-xp.fx-pulse .fx-ring { animation: none !important; transition: opacity .2s !important; } }
.xp-fly { white-space: nowrap; } .fx-reward { min-width: 230px; }

/* Frases de honestidad: más grandes y legibles */
.fx-reward { width: min(90vw, 360px); min-width: 0; gap: 7px; padding: 14px 20px 15px; border-radius: 22px; }
.fx-reward strong { font-size: 20px; }
.fx-reward span { color: #FFFFFF; font-size: 15.5px; font-weight: 700; font-style: normal; line-height: 1.35; letter-spacing: -.01em; text-wrap: balance; }
html:not([data-theme="light"]) .fx-reward span { color: #16181C; }

/* =====================================================================
   GUERRAS · MODO ARENA (estilo videojuego, siempre oscuro)
   ===================================================================== */
body.war-screen-active {
  --ar-bg: #070A14; --ar-panel: #0F1424; --ar-panel2: #141B2F; --ar-line: #FFFFFF14; --ar-line2: #FFFFFF24;
  --ar-tx: #F2F5FF; --ar-tx2: #AEB6CC; --ar-mu: #6F7891;
  --ar-one: #2EC5FF; --ar-two: #FF5A36; --ar-gold: #FFC83D; --ar-green: #3DE08A;
  --ar-hud: "Chakra Petch", "Plus Jakarta Sans", sans-serif;
  background: radial-gradient(80% 50% at 0% 0%, #1B3D7A55, transparent 60%), radial-gradient(70% 45% at 100% 10%, #7A2A1B44, transparent 60%), var(--ar-bg) !important;
  background-attachment: fixed !important; color: var(--ar-tx);
}
body.war-screen-active::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(#FFFFFF07 1px, transparent 1px), linear-gradient(90deg, #FFFFFF07 1px, transparent 1px); background-size: 32px 32px;
  -webkit-mask: radial-gradient(120% 70% at 50% 0%, #000, transparent 75%); mask: radial-gradient(120% 70% at 50% 0%, #000, transparent 75%); }
body.war-screen-active .app-shell, body.war-screen-active #screen-wars { position: relative; z-index: 1; background: transparent !important; }
body.war-screen-active .topbar { background: #070A14CC !important; border-color: var(--ar-line) !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
body.war-screen-active .topbar .avatar { border-color: var(--ar-line2) !important; background: var(--ar-panel) !important; color: var(--ar-tx2) !important; }
body.war-screen-active .bottom-nav { background: #0D1220E6 !important; border-color: var(--ar-line) !important; box-shadow: 0 -10px 30px #0008 !important; }
body.war-screen-active .bottom-nav .nav-button { color: var(--ar-mu) !important; }
body.war-screen-active .bottom-nav .nav-button.active { color: var(--ar-one) !important; background: #2EC5FF1A !important; }

/* Cabecera */
#screen-wars .page-head .eyebrow { color: var(--ar-one) !important; font-family: var(--ar-hud) !important; font-weight: 700; letter-spacing: .22em !important; text-shadow: 0 0 14px #2EC5FF88; }
#screen-wars .page-head h1 { color: var(--ar-tx) !important; font-family: var(--ar-hud) !important; font-size: 40px !important; font-style: italic; font-weight: 700 !important; letter-spacing: .01em !important; text-transform: uppercase; text-shadow: 0 2px 0 #000, 0 0 24px #2EC5FF40; }

/* Botones del modo arena */
#screen-wars .action, #screen-wars .war-text-button { font-family: var(--ar-hud) !important; text-transform: uppercase; letter-spacing: .06em; font-weight: 700 !important; }
#screen-wars .action.primary, #screen-wars .wh-register {
  border: 0 !important; border-radius: 14px !important; color: #1A1100 !important;
  background: linear-gradient(180deg, #FFD966, #FFB21E) !important; box-shadow: 0 4px 0 #B86E00, 0 10px 24px #FFB21E40 !important; }
#screen-wars .action.primary:active, #screen-wars .wh-register:active { transform: translateY(3px); box-shadow: 0 1px 0 #B86E00 !important; }
#screen-wars .action.secondary, #screen-wars .action.quiet, #screen-wars .wh-edit {
  border: 1px solid var(--ar-line2) !important; border-radius: 12px !important; background: var(--ar-panel2) !important; color: var(--ar-tx) !important; box-shadow: none !important; }
#screen-wars .war-text-button { color: var(--ar-one) !important; }

/* Lista de guerras */
#screen-wars .wars-toolbar { position: relative; overflow: hidden; padding: 20px !important; border: 1px solid #2EC5FF40 !important; border-radius: 22px !important;
  background: linear-gradient(120deg, #13306A, #1A1F3A 55%, #4A1E16) !important; box-shadow: 0 0 0 1px #FFFFFF08 inset, 0 18px 40px #0008 !important; }
#screen-wars .wars-toolbar::after { content: "VS"; position: absolute; right: -6px; bottom: -22px; color: #FFFFFF0D; font-family: var(--ar-hud); font-size: 110px; font-style: italic; font-weight: 700; pointer-events: none; }
#screen-wars .wars-toolbar p { color: var(--ar-tx) !important; font-weight: 700 !important; }
#screen-wars .war-section-heading h2 { color: var(--ar-tx) !important; font-family: var(--ar-hud) !important; font-size: 17px !important; letter-spacing: .12em; text-transform: uppercase; }
#screen-wars .war-list { gap: 12px !important; }
#screen-wars .war-list-card { position: relative; overflow: hidden; padding: 16px 44px 16px 20px !important; border: 1px solid var(--ar-line2) !important; border-radius: 18px !important;
  background: linear-gradient(90deg, #2EC5FF22, transparent 30%, transparent 70%, #FF5A3622), var(--ar-panel) !important; color: var(--ar-tx) !important; box-shadow: 0 10px 26px #0007 !important; }
#screen-wars .war-list-card::before, #screen-wars .war-list-card::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; }
#screen-wars .war-list-card::before { left: 0; background: var(--ar-one); box-shadow: 0 0 14px var(--ar-one); }
#screen-wars .war-list-card::after { right: 0; background: var(--ar-two); box-shadow: 0 0 14px var(--ar-two); }
#screen-wars .war-list-card strong { color: var(--ar-tx) !important; font-family: var(--ar-hud); font-size: 18px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
#screen-wars .war-list-card strong span { color: var(--ar-gold) !important; font-style: italic; }
#screen-wars .war-list-card small { color: var(--ar-tx2) !important; font-weight: 600; }
#screen-wars .war-list-arrow { color: var(--ar-gold) !important; }
#screen-wars .war-status-pill { border: 1px solid currentColor !important; background: transparent !important; font-family: var(--ar-hud); letter-spacing: .1em; }
#screen-wars .war-status-pill.is-active { color: var(--ar-green) !important; box-shadow: 0 0 12px #3DE08A44; }
#screen-wars .war-status-pill.is-forming { color: var(--ar-gold) !important; }
#screen-wars .war-status-pill.is-completed { color: var(--ar-tx2) !important; }
#screen-wars .war-catalog-note, #screen-wars .war-empty-inline, #screen-wars .war-inbox-card { border: 1px solid var(--ar-line) !important; background: var(--ar-panel) !important; color: var(--ar-tx2) !important; }
#screen-wars .war-empty-inline strong, #screen-wars .war-inbox-card strong { color: var(--ar-tx) !important; }

/* Marcador */
#screen-wars .wh-hero { position: relative; overflow: hidden; padding: 20px 18px 22px !important; border: 1px solid var(--ar-line2) !important; border-radius: 24px !important;
  background: radial-gradient(70% 90% at 0% 50%, #2EC5FF30, transparent 60%), radial-gradient(70% 90% at 100% 50%, #FF5A3630, transparent 60%), linear-gradient(180deg, #121A33, #0A0F1E) !important;
  box-shadow: 0 0 0 1px #FFFFFF08 inset, 0 24px 50px #000A !important; }
#screen-wars .wh-pill { font-family: var(--ar-hud) !important; font-size: 13px !important; letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--ar-line2) !important; background: #FFFFFF0D !important; color: var(--ar-tx) !important; }
#screen-wars .wh-pill.is-live { border-color: #FF3B3B88 !important; color: #FFB3B3 !important; box-shadow: 0 0 16px #FF3B3B40; }
#screen-wars .wh-pill.is-done { border-color: #FFC83D88 !important; color: var(--ar-gold) !important; }
#screen-wars .wh-score { align-items: center !important; }
#screen-wars .wh-score small { color: var(--ar-tx2) !important; font-family: var(--ar-hud); font-size: 13px !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
#screen-wars .wh-score strong { font-family: var(--ar-hud) !important; font-size: 54px !important; font-style: italic; font-weight: 700 !important; letter-spacing: -.01em !important; }
#screen-wars .wh-score .is-one strong { color: var(--ar-one) !important; text-shadow: 0 0 22px #2EC5FFAA, 0 3px 0 #04263A; }
#screen-wars .wh-score .is-two strong { color: var(--ar-two) !important; text-shadow: 0 0 22px #FF5A36AA, 0 3px 0 #3A0E04; }
#screen-wars .wh-score em { color: var(--ar-gold) !important; font-family: var(--ar-hud); }
#screen-wars .wh-score > span { display: grid; place-items: center; width: 44px; height: 44px; flex: none; transform: rotate(45deg); border: 2px solid var(--ar-gold); border-radius: 10px;
  background: #1A1404; color: transparent !important; box-shadow: 0 0 18px #FFC83D66; font-size: 0 !important; }
#screen-wars .wh-score > span::after { content: "VS"; transform: rotate(-45deg); color: var(--ar-gold); font-family: var(--ar-hud); font-size: 15px; font-style: italic; font-weight: 700; }
#screen-wars .wh-tug { position: relative; height: 14px !important; margin-top: 18px !important; border-radius: 99px !important; overflow: visible !important;
  background: linear-gradient(90deg, #FF5A36, #FF8A3D) !important; box-shadow: 0 0 18px #FF5A3655, 0 0 0 1px #FFFFFF14 inset !important; }
#screen-wars .wh-tug i { position: relative; height: 100%; border-radius: 99px 0 0 99px !important; background: linear-gradient(90deg, #1A9BFF, #2EC5FF) !important; box-shadow: 0 0 18px #2EC5FF88; }
#screen-wars .wh-tug i::after { content: ""; position: absolute; right: -9px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px #FFFFFF33, 0 0 18px #fff; }
#screen-wars .wh-winner { color: var(--ar-gold) !important; font-family: var(--ar-hud); font-size: 20px !important; text-transform: uppercase; letter-spacing: .04em; text-shadow: 0 0 18px #FFC83D88; }
#screen-wars .wh-winner strong { color: #fff !important; }
#screen-wars .wh-hero.is-forming h2 { color: var(--ar-tx) !important; font-family: var(--ar-hud); font-size: 24px !important; text-transform: uppercase; }
#screen-wars .wh-hero.is-forming h2 span { color: var(--ar-gold) !important; font-style: italic; }
#screen-wars .wh-hero p { color: var(--ar-tx2) !important; }

/* Paneles */
#screen-wars .wh-card { border: 1px solid var(--ar-line) !important; border-radius: 20px !important; background: linear-gradient(180deg, #121931, #0D1222) !important; color: var(--ar-tx) !important; box-shadow: 0 14px 34px #0007 !important; }
#screen-wars .wh-card-head h3, #screen-wars .wh-rules summary { color: var(--ar-tx) !important; font-family: var(--ar-hud) !important; font-size: 16px !important; letter-spacing: .12em; text-transform: uppercase; }
#screen-wars .wh-card-head > span, #screen-wars .wh-day-block h4 { color: var(--ar-mu) !important; font-family: var(--ar-hud); letter-spacing: .1em; text-transform: uppercase; }
#screen-wars .wh-card strong { color: var(--ar-tx); }
#screen-wars .wh-card small, #screen-wars .war-help, #screen-wars .wh-rules li { color: var(--ar-tx2) !important; }
#screen-wars .wh-today-row, #screen-wars .wh-habit-list li { border-color: var(--ar-line) !important; }
#screen-wars .wh-icon { border-radius: 12px !important; background: #2EC5FF1A !important; color: var(--ar-one) !important; box-shadow: 0 0 0 1px #2EC5FF33 inset; }
#screen-wars .wh-icon.is-photo { background: #FFC83D1A !important; color: var(--ar-gold) !important; box-shadow: 0 0 0 1px #FFC83D33 inset; }
#screen-wars .wh-icon.is-honor { background: #B58CFF1A !important; color: #C9A8FF !important; box-shadow: 0 0 0 1px #B58CFF33 inset; }
#screen-wars .wh-points { background: #FFFFFF10 !important; color: var(--ar-tx) !important; font-family: var(--ar-hud) !important; }
#screen-wars .wh-points.is-full { background: #3DE08A1F !important; color: var(--ar-green) !important; box-shadow: 0 0 12px #3DE08A33; }
#screen-wars .wh-points.is-void { background: #FF3B3B1F !important; color: #FF7A7A !important; }
#screen-wars .wh-tier, #screen-wars .wh-level-tag { border: 1px solid var(--ar-line2) !important; background: transparent !important; color: var(--ar-tx2) !important; font-family: var(--ar-hud); letter-spacing: .06em; }
#screen-wars .wh-habit-list em { color: var(--ar-gold) !important; font-family: var(--ar-hud) !important; }

/* Clasificación */
#screen-wars .wh-ranking li { border-color: var(--ar-line) !important; }
#screen-wars .wh-ranking li b { display: grid; place-items: center; width: 26px !important; height: 26px; border-radius: 8px; background: #FFFFFF10; color: var(--ar-tx2) !important; font-family: var(--ar-hud) !important; }
#screen-wars .wh-ranking li:nth-child(1) b { background: linear-gradient(180deg, #FFE27A, #F0A800); color: #2A1A00 !important; box-shadow: 0 0 14px #FFC83D77; }
#screen-wars .wh-ranking li:nth-child(2) b { background: linear-gradient(180deg, #F2F5FA, #A9B3C4); color: #1C2230 !important; }
#screen-wars .wh-ranking li:nth-child(3) b { background: linear-gradient(180deg, #F2B48A, #B86A3C); color: #2A1205 !important; }
#screen-wars .wh-avatar { background: var(--ar-panel2) !important; color: var(--ar-tx) !important; border: 2px solid var(--ar-one) !important; box-shadow: 0 0 10px #2EC5FF55; font-family: var(--ar-hud); }
#screen-wars .is-two .wh-avatar, #screen-wars .is-two > .wh-avatar { border-color: var(--ar-two) !important; box-shadow: 0 0 10px #FF5A3655; }
#screen-wars .wh-ranking em { color: var(--ar-tx) !important; font-family: var(--ar-hud) !important; font-size: 19px !important; }
#screen-wars .wh-ranking li.is-one .wh-bars i { background: var(--ar-one) !important; }
#screen-wars .wh-ranking li.is-two .wh-bars i { background: var(--ar-two) !important; }
#screen-wars .wh-mvp { border: 0 !important; background: linear-gradient(180deg, #FFE27A, #F0A800) !important; color: #2A1A00 !important; font-family: var(--ar-hud); letter-spacing: .08em; box-shadow: 0 0 12px #FFC83D66; }

/* Día a día */
#screen-wars .wh-day { border: 1px solid var(--ar-line) !important; border-radius: 12px !important; background: #FFFFFF08 !important; }
#screen-wars .wh-day span { color: var(--ar-mu) !important; font-family: var(--ar-hud); }
#screen-wars .wh-day span b { color: var(--ar-gold) !important; }
#screen-wars .wh-day strong { font-family: var(--ar-hud) !important; }
#screen-wars .wh-day strong.is-one { color: var(--ar-one) !important; }
#screen-wars .wh-day strong.is-two { color: var(--ar-two) !important; }
#screen-wars .wh-day.is-today { border-color: var(--ar-gold) !important; background: #FFC83D12 !important; box-shadow: 0 0 16px #FFC83D44; }
#screen-wars .wh-day.is-future { opacity: .45; }

/* Registros */
#screen-wars .wh-entry { border-color: var(--ar-line) !important; }
#screen-wars .wh-entry p { color: var(--ar-tx2) !important; }
#screen-wars .wh-entry p strong { color: var(--ar-tx) !important; }
#screen-wars .wh-chip { border: 1px solid var(--ar-line2) !important; background: #FFFFFF0A !important; color: var(--ar-tx) !important; }
#screen-wars .wh-chip.is-on { border-color: #FF7A7A !important; color: #FF9C9C !important; }
#screen-wars .wh-react { border: 1px solid var(--ar-line) !important; background: #FFFFFF0A !important; color: var(--ar-tx) !important; }
#screen-wars .wh-react.is-on { border-color: var(--ar-gold) !important; background: #FFC83D1F !important; box-shadow: 0 0 10px #FFC83D44; }

/* Preparación */
#screen-wars .wh-team { border: 1px solid var(--ar-line2) !important; border-radius: 18px !important; background: var(--ar-panel) !important; color: var(--ar-tx) !important; box-shadow: inset 0 3px 0 var(--ar-one) !important; }
#screen-wars .wh-team.is-two { box-shadow: inset 0 3px 0 var(--ar-two) !important; }
#screen-wars .wh-team h3 { color: var(--ar-tx) !important; font-family: var(--ar-hud); text-transform: uppercase; }
#screen-wars .wh-team-kicker { color: var(--ar-mu) !important; font-family: var(--ar-hud); letter-spacing: .1em; }
#screen-wars .wh-team li { color: var(--ar-tx) !important; }
#screen-wars .war-link-block, #screen-wars .war-waiting-banner, #screen-wars .wh-note { border-color: var(--ar-line2) !important; background: #FFFFFF08 !important; color: var(--ar-tx2) !important; }
#screen-wars input, #screen-wars .war-link-field input { border-color: var(--ar-line2) !important; background: #070A14 !important; color: var(--ar-tx) !important; }
#screen-wars .wars-inline-error, #screen-wars .wars-error { border-color: #FF5A3666 !important; background: #FF5A3614 !important; color: #FFB3A3 !important; }
#screen-wars .wh-tug i { display: block !important; }
#screen-wars .wh-entry-value { color: var(--ar-tx) !important; }
#screen-wars .wh-reactions { gap: 5px !important; }
#screen-wars .wh-react { min-width: 34px !important; padding: 0 6px !important; }
/* Ventanas (registrar, crear guerra…) en modo arena cuando estás en Guerras */
html:not([data-theme="light"]) body.war-screen-active .modal { --cm-bg:#070A14; --cm-cd:#0F1424; --cm-ln:#FFFFFF1C; --cm-hv:#182038; --cm-tx:#F2F5FF; --cm-tx3:#D6DCEC; --cm-tx2:#AEB6CC; --cm-mu:#7C86A0; --cm-in:#070A14; --cm-xp:#2EC5FF;
  border: 1px solid #FFFFFF1C !important; background: linear-gradient(180deg, #131B33, #0B1020) !important; color: #F2F5FF !important; box-shadow: 0 30px 70px #000C !important; }
html:not([data-theme="light"]) body.war-screen-active .modal-head h2 { color: #F2F5FF !important; font-family: "Chakra Petch", sans-serif !important; text-transform: uppercase; letter-spacing: .06em; }
html:not([data-theme="light"]) body.war-screen-active .modal .close-button { border-color: #FFFFFF24 !important; background: #182038 !important; color: #F2F5FF !important; }
html:not([data-theme="light"]) body.war-screen-active .modal label, html:not([data-theme="light"]) body.war-screen-active .modal p, html:not([data-theme="light"]) body.war-screen-active .modal small { color: #AEB6CC !important; }
html:not([data-theme="light"]) body.war-screen-active .modal strong { color: #F2F5FF !important; }
html:not([data-theme="light"]) body.war-screen-active .modal input, html:not([data-theme="light"]) body.war-screen-active .modal select, html:not([data-theme="light"]) body.war-screen-active .modal textarea { border-color: #FFFFFF24 !important; background: #070A14 !important; color: #F2F5FF !important; }
html:not([data-theme="light"]) body.war-screen-active .modal .action.primary { border: 0 !important; color: #1A1100 !important; background: linear-gradient(180deg, #FFD966, #FFB21E) !important; box-shadow: 0 4px 0 #B86E00 !important; font-family: "Chakra Petch", sans-serif; text-transform: uppercase; letter-spacing: .06em; }
html:not([data-theme="light"]) body.war-screen-active .modal .action.secondary, html:not([data-theme="light"]) body.war-screen-active .modal .action.quiet { border: 1px solid #FFFFFF24 !important; background: #182038 !important; color: #F2F5FF !important; box-shadow: none !important; }

/* =====================================================================
   GUERRAS · ARENA CLARA (tema claro): estilo juego en blanco
   ===================================================================== */
html[data-theme="light"] body.war-screen-active {
  --ar-bg: #F2F5FB; --ar-panel: #FFFFFF; --ar-panel2: #F1F4FA; --ar-line: #0E14241A; --ar-line2: #0E14242E;
  --ar-tx: #0E1424; --ar-tx2: #4A536B; --ar-mu: #8790A6;
  --ar-one: #0A9EE0; --ar-two: #F0502A; --ar-gold: #E9A100; --ar-green: #12A862;
  background: radial-gradient(80% 45% at 0% 0%, #BFE8FF88, transparent 60%), radial-gradient(70% 40% at 100% 8%, #FFD3C488, transparent 60%), var(--ar-bg) !important;
  color: var(--ar-tx);
}
html[data-theme="light"] body.war-screen-active::before { opacity: .9; background-image: linear-gradient(#0E14240A 1px, transparent 1px), linear-gradient(90deg, #0E14240A 1px, transparent 1px); }
html[data-theme="light"] body.war-screen-active .topbar { background: #FFFFFFCC !important; }
html[data-theme="light"] body.war-screen-active .topbar .avatar { background: #fff !important; color: var(--ar-tx2) !important; }
html[data-theme="light"] body.war-screen-active .bottom-nav { background: #FFFFFFEE !important; box-shadow: 0 -6px 24px #0E14241A !important; }
html[data-theme="light"] body.war-screen-active .bottom-nav .nav-button.active { color: var(--ar-one) !important; background: #0A9EE014 !important; }

html[data-theme="light"] #screen-wars .page-head .eyebrow { text-shadow: none; }
html[data-theme="light"] #screen-wars .page-head h1 { color: var(--ar-tx) !important; text-shadow: 3px 3px 0 #0A9EE033, -2px -2px 0 #F0502A22; }

html[data-theme="light"] #screen-wars .action.secondary, html[data-theme="light"] #screen-wars .action.quiet, html[data-theme="light"] #screen-wars .wh-edit {
  background: #fff !important; color: var(--ar-tx) !important; box-shadow: 0 3px 0 #0E14241F !important; }

html[data-theme="light"] #screen-wars .wars-toolbar { border-color: #0A9EE04D !important; background: linear-gradient(120deg, #DDF3FF, #FFFFFF 50%, #FFE7DE) !important; box-shadow: 0 14px 30px #0E14241A !important; }
html[data-theme="light"] #screen-wars .wars-toolbar::after { color: #0E14240D; }
html[data-theme="light"] #screen-wars .war-list-card { background: linear-gradient(90deg, #0A9EE014, transparent 30%, transparent 70%, #F0502A14), #fff !important; box-shadow: 0 10px 24px #0E14241A !important; }
html[data-theme="light"] #screen-wars .war-list-card strong span, html[data-theme="light"] #screen-wars .war-list-arrow { color: #D99400 !important; }
html[data-theme="light"] #screen-wars .war-status-pill.is-active { box-shadow: none; }
html[data-theme="light"] #screen-wars .war-catalog-note, html[data-theme="light"] #screen-wars .war-empty-inline, html[data-theme="light"] #screen-wars .war-inbox-card { background: #fff !important; }

html[data-theme="light"] #screen-wars .wh-hero {
  background: radial-gradient(70% 90% at 0% 50%, #0A9EE026, transparent 60%), radial-gradient(70% 90% at 100% 50%, #F0502A26, transparent 60%), linear-gradient(180deg, #FFFFFF, #F5F8FE) !important;
  box-shadow: 0 0 0 1px #FFFFFF inset, 0 18px 40px #0E14241F !important; }
html[data-theme="light"] #screen-wars .wh-pill { background: #fff !important; color: var(--ar-tx) !important; }
html[data-theme="light"] #screen-wars .wh-pill.is-live { border-color: #E0242466 !important; color: #D11F1F !important; box-shadow: 0 0 14px #E0242422; }
html[data-theme="light"] #screen-wars .wh-pill.is-done { color: #B67C00 !important; }
html[data-theme="light"] #screen-wars .wh-score .is-one strong { text-shadow: 0 3px 0 #0A9EE02E, 0 0 20px #0A9EE040; }
html[data-theme="light"] #screen-wars .wh-score .is-two strong { text-shadow: 0 3px 0 #F0502A2E, 0 0 20px #F0502A40; }
html[data-theme="light"] #screen-wars .wh-score em { color: #D99400 !important; }
html[data-theme="light"] #screen-wars .wh-score > span { background: linear-gradient(180deg, #FFF3C4, #FFE08A); border-color: #E9A100; box-shadow: 0 6px 16px #E9A10055; }
html[data-theme="light"] #screen-wars .wh-score > span::after { color: #7A4F00; }
html[data-theme="light"] #screen-wars .wh-tug { box-shadow: 0 4px 12px #F0502A33 !important; }
html[data-theme="light"] #screen-wars .wh-tug i { box-shadow: 0 4px 12px #0A9EE04D; }
html[data-theme="light"] #screen-wars .wh-tug i::after { box-shadow: 0 0 0 3px #0E14241A, 0 2px 8px #0E142440; }
html[data-theme="light"] #screen-wars .wh-winner { color: #B67C00 !important; text-shadow: none; }
html[data-theme="light"] #screen-wars .wh-winner strong { color: var(--ar-tx) !important; }
html[data-theme="light"] #screen-wars .wh-hero.is-forming h2 span { color: #D99400 !important; }

html[data-theme="light"] #screen-wars .wh-card { background: #fff !important; box-shadow: 0 10px 26px #0E142414 !important; }
html[data-theme="light"] #screen-wars .wh-icon { background: #0A9EE014 !important; }
html[data-theme="light"] #screen-wars .wh-icon.is-photo { background: #E9A10018 !important; color: #C98A00 !important; }
html[data-theme="light"] #screen-wars .wh-icon.is-honor { background: #7C4BD614 !important; color: #7C4BD6 !important; box-shadow: 0 0 0 1px #7C4BD633 inset; }
html[data-theme="light"] #screen-wars .wh-points { background: #0E14240D !important; }
html[data-theme="light"] #screen-wars .wh-points.is-full { background: #12A8621A !important; box-shadow: none; }
html[data-theme="light"] #screen-wars .wh-points.is-void { background: #E024241A !important; color: #D11F1F !important; }
html[data-theme="light"] #screen-wars .wh-habit-list em { color: #C98A00 !important; }
html[data-theme="light"] #screen-wars .wh-ranking li b { background: #0E14240D; }
html[data-theme="light"] #screen-wars .wh-avatar { background: #fff !important; box-shadow: 0 2px 8px #0A9EE033; }
html[data-theme="light"] #screen-wars .is-two .wh-avatar { box-shadow: 0 2px 8px #F0502A33; }
html[data-theme="light"] #screen-wars .wh-mvp { box-shadow: 0 2px 8px #E9A10055; }
html[data-theme="light"] #screen-wars .wh-day { background: #F6F8FC !important; }
html[data-theme="light"] #screen-wars .wh-day span b { color: #C98A00 !important; }
html[data-theme="light"] #screen-wars .wh-day.is-today { background: #FFF8E1 !important; box-shadow: 0 4px 14px #E9A10033; }
html[data-theme="light"] #screen-wars .wh-chip, html[data-theme="light"] #screen-wars .wh-react { background: #F6F8FC !important; }
html[data-theme="light"] #screen-wars .wh-chip.is-on { border-color: #E02424 !important; color: #D11F1F !important; }
html[data-theme="light"] #screen-wars .wh-react.is-on { background: #FFF3C4 !important; box-shadow: none; }
html[data-theme="light"] #screen-wars .wh-team { background: #fff !important; }
html[data-theme="light"] #screen-wars .war-link-block, html[data-theme="light"] #screen-wars .war-waiting-banner, html[data-theme="light"] #screen-wars .wh-note { background: #F6F8FC !important; }
html[data-theme="light"] #screen-wars input, html[data-theme="light"] #screen-wars .war-link-field input { background: #F6F8FC !important; }
html[data-theme="light"] #screen-wars .wars-inline-error, html[data-theme="light"] #screen-wars .wars-error { color: #B42318 !important; }
/* Ventanas en claro con botón de juego */
html[data-theme="light"] body.war-screen-active .modal-head h2 { font-family: "Chakra Petch", sans-serif !important; text-transform: uppercase; letter-spacing: .06em; }
html[data-theme="light"] body.war-screen-active .modal .action.primary { border: 0 !important; color: #1A1100 !important; background: linear-gradient(180deg, #FFD966, #FFB21E) !important; box-shadow: 0 4px 0 #B86E00 !important; font-family: "Chakra Petch", sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.screen.active { animation: appear-fast .14s ease-out !important; } @keyframes appear-fast { from { opacity: .6; } to { opacity: 1; } }

/* =====================================================================
   PERFIL PROFESIONAL (claro por defecto)
   ===================================================================== */
#screen-profile { --pp-card: var(--cm-cd); --pp-line: var(--cm-ln); --pp-soft: var(--cm-hv); }
/* Tarjeta de presentación: cabecera + estadísticas en una sola pieza */
#screen-profile .pf-hero { margin: 4px 0 0; padding: 0 18px 18px !important; overflow: hidden; border: 1px solid var(--pp-line); border-bottom: 0; border-radius: 28px 28px 0 0;
  background: var(--pp-card); box-shadow: 0 1px 2px #16181C0A, 0 18px 40px #16181C12; }
#screen-profile .pf-cover { inset: 0 0 auto 0 !important; height: 118px !important; border-radius: 0 !important;
  background: radial-gradient(60% 120% at 88% 0%, #6EC6FF66, transparent 60%), radial-gradient(60% 120% at 0% 100%, #7A5CE655, transparent 60%), linear-gradient(120deg, #0F2A5C 0%, #1756B8 55%, #2F7BE0 100%) !important; }
#screen-profile .pf-cover::before { opacity: .12 !important; background-size: 16px 16px !important; }
#screen-profile .pf-cover::after { width: 260px !important; height: 260px !important; right: -90px !important; top: -150px !important; border-width: 1px !important; border-color: #FFFFFF2E !important; box-shadow: 0 0 0 26px #FFFFFF08, 0 0 0 54px #FFFFFF06; }
#screen-profile .pf-photo { margin-top: 52px !important; filter: drop-shadow(0 8px 18px #0F2A5C40); }
#screen-profile .pf-photo .rank-frame { width: 120px !important; }
#screen-profile .pf-name { margin-top: 8px !important; color: var(--cm-tx) !important; font-size: 26px !important; font-weight: 800 !important; letter-spacing: -.035em !important; }
#screen-profile .pf-handle { margin-top: 2px !important; color: var(--cm-mu) !important; font-size: 14.5px !important; font-weight: 600 !important; }
#screen-profile .pf-rank { margin-top: 10px !important; padding: 5px 12px 5px 9px !important; border: 0 !important; border-radius: 99px !important;
  background: color-mix(in srgb, var(--cm-rank-light, #1A8AD4) 10%, var(--pp-card)) !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cm-rank-light, #1A8AD4) 25%, transparent) !important; font-size: 12.5px !important; letter-spacing: .01em; }
#screen-profile .pf-bio { max-width: 32ch !important; margin-top: 12px !important; color: var(--cm-tx2) !important; font-size: 14.5px !important; line-height: 1.5 !important; }
#screen-profile .pf-actions { gap: 10px !important; margin-top: 16px !important; }
#screen-profile .pf-btn { flex: 1; min-height: 46px !important; border-radius: 14px !important; font-size: 14.5px !important; font-weight: 700 !important; box-shadow: none !important; transform: none !important; }
#screen-profile .pf-btn.is-primary { border: 0 !important; background: #16181C !important; color: #fff !important; }
#screen-profile .pf-btn:not(.is-primary) { border: 1px solid var(--pp-line) !important; background: var(--pp-card) !important; color: var(--cm-tx) !important; }
#screen-profile .pf-btn .icon-svg { width: 18px; height: 18px; }
html:not([data-theme="light"]) #screen-profile .pf-btn.is-primary { background: #F4F5F7 !important; color: #16181C !important; }
#screen-profile .pf-stats { margin: 0 0 6px !important; padding: 14px 6px 16px !important; border: 1px solid var(--pp-line) !important; border-top: 1px solid var(--pp-line) !important; border-radius: 0 0 28px 28px !important;
  background: var(--pp-card) !important; box-shadow: 0 18px 40px #16181C12 !important; }
#screen-profile .pf-stats strong { color: var(--cm-tx) !important; font-size: 21px !important; font-weight: 800 !important; }
#screen-profile .pf-stats > :first-child strong { color: #1A8AD4 !important; }
#screen-profile .pf-stats span { color: var(--cm-mu) !important; font-size: 11px !important; font-weight: 700 !important; letter-spacing: .04em; text-transform: uppercase; }

/* Pestañas tipo control segmentado */
#screen-profile .pf-tabs { position: sticky; top: 62px; z-index: 5; display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 18px 0 14px !important; padding: 4px !important;
  border: 0 !important; border-radius: 14px; background: color-mix(in srgb, var(--cm-tx) 6%, var(--cm-bg)) !important; }
#screen-profile .pf-tabs button { min-height: 40px; border: 0 !important; border-radius: 11px !important; background: transparent !important; color: var(--cm-mu) !important; font-size: 14px !important; font-weight: 700 !important; box-shadow: none !important; }
#screen-profile .pf-tabs button::after { display: none !important; }
#screen-profile .pf-tabs button[aria-selected="true"] { background: var(--pp-card) !important; color: var(--cm-tx) !important; box-shadow: 0 1px 2px #16181C14, 0 4px 12px #16181C0F !important; }

/* Ajustes estilo lista agrupada */
#screen-profile .pf-section-title, #screen-profile .section-title h2 { margin: 30px 4px 10px !important; color: var(--cm-mu) !important; font-size: 12.5px !important; font-weight: 800 !important; letter-spacing: .08em !important; text-transform: uppercase; }
#screen-profile .section { margin-top: 0 !important; }
#screen-profile .sv-list, #screen-profile .panel { border: 1px solid var(--pp-line) !important; border-radius: 20px !important; background: var(--pp-card) !important; box-shadow: 0 1px 2px #16181C0A !important; }
#screen-profile .sv-row { min-height: 56px; }
#screen-profile .sv-row-icon { border-radius: 10px !important; background: color-mix(in srgb, #1A8AD4 10%, var(--pp-card)) !important; color: #1A8AD4 !important; }
#screen-profile .sv-row-text { font-weight: 600 !important; }
#screen-profile .phone-panel { display: grid; gap: 10px; padding: 16px !important; }
#screen-profile .phone-label { color: var(--cm-tx) !important; font-size: 14px !important; font-weight: 700 !important; }
#screen-profile #phoneInput { min-height: 48px; border-radius: 12px !important; }
#screen-profile .phone-toggle { display: flex !important; align-items: center; gap: 12px; color: var(--cm-tx) !important; font-size: 14px !important; font-weight: 600; }
#screen-profile .phone-toggle input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 99px; background: var(--cm-ln); cursor: pointer; transition: background .2s; }
#screen-profile .phone-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .2s; }
#screen-profile .phone-toggle input:checked { background: #1A8AD4; }
#screen-profile .phone-toggle input:checked::after { transform: translateX(18px); }
#screen-profile .phone-toggle input:disabled { opacity: .5; cursor: not-allowed; }
#screen-profile .phone-actions .action, #screen-profile #clearData { min-height: 44px; border: 1px solid var(--pp-line) !important; border-radius: 12px !important; background: var(--pp-card) !important; color: var(--cm-tx) !important; box-shadow: none !important; font-weight: 700 !important; }
#screen-profile #clearData { color: #D63636 !important; }
#screen-profile .theme-choice { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 4px !important; padding: 4px !important; background: color-mix(in srgb, var(--cm-tx) 6%, var(--cm-bg)) !important; border: 0 !important; }
#screen-profile .theme-choice button { min-height: 42px; border: 0 !important; border-radius: 12px !important; background: transparent !important; color: var(--cm-mu) !important; font-weight: 700 !important; box-shadow: none !important; }
#screen-profile .theme-choice button[aria-pressed="true"], #screen-profile .theme-choice button.active, #screen-profile .theme-choice button.is-active { background: var(--pp-card) !important; color: var(--cm-tx) !important; box-shadow: 0 1px 2px #16181C14, 0 4px 12px #16181C0F !important; }
#screen-profile .sv-btn { min-height: 52px; border: 1px solid var(--pp-line) !important; border-radius: 16px !important; background: var(--pp-card) !important; font-weight: 700 !important; box-shadow: none !important; }
#screen-profile .sv-delete { margin-top: 26px; color: #D63636 !important; }
#screen-profile .sv-logout { margin-top: 10px; color: var(--cm-tx) !important; }
#screen-profile .pf-tabs { position: static !important; }
#screen-profile .phone-toggle input { width: 46px !important; height: 28px !important; min-width: 46px !important; padding: 0 !important; border: 0 !important; border-radius: 99px !important; background: var(--cm-ln) !important; }
#screen-profile .phone-toggle input:checked { background: #1A8AD4 !important; }
#screen-profile .pf-stats span { font-size: 11.5px !important; letter-spacing: 0 !important; text-transform: none !important; font-weight: 600 !important; }
#screen-profile .phone-toggle input { min-height: 28px !important; max-height: 28px !important; box-shadow: none !important; }
