/* ===== Tema Windows 11 dark (Fluent) ===== */
:root {
  --bg: #1b1b1b;
  --bg-elev: #202020;
  --card: #2b2b2b;
  --card2: #323232;
  --control: #2d2d2d;
  --stroke: rgba(255,255,255,.06);
  --stroke-strong: rgba(255,255,255,.11);
  --txt: #ffffff;
  --muted: #a0a0a0;
  --accent: #4cc2ff;        /* azul de acento do Windows 11 (dark) */
  --accent-press: #3aa9e0;
  --on-accent: #00263d;
  --ok: #6ccb5a;
  --danger: #ff7b7b;
  --gold: #ffd166;
  --radius: 8px;
  --radius-sm: 6px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: radial-gradient(1100px 560px at 50% -260px, #262626 0%, rgba(0,0,0,0) 62%), var(--bg);
  background-attachment: fixed;
  color: var(--txt);
  min-height: 100vh;
  min-height: 100dvh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }

/* Ícones SVG (Lucide) */
.ico { width: 1.1em; height: 1.1em; vertical-align: -0.16em; flex: 0 0 auto; display: inline-block; }

/* --- Polimento de interação (igual nos 2 apps) --- */
button { font-family: inherit; -webkit-user-select: none; user-select: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--txt);
  -webkit-box-shadow: 0 0 0 1000px var(--control) inset;
  caret-color: var(--txt);
  transition: background-color 9999s ease-in-out 0s;
}

/* ---------------- AUTH ---------------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
}
.logo { color: var(--accent); }
.logo .ico { width: 52px; height: 52px; }
.auth-card h1 { margin: 6px 0 4px; font-size: 25px; font-weight: 600; }
.auth-card h1 span { color: var(--accent); }
.tagline { color: var(--muted); margin: 0 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
input {
  background: var(--control);
  border: 1px solid var(--stroke-strong);
  border-bottom: 2px solid var(--stroke-strong);
  color: var(--txt);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 16px; width: 100%;
}
input:focus { outline: none; border-bottom-color: var(--accent); }
.btn-primary {
  background: var(--accent); color: var(--on-accent);
  border: 0; padding: 13px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary:hover { background: #5cc9ff; }
.btn-primary:active { background: var(--accent-press); }
.hint { color: var(--muted); font-size: 13px; margin-top: 18px; }
.hint b { color: var(--txt); }
.error { background: rgba(255,123,123,.12); color: var(--danger); padding: 10px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 14px; }

/* ---------------- APP ---------------- */
.app { padding: 16px 16px calc(86px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.view { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 -16px 16px; padding: 14px 16px 12px;
  background: var(--bg); border-bottom: 1px solid var(--stroke);
}
.topbar h2 { margin: 0; font-size: 21px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.topbar h2 .ico { width: 22px; height: 22px; color: var(--accent); }
.period { color: var(--muted); font-size: 13px; }

/* ---------------- PLACAR ---------------- */
.leaderboard { display: flex; flex-direction: column; gap: 12px; }
.lb-card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  border: 1px solid var(--stroke); position: relative; overflow: hidden;
}
.lb-card.leader { border-color: rgba(255,209,102,.55); box-shadow: 0 0 0 1px rgba(255,209,102,.35); }
.lb-head { display: flex; align-items: center; justify-content: space-between; }
.lb-name { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.crown { color: var(--gold); display: inline-flex; }
.crown .ico { width: 18px; height: 18px; }
.lb-total { font-size: 32px; font-weight: 700; }
.lb-total small { font-size: 13px; color: var(--muted); font-weight: 500; }
.lb-bar { height: 6px; background: var(--bg-elev); border-radius: 999px; margin: 12px 0; overflow: hidden; }
.lb-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.lb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg-elev); color: var(--muted); font-size: 12px; padding: 5px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.chip .ico { width: 14px; height: 14px; vertical-align: middle; }
.chip b { color: var(--txt); }
.chip.neg { color: var(--danger); }
.chip.neg b { color: var(--danger); }

.rules { margin-top: 22px; background: var(--card); border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--stroke); }
.rules h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.rules ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.9; font-size: 14px; }
.rules b { color: var(--txt); }

/* ---------------- REGISTRAR ---------------- */
.date-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; color: var(--muted); }
.date-row input { width: auto; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-card {
  background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius);
  padding: 18px 12px; color: var(--txt); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px; transition: .12s;
}
.type-card .ico { width: 30px; height: 30px; color: var(--accent); }
.type-card.danger .ico { color: var(--danger); }
.type-card span { font-size: 14px; font-weight: 600; }
.type-card em { font-size: 12px; color: var(--muted); font-style: normal; }
.type-card:hover { background: var(--card2); }
.type-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: rgba(76,194,255,.08); }
.type-card.danger.selected { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); background: rgba(255,123,123,.08); }
.type-card:active { transform: scale(.98); }

.reg-extra { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--control); border: 1px solid var(--stroke-strong); border-radius: var(--radius-sm); padding: 8px; }
.stepper button { width: 46px; height: 46px; border-radius: var(--radius-sm); border: 0; background: var(--accent); color: var(--on-accent); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.stepper button .ico { width: 22px; height: 22px; }
.stepper span { font-size: 22px; font-weight: 700; }
.reg-msg { text-align: center; font-size: 14px; min-height: 18px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.reg-msg .ico { width: 16px; height: 16px; }
.reg-msg.ok { color: var(--ok); }
.reg-msg.err { color: var(--danger); }
#reg-points { opacity: .9; font-weight: 600; }

/* ---------------- FEED ---------------- */
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-item { background: var(--card); border-radius: var(--radius); padding: 12px 14px; border: 1px solid var(--stroke); display: flex; align-items: center; gap: 12px; }
.feed-emoji { display: inline-flex; color: var(--accent); }
.feed-emoji .ico { width: 24px; height: 24px; }
.feed-main { flex: 1; min-width: 0; }
.feed-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.feed-sub { color: var(--muted); font-size: 12px; }
.feed-pts { font-weight: 700; font-size: 16px; }
.feed-pts.pos { color: var(--ok); }
.feed-pts.neg { color: var(--danger); }
.feed-del { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 6px; display: inline-flex; }
.feed-del .ico { width: 18px; height: 18px; }
.feed-del:hover { color: var(--danger); }
.feed-empty { text-align: center; color: var(--muted); margin-top: 40px; }
.who-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; margin-left: 6px; font-weight: 600; }

/* ---------------- NAV (acrílico Fluent) ---------------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(32,32,32,.82); backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid var(--stroke-strong);
  display: flex; justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
}
.nav-btn { background: none; border: 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; flex: 1; position: relative; padding-top: 6px; }
.nav-btn .ico { width: 22px; height: 22px; }
.nav-btn span { font-size: 11px; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active::before { content: ""; position: absolute; top: 0; width: 18px; height: 3px; border-radius: 3px; background: var(--accent); }

/* ---------------- INSTALL ---------------- */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(88px + env(safe-area-inset-bottom));
  background: var(--card); border: 1px solid var(--stroke-strong); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; gap: 8px; z-index: 30;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 14px;
}
.install-banner .ico { width: 18px; height: 18px; color: var(--accent); }
.install-banner #install-btn { margin-left: auto; background: var(--accent); border: 0; color: var(--on-accent); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; }
.install-banner .x { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
