/* CAGÓMETRO — cartoon claro (rediseño 19-jul con referencias Mobbin: Duolingo/Life Reset).
   Identidad: porcelana crema + marrón + naranja, tipografía redonda gorda (Baloo 2
   self-hosted, la CSP solo permite 'self'), botones "chunky" con canto inferior 3D.
   Reglas que se mantienen: táctil >= 44px, cero scroll horizontal, prefers-reduced-motion,
   alturas de barras por clases .lvl-N (nada inline por la CSP). */

@font-face {
  font-family: 'Baloo 2';
  src: url('fonts/baloo2.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper:     #fdf6ec;   /* porcelana crema */
  --paper-2:   #f6ecdb;
  --card:      #ffffff;
  --line:      #e9dcc3;   /* borde de las tarjetas */
  --edge:      #e0d0b0;   /* canto inferior 3D */
  --ink:       #4a3423;   /* texto principal, marrón oscuro */
  --muted:     #a58d73;
  --brown:     #8b5a2b;
  --brown-dk:  #63401e;
  --naranja:   #f28c1e;   /* acción / racha */
  --naranja-dk:#d1740f;
  --gold:      #ffc800;   /* oro / trono */
  --gold-dk:   #e0a900;
  --ok:        #58cc02;
  --ok-dk:     #46a302;
  --ok-bg:     #eaf9dc;
  --bad:       #ea5b4f;
  --radius:    18px;
  --tap:       44px;
  --pad:       16px;
  --safe-b:    env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

/* El atributo hidden tiene que ganar: .topbar/.tabs declaran display:flex y, sin esto,
   la regla de clase pisa al [hidden] del navegador y la barra se cuela en la pantalla de entrar. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;               /* nada de scroll horizontal, nunca */
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Baloo 2', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.42;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  /* Hueco para la barra de pestañas fija: si se queda corto, el último elemento
     de la pantalla queda debajo de la barra y no se puede leer. */
  padding-bottom: calc(104px + var(--safe-b));
}

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: 0; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
img { max-width: 100%; }

/* ---------------- Topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px var(--pad);
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(253, 246, 236, 0.94);
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(8px);
}
.topbar-left { display: flex; flex-direction: column; min-width: 0; }
.brand {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.12em;
  color: var(--brown);
}
.group-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--edge);
  border-radius: 999px;
  padding: 4px 12px;
}
.who-emoji { font-size: 17px; }
.who-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34vw;
}

/* ---------------- Layout ---------------- */

.app { padding: var(--pad); max-width: 560px; margin: 0 auto; }
.screen { display: flex; flex-direction: column; gap: 18px; }
.section-title { font-size: 21px; margin-top: 4px; color: var(--ink); }
.sub-title { font-size: 14px; color: var(--muted); margin-top: 12px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; }
.hint { font-size: 13px; color: var(--muted); }
.noscript { padding: 24px; text-align: center; color: var(--ink); }

.boot { text-align: center; padding: 60px 0; color: var(--muted); }
.boot-emoji { font-size: 56px; }
.boot-text { margin-top: 10px; font-weight: 700; }

.loading { text-align: center; padding: 36px 0; color: var(--muted); font-weight: 700; }
.spinner {
  width: 26px; height: 26px; margin: 0 auto 12px;
  border: 4px solid var(--line);
  border-top-color: var(--naranja);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 40px 12px; color: var(--muted); }
.empty-ico { font-size: 44px; }
.empty-title { font-weight: 800; color: var(--ink); margin-top: 8px; }
.empty-sub { font-size: 14px; margin-top: 4px; }

/* ---------------- Botones (canto inferior 3D, marca de la casa) ---------------- */

.btn {
  min-height: var(--tap);
  padding: 11px 18px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--edge);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.12s ease;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary {
  background: var(--naranja);
  border-color: var(--naranja-dk);
  box-shadow: 0 4px 0 var(--naranja-dk);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.btn-primary:active { box-shadow: 0 0 0 var(--naranja-dk); }
.btn-big { width: 100%; font-size: 18px; letter-spacing: 0.09em; min-height: 56px; text-transform: uppercase; }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--brown); }
.btn-ghost:active { transform: scale(0.95); }
.btn-danger { color: var(--bad); border-color: #f2cfc4; }
.btn-arrow {
  min-width: var(--tap);
  padding: 6px 14px;
  font-size: 24px;
  line-height: 1;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--edge);
  color: var(--brown);
}
.btn-arrow:disabled { box-shadow: 0 4px 0 var(--edge); }
.btn-mini {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
  box-shadow: 0 2px 0 var(--edge);
  align-self: center;
}
.btn-undo {
  width: 100%;
  background: #fff6ea;
  border-color: var(--naranja);
  box-shadow: 0 4px 0 var(--naranja-dk);
  color: var(--naranja-dk);
  letter-spacing: 0.06em;
}
.btn-undo:active { box-shadow: 0 0 0 var(--naranja-dk); }

:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }

/* ---------------- Join ---------------- */

.hero { text-align: center; padding: 18px 0 4px; }
.hero-emoji { font-size: 76px; line-height: 1; filter: drop-shadow(0 6px 0 rgba(139, 90, 43, 0.18)); animation: hero-bob 2.6s ease-in-out infinite; }
@keyframes hero-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-8px) rotate(3deg); }
}
.hero-title { font-size: 38px; letter-spacing: 0.06em; color: var(--brown); margin-top: 8px; font-weight: 800; }
.hero-sub { color: var(--muted); margin-top: 4px; font-size: 15px; font-weight: 700; }

.join-form { display: flex; flex-direction: column; gap: 10px; }
.label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; margin-top: 6px; }
.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid var(--line);
  box-shadow: inset 0 2px 0 rgba(224, 208, 176, 0.35);
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;                 /* 16px o iOS hace zoom al enfocar */
}
.input::placeholder { color: #c5b096; font-weight: 600; }
.input:focus { border-color: var(--naranja); outline: none; }

.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.emoji-btn {
  min-height: var(--tap);
  min-width: var(--tap);
  font-size: 24px;
  border-radius: 14px;
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--edge);
  background: var(--card);
  cursor: pointer;
  transition: transform 0.08s ease;
}
.emoji-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--edge); }
.emoji-btn.on {
  border-color: var(--gold-dk);
  background: #fff7d6;
  box-shadow: 0 3px 0 var(--gold-dk);
}

/* ---------------- Home ---------------- */

.screen-home { align-items: center; text-align: center; }
.home-kicker { color: var(--muted); font-size: 16px; font-weight: 700; margin-top: 8px; }

.big-btn {
  width: min(62vw, 230px);
  height: min(62vw, 230px);
  border-radius: 50%;
  border: 7px solid #ffffff;      /* aro pegatina */
  cursor: pointer;
  background:
    radial-gradient(circle at 35% 28%, #ab7440 0%, var(--brown) 45%, var(--brown-dk) 100%);
  box-shadow:
    0 10px 0 var(--edge),
    0 18px 30px rgba(99, 64, 30, 0.28);
  display: grid;
  place-items: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.big-btn:active {
  transform: translateY(8px);
  box-shadow: 0 2px 0 var(--edge), 0 8px 16px rgba(99, 64, 30, 0.22);
}
.big-emoji { font-size: min(28vw, 104px); line-height: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35)); }
.big-btn.pop { animation: pop 0.45s ease; }
@keyframes pop {
  0%   { transform: scale(0.9); }
  45%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Racha: llama con número gordo naranja, referencia directa de la pantalla de streak */
.streak-slot { width: 100%; }
.streak-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--edge);
  border-radius: var(--radius);
  padding: 10px 18px;
  width: 100%;
}
.streak-flame { font-size: 34px; line-height: 1; }
.streak-hero.off .streak-flame { filter: grayscale(1); opacity: 0.45; }
.streak-num { font-size: 34px; font-weight: 800; color: var(--naranja); line-height: 1; }
.streak-hero.off .streak-num { color: var(--muted); }
.streak-label { font-size: 14px; font-weight: 700; color: var(--muted); text-align: left; line-height: 1.2; }

.counters { display: flex; gap: 10px; width: 100%; }
.counter {
  flex: 1;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--edge);
  border-radius: var(--radius);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.counter-value { font-size: 26px; font-weight: 800; color: var(--brown); line-height: 1.15; }
.counter-label { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.card-slot { width: 100%; }
.nudge { color: var(--muted); font-size: 15px; font-weight: 700; padding: 8px 0; }
.queued-note { font-size: 13px; font-weight: 700; color: var(--naranja-dk); }

.card {
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 5px 0 var(--edge);
  border-radius: 20px;
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slide-up 0.25s ease;
}
@keyframes slide-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-title { font-weight: 800; color: var(--ok-dk); }
.card-time { font-size: 13px; font-weight: 700; color: var(--muted); }
.card-sub { font-size: 13px; font-weight: 600; color: var(--muted); }
.pending-note { font-size: 13px; font-weight: 700; color: var(--muted); }

.bristol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bristol-btn {
  min-height: var(--tap);
  padding: 6px 2px;
  border-radius: 14px;
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--edge);
  background: var(--card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.08s ease;
}
.bristol-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--edge); }
.bristol-btn.on {
  border-color: var(--ok);
  background: var(--ok-bg);
  box-shadow: 0 3px 0 var(--ok-dk);
}
.bristol-ico { font-size: 20px; }
.bristol-name { font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.15; }
.bristol-btn.on .bristol-name { color: var(--ok-dk); }

.sw-row { display: flex; align-items: center; gap: 12px; }
.sw-clock { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--naranja); min-width: 84px; }

/* Confeti del tap: trayectorias por clase (nada inline por la CSP) */
.cf-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}
.cf {
  position: absolute;
  left: 50%;
  top: 40%;
  font-size: 24px;
  line-height: 1;
  animation: cf-fly 0.85s cubic-bezier(0.15, 0.55, 0.4, 1) forwards;
}
@keyframes cf-fly {
  0%   { transform: translate(-50%, -50%) scale(0.5) rotate(0deg); opacity: 1; }
  60%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2) rotate(var(--rot)); opacity: 0; }
}
.cf-1  { --dx: -110px; --dy: -140px; --rot: -180deg; }
.cf-2  { --dx:  110px; --dy: -150px; --rot:  200deg; }
.cf-3  { --dx: -150px; --dy:  -40px; --rot: -240deg; }
.cf-4  { --dx:  150px; --dy:  -50px; --rot:  160deg; }
.cf-5  { --dx:  -60px; --dy: -180px; --rot:  120deg; }
.cf-6  { --dx:   60px; --dy: -190px; --rot: -140deg; }
.cf-7  { --dx: -130px; --dy:   70px; --rot:  220deg; }
.cf-8  { --dx:  130px; --dy:   60px; --rot: -200deg; }
.cf-9  { --dx:  -30px; --dy: -120px; --rot:   90deg; }
.cf-10 { --dx:   30px; --dy: -130px; --rot:  -90deg; }

/* ---------------- Ranking ---------------- */

.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.month-label { font-weight: 800; font-size: 20px; text-transform: capitalize; color: var(--brown); }
.ranking-total { color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; }

/* Banner de liga: el trono se decide en X días (referencia liga Duolingo con cuenta atrás) */
.league-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff7d6;
  border: 2px solid var(--gold-dk);
  box-shadow: 0 4px 0 var(--gold-dk);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--brown-dk);
  text-align: center;
}
.league-banner.closed {
  background: var(--paper-2);
  border-color: var(--line);
  box-shadow: 0 4px 0 var(--edge);
  color: var(--muted);
}

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding-top: 6px; }
.podium-slot {
  flex: 1;
  max-width: 33%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.podium-medal { font-size: 26px; }
.podium-emoji { font-size: 28px; filter: drop-shadow(0 3px 0 rgba(139, 90, 43, 0.15)); }
.podium-name {
  font-weight: 800;
  font-size: 14px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podium-count { font-size: 22px; font-weight: 800; color: var(--brown); }
.podium-step {
  width: 100%;
  border-radius: 12px 12px 0 0;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-bottom: none;
}
.pos-1 .podium-step { height: 78px; background: var(--gold); border-color: var(--gold-dk); }
.pos-2 .podium-step { height: 56px; background: #eee9dd; border-color: #d5cdba; }
.pos-3 .podium-step { height: 42px; background: #e8b98a; border-color: #cf9a63; }
.pos-1 .podium-count { color: var(--gold-dk); }

.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--edge);
  border-radius: 16px;
  min-height: var(--tap);
}
.rank-row.mine {
  border-color: var(--naranja);
  background: #fff3e2;
  box-shadow: 0 3px 0 var(--naranja-dk);
}
.rank-pos { width: 22px; color: var(--muted); font-weight: 800; text-align: center; flex: none; }
.rank-emoji { font-size: 22px; flex: none; }
.rank-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rank-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-count { font-size: 22px; font-weight: 800; color: var(--brown); flex: none; }
.rank-row.mine .rank-count { color: var(--naranja-dk); }

/* Títulos del mes: pegatinas torcidas alternas */
.awards { display: flex; flex-direction: column; gap: 10px; }
.award {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--edge);
  border-radius: 18px;
}
.award:nth-child(odd)  { transform: rotate(-1.1deg); }
.award:nth-child(even) { transform: rotate(1.1deg); }
.award-ico {
  font-size: 26px;
  flex: none;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
}
.award-body { min-width: 0; }
.award-name { font-weight: 800; color: var(--brown); }
.award-who { font-size: 14px; font-weight: 700; }
.award-copy { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------------- Feed ---------------- */

.feed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed-row {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--edge);
  border-radius: 16px;
}
.feed-row.mine { border-color: var(--naranja); box-shadow: 0 3px 0 var(--naranja-dk); }
.feed-emoji {
  font-size: 20px;
  flex: none;
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}
.feed-main { min-width: 0; flex: 1; }
.feed-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.feed-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-time { font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.feed-bits { font-size: 13px; font-weight: 600; color: var(--muted); }
.feed-note { font-size: 14px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }

/* ---------------- Yo ---------------- */

.kpis { display: flex; gap: 10px; }
.kpi {
  flex: 1;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--edge);
  border-radius: var(--radius);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.kpi-value { font-size: 26px; font-weight: 800; color: var(--brown); line-height: 1.15; }
.kpi-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.yo-since { font-size: 13px; font-weight: 600; color: var(--muted); }

.chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 130px;
  padding: 8px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--edge);
  border-radius: var(--radius);
}
.chart-week { gap: 8px; height: 150px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; min-width: 0; }
.bar {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: var(--naranja);
  min-height: 3px;
}
.bar-tick { font-size: 10px; font-weight: 700; color: var(--muted); height: 12px; }
.bar-val { font-size: 11px; font-weight: 700; color: var(--muted); }

.month-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.month-row { display: flex; align-items: center; gap: 10px; }
.month-name { font-size: 13px; font-weight: 700; width: 96px; flex: none; color: var(--muted); text-transform: capitalize; }
.month-bar { flex: 1; height: 16px; background: var(--paper-2); border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.month-fill { display: block; height: 100%; background: var(--naranja); border-radius: 999px; }
.month-count { font-weight: 800; width: 34px; text-align: right; flex: none; }

/* Niveles 0..20 de las barras (alturas / anchos por clase, no inline) */
.bar.lvl-0  { height: 0; } .month-fill.lvl-0  { width: 0; }
.bar.lvl-1  { height: 5%; }  .month-fill.lvl-1  { width: 5%; }
.bar.lvl-2  { height: 10%; } .month-fill.lvl-2  { width: 10%; }
.bar.lvl-3  { height: 15%; } .month-fill.lvl-3  { width: 15%; }
.bar.lvl-4  { height: 20%; } .month-fill.lvl-4  { width: 20%; }
.bar.lvl-5  { height: 25%; } .month-fill.lvl-5  { width: 25%; }
.bar.lvl-6  { height: 30%; } .month-fill.lvl-6  { width: 30%; }
.bar.lvl-7  { height: 35%; } .month-fill.lvl-7  { width: 35%; }
.bar.lvl-8  { height: 40%; } .month-fill.lvl-8  { width: 40%; }
.bar.lvl-9  { height: 45%; } .month-fill.lvl-9  { width: 45%; }
.bar.lvl-10 { height: 50%; } .month-fill.lvl-10 { width: 50%; }
.bar.lvl-11 { height: 55%; } .month-fill.lvl-11 { width: 55%; }
.bar.lvl-12 { height: 60%; } .month-fill.lvl-12 { width: 60%; }
.bar.lvl-13 { height: 65%; } .month-fill.lvl-13 { width: 65%; }
.bar.lvl-14 { height: 70%; } .month-fill.lvl-14 { width: 70%; }
.bar.lvl-15 { height: 75%; } .month-fill.lvl-15 { width: 75%; }
.bar.lvl-16 { height: 80%; } .month-fill.lvl-16 { width: 80%; }
.bar.lvl-17 { height: 85%; } .month-fill.lvl-17 { width: 85%; }
.bar.lvl-18 { height: 90%; } .month-fill.lvl-18 { width: 90%; }
.bar.lvl-19 { height: 95%; } .month-fill.lvl-19 { width: 95%; }
.bar.lvl-20 { height: 100%; } .month-fill.lvl-20 { width: 100%; }

/* ---------------- Tabs ---------------- */

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: rgba(255, 255, 255, 0.97);
  border-top: 2px solid var(--line);
  padding: 6px 8px;
  padding-bottom: calc(6px + var(--safe-b));
  backdrop-filter: blur(8px);
}
.tab {
  flex: 1;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 4px;
  border-radius: 14px;
  border: 2px solid transparent;
  margin: 0 2px;
}
.tab.on {
  color: var(--naranja-dk);
  background: #fff3e2;
  border-color: var(--naranja);
}
.tab-ico { font-size: 22px; line-height: 1; }
.tab.on .tab-ico { transform: scale(1.08); }
.tab-label { font-size: 11px; font-weight: 800; letter-spacing: 0.03em; }

/* ---------------- Toast ---------------- */

.toast-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(92px + var(--safe-b));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  background: var(--brown-dk);
  color: #fdf6ec;
  border: 2px solid var(--brown);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 0 rgba(74, 52, 35, 0.5), 0 10px 26px rgba(74, 52, 35, 0.25);
  animation: toast-in 0.2s ease;
  overflow-wrap: anywhere;
}
.toast-ok { background: var(--ok-dk); border-color: var(--ok); }
.toast.out { opacity: 0; transition: opacity 0.55s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------------- Accesibilidad ---------------- */

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

@media (min-width: 520px) {
  .bristol { grid-template-columns: repeat(7, 1fr); }
  .emoji-grid { grid-template-columns: repeat(12, 1fr); }
}
