:root {
  --bg: #080d18;
  --bg-2: #10192b;
  --card: rgba(17, 27, 47, .88);
  --card-2: rgba(24, 38, 66, .92);
  --text: #f1f6ff;
  --muted: #9ba8c1;
  --brand: #69e59f;
  --brand-2: #65a8ff;
  --danger: #ff6b7a;
  --warning: #ffd166;
  --ok: #77f2b0;
  --border: rgba(255, 255, 255, .105);
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -8%, rgba(101, 168, 255, .36), transparent 20rem),
    radial-gradient(circle at 92% 4%, rgba(105, 229, 159, .18), transparent 18rem),
    linear-gradient(180deg, #070b14 0%, var(--bg) 60%, #050812 100%);
}
button, input, select { font: inherit; }
button {
  min-height: 48px;
  border: 0;
  border-radius: 18px;
  padding: 13px 18px;
  color: #06101f;
  font-weight: 950;
  background: linear-gradient(135deg, var(--brand), #c7ffd9);
  box-shadow: 0 12px 28px rgba(105, 229, 159, .18);
  cursor: pointer;
}
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
button.secondary { background: rgba(255,255,255,.075); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
button.danger { background: rgba(255, 107, 122, .14); color: #ffd9de; border: 1px solid rgba(255, 107, 122, .35); box-shadow: none; }
button.small { min-height: 40px; padding: 10px 13px; border-radius: 14px; }
.icon-btn { width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border-radius: 16px; }
input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(3, 7, 18, .48);
  color: var(--text);
  outline: none;
}
input:focus, select:focus { border-color: rgba(105, 229, 159, .7); box-shadow: 0 0 0 4px rgba(105,229,159,.08); }
label { display: grid; gap: 8px; color: var(--muted); font-size: .92rem; font-weight: 800; }
p { margin: 0; color: var(--muted); line-height: 1.5; }
h1, h2 { margin: 0; letter-spacing: -.04em; }
h1 { font-size: 1.35rem; line-height: 1; }
h2 { font-size: 1.45rem; }
.app-shell { width: min(960px, 100%); margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 12px 76px; }
.topbar { display: grid; grid-template-columns: 50px 1fr 50px; align-items: center; gap: 12px; margin-bottom: 12px; }
.brand-mark, .avatar {
  display: grid; place-items: center; font-weight: 1000; color: #06101f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: inset 0 -10px 22px rgba(0,0,0,.12), 0 16px 30px rgba(101,168,255,.14);
}
.brand-mark { width: 50px; height: 50px; border-radius: 18px; }
.eyebrow { display: block; margin-bottom: 4px; color: var(--brand); text-transform: uppercase; letter-spacing: .13em; font-size: .68rem; font-weight: 950; }
.hero-card, .card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-card { padding: 18px; display: grid; gap: 16px; margin-bottom: 12px; }
.hero-user { display: flex; align-items: center; gap: 14px; }
.avatar { width: 68px; height: 68px; border-radius: 24px; font-size: 1.45rem; flex: none; }
.hero-user strong { font-size: 1.35rem; }
.score-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-strip > div { background: rgba(255,255,255,.065); border: 1px solid var(--border); border-radius: 20px; padding: 14px; display: grid; gap: 4px; }
.score-strip span, small { color: var(--muted); font-size: .82rem; font-weight: 800; }
.score-strip strong { font-size: 1.7rem; }
.progress, .bar { height: 10px; background: rgba(255,255,255,.09); border-radius: 999px; overflow: hidden; }
.progress i, .bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: inherit; }
.mobile-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  margin-bottom: 12px;
  border-radius: 22px;
  background: rgba(6, 10, 20, .76);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.mobile-tabs a { color: var(--text); text-decoration: none; text-align: center; font-weight: 950; font-size: .82rem; padding: 11px 8px; border-radius: 15px; background: rgba(255,255,255,.055); }
main { display: grid; gap: 12px; }
.card { padding: 18px; scroll-margin-top: 92px; }
.section-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.compact-title { align-items: center; }
.pill { display: inline-flex; align-items: center; width: fit-content; margin-bottom: 8px; border: 1px solid rgba(105,229,159,.26); background: rgba(105,229,159,.12); color: var(--brand); padding: 6px 10px; border-radius: 999px; font-size: .72rem; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
.pill.ghost { color: var(--brand-2); border-color: rgba(101,168,255,.28); background: rgba(101,168,255,.12); }
.stacked-form { display: grid; gap: 13px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.list, .timeline, .ranking { display: grid; gap: 11px; margin-top: 14px; }
.item, .time-block, .active-block {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,.06);
  padding: 14px;
}
.item-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.item-head strong { font-size: 1.08rem; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; }
.badge { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 6px 9px; background: rgba(105,229,159,.12); color: var(--brand); font-size: .76rem; font-weight: 950; white-space: nowrap; }
.badge.warn { background: rgba(255,209,102,.12); color: var(--warning); }
.badge.danger { background: rgba(255,107,122,.13); color: #ffb9c1; }
.badge.blue { background: rgba(101,168,255,.13); color: #b7d5ff; }
.time-block { display: grid; grid-template-columns: 68px 1fr auto; align-items: center; gap: 10px; }
.time-block strong { font-variant-numeric: tabular-nums; }
.time-meta { display: grid; gap: 5px; min-width: 0; }
.time-meta span { font-weight: 900; }
.time-meta small { display: block; }
.status-done { border-color: rgba(105, 229, 159, .35); background: rgba(105, 229, 159, .075); }
.status-active { border-color: rgba(255, 209, 102, .45); background: rgba(255, 209, 102, .09); box-shadow: 0 0 0 4px rgba(255,209,102,.04); }
.status-missed { border-color: rgba(255, 107, 122, .35); background: rgba(255, 107, 122, .08); }
.active-block { display: grid; gap: 14px; background: linear-gradient(135deg, rgba(255,209,102,.13), rgba(101,168,255,.07)); }
.active-block h3 { margin: 0; font-size: 1.25rem; }
.active-big { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.active-big strong { font-size: 2rem; }
.empty-state { color: var(--muted); }
.rank-row { display: grid; grid-template-columns: 86px 1fr 72px; align-items: center; gap: 10px; }
.rank-row strong { font-size: .92rem; }
.rank-row.active { color: var(--brand); }
.notice { padding: 12px; border-radius: 16px; background: rgba(255,255,255,.055); border: 1px solid var(--border); font-size: .86rem; }
#toastRoot { position: fixed; left: 12px; right: 12px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 99; display: grid; gap: 8px; pointer-events: none; }
.toast { justify-self: center; max-width: 520px; width: fit-content; border-radius: 18px; padding: 13px 16px; background: #f1f6ff; color: #07111f; font-weight: 950; box-shadow: 0 18px 44px rgba(0,0,0,.35); }
@media (min-width: 780px) {
  .app-shell { padding-left: 20px; padding-right: 20px; }
  main { grid-template-columns: 1fr 1fr; }
  #panelHoy, .ranking-card, #panelConfig { grid-column: span 2; }
  .mobile-tabs { top: 12px; }
}
@media (max-width: 430px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .card, .hero-card { border-radius: 24px; padding: 15px; }
  .form-grid-2, .button-row, .score-strip { grid-template-columns: 1fr; }
  .section-title { display: grid; }
  .time-block { grid-template-columns: 58px 1fr; }
  .time-block button { grid-column: 1 / -1; }
  .rank-row { grid-template-columns: 78px 1fr 62px; }
}
