/* Mr. Kiooshi · tema "noche estrellada" con acento naranja */
:root {
  --bg: #07080b;
  --bg2: #0b0d12;
  --card: rgba(18, 21, 30, 0.82);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f6efe6;
  --muted: #9aa0ad;
  --accent: #f97316;
  --accent2: #fdba74;
  --ok: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 700px at 85% -10%, rgba(249, 115, 22, 0.22), transparent 60%), var(--bg);
  background-color: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
#stars { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
body.lite #stars { display: none; }
#app, .wrap { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 16px; padding-bottom: 96px; }
.hidden { display: none !important; }
img { max-width: 100%; }

h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; margin: 0 0 10px; }
h3 { font-size: 1.05rem; margin: 14px 0 8px; color: var(--accent2); }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small, small { font-size: 0.85rem; color: var(--muted); }
.center { text-align: center; }
.big { font-size: 2.4rem; font-weight: 800; margin: 4px 0; color: var(--accent2); }
.big span { font-size: 1rem; color: var(--muted); font-weight: 500; }
.note { background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.35); border-radius: 12px; padding: 10px 12px; color: var(--accent2); }
.pr { color: var(--warn); font-weight: 600; }
.done { color: var(--ok); }
.error { color: var(--bad); }
.ok { color: var(--ok); }

/* Cabecera y marca */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: 0.02em; }
.brand small { color: var(--muted); }
.mark {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #1a0d02; font-weight: 900; letter-spacing: -0.04em;
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.35);
}

/* Tarjetas */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 14px 0; box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.card.hidden { display: none !important; }
.hero { padding: 26px 20px; background: linear-gradient(160deg, rgba(249, 115, 22, 0.18), var(--card) 55%); }
.cards { display: grid; gap: 12px; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 160px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

/* Formularios */
label { display: grid; gap: 6px; font-size: 0.92rem; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(5, 6, 9, 0.7); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="file"] { padding: 10px; }
textarea { min-height: 96px; resize: vertical; }
label.switch { display: flex; align-items: center; gap: 10px; color: var(--text); }
label.switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.mini { font-size: 0.8rem; min-width: 120px; }
.pickers { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.pickers select { padding: 8px 10px; }

/* Botones */
button {
  appearance: none; border: 0; border-radius: 14px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #1a0d02;
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.25); transition: transform 0.08s ease, opacity 0.2s ease;
  min-height: 44px;
}
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
button.secondary { background: rgba(255, 255, 255, 0.08); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
button.danger { background: rgba(248, 113, 113, 0.18); color: #fecaca; box-shadow: none; border: 1px solid rgba(248, 113, 113, 0.4); }
button.link, .link { background: none; border: 0; box-shadow: none; color: var(--accent2); padding: 6px 2px; min-height: 0; font-weight: 600; text-align: left; }
button.wide, .wide { width: 100%; }
button.save { min-width: 96px; }
button.edit { padding: 8px 12px; min-height: 36px; }
button.set { padding: 8px 12px; min-height: 36px; }
.toggle { display: inline-flex; }

/* Tabs */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 6px -2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; background: rgba(255, 255, 255, 0.06); color: var(--muted); border: 1px solid var(--line); box-shadow: none; padding: 9px 14px; min-height: 40px; }
.tabs button.active { background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #1a0d02; border-color: transparent; }

/* Planes y elecciones */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 10px 0; }
.plan { position: relative; display: grid; gap: 6px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.plan.best { border-color: rgba(249, 115, 22, 0.7); box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.4), 0 12px 32px rgba(249, 115, 22, 0.18); }
.plan .price { font-size: 1.4rem; font-weight: 800; color: var(--accent2); }
.plan .disc { color: var(--ok); font-size: 0.85rem; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; background: rgba(255, 255, 255, 0.1); color: var(--text); }
.badge.ok { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.badge.bad { background: rgba(248, 113, 113, 0.15); color: var(--bad); }
.badge.rec { background: rgba(249, 115, 22, 0.2); color: var(--accent2); }
.choice { display: grid; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text); text-align: left; box-shadow: none; min-height: 0; width: 100%; font-weight: 500; }
.choice.big-choice { padding: 18px; }
.choice.picked { border-color: var(--accent); background: rgba(249, 115, 22, 0.12); }
.options { display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); cursor: pointer; }
.chips input { width: auto; accent-color: var(--accent); }
.selPlan, .goalPlan { font-weight: 700; }

/* Pago y comprobantes */
.upload { display: grid; place-items: center; padding: 18px; border: 1.5px dashed rgba(249, 115, 22, 0.55); border-radius: 14px; color: var(--accent2); cursor: pointer; text-align: center; }
.upload input { display: none; }
.upload span { font-weight: 700; }
.preview { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #000; }
.qr { width: min(240px, 70vw); border-radius: 14px; background: #fff; padding: 8px; justify-self: center; }

/* Entrenamiento */
.exercise { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.02); display: grid; gap: 8px; }
.exercise h3 { margin: 0; color: var(--text); }
.set { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
.set input { padding: 10px; }
.set button { padding: 10px 12px; min-height: 42px; }
.timer { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 999px; background: rgba(11, 13, 18, 0.95); border: 1px solid rgba(249, 115, 22, 0.5); box-shadow: var(--shadow); font-variant-numeric: tabular-nums; font-weight: 700; }
.timer button { padding: 8px 12px; min-height: 36px; }
.bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: inherit; }
.chart { width: 100%; height: auto; color: var(--muted); }
.videolink { color: var(--accent2); font-weight: 600; word-break: break-all; }
a { color: var(--accent2); }

/* Insignias y racha */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge-item { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.badge-item span { font-size: 1.3rem; color: var(--muted); }
.badge-item.on { color: var(--text); border-color: rgba(253, 186, 116, 0.55); background: rgba(249, 115, 22, 0.1); }
.badge-item.on span { color: var(--warn); text-shadow: 0 0 10px rgba(251, 191, 36, 0.6); }

/* Enlaces */
.links { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.linkbtn { display: grid; gap: 2px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text); text-decoration: none; font-weight: 700; }
.linkbtn small { color: var(--muted); font-weight: 500; word-break: break-all; }
.linkbtn:hover { border-color: var(--accent); }

/* Avisos */
.toast {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px;
  background: #151923; border: 1px solid rgba(249, 115, 22, 0.5); color: var(--text); box-shadow: var(--shadow);
  animation: toastin 0.25s ease-out;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Pantallas de acceso */
.login { max-width: 420px; margin: 40px auto 0; }
.how { display: grid; gap: 8px; }
.hello { font-size: 1.1rem; }

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Tienda */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.product { display: grid; gap: 6px; align-content: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.product strong { font-size: 0.98rem; }
.thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; background: #05060a; }
.thumb.ph { display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; color: var(--accent2); background: rgba(249, 115, 22, 0.12); }
.mini-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; }
.price { font-weight: 800; color: var(--accent2); }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper b { min-width: 24px; text-align: center; }
button.qbtn { min-height: 36px; padding: 6px 12px; }
button.qbtn.plus { padding: 6px 12px; }

/* Móvil */
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .set { grid-template-columns: 1fr 1fr; }
  .card { padding: 14px; }
  .mini { min-width: 0; flex: 1 1 140px; }
}

/* Racha, reconocimientos, frase del día, comidas rápidas */
.pill { display: inline-block; margin: 4px 0; padding: 4px 10px; border-radius: 999px; background: var(--accent, #ff8a2b); color: #1b1020; font-weight: 700; font-size: .9rem; }
.recogs { display: grid; gap: 10px; }
.recog { padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(255,255,255,.18); display: grid; gap: 6px; }
.recog.on { border-style: solid; border-color: var(--accent, #ff8a2b); background: rgba(255,138,43,.08); }
.motiv { border-left: 4px solid var(--accent, #ff8a2b); }
.motiv-text { font-size: 1.05rem; line-height: 1.45; margin: 4px 0 0; font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 8px 12px; border-radius: 12px; min-width: 0; max-width: 100%; }
.chip small { opacity: .75; font-weight: 400; }

/* Subsecciones (Mi plan, Tienda) */
.subnav { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0; padding-bottom: 2px; }
.subnav button { flex: 0 0 auto; border-radius: 999px; padding: 8px 14px; }
.subnav button.active { background: var(--accent, #ff8a2b); color: #1b1020; }
