/* KickOff 2027 - estilo Samsung claro: fundo cinza, superficies brancas, azul Samsung #1428A0, acao principal em pilula preta.
   Ciano #3EC8FF e laranja #FF7A45 do logo so aparecem sobre azul ou escuro. Sora + JetBrains Mono (horarios, codigos, placares).
   Os nomes antigos (--cyan, --orange, --ok) ficam por compatibilidade: --cyan agora e o azul Samsung. */
:root {
  color-scheme: light;
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #ECEEF2;
  --line: #E1E4E9;
  --line-strong: #C5CAD3;
  --text: #0B0C0E;
  --muted: #5F6670;
  --blue: #1428A0;
  --blue-hover: #0F1F86;
  --blue-tint: #E8ECF8;
  --cyan: var(--blue);
  --orange: #C2410C;
  --orange-tint: #FDEEE6;
  --ok: #1E7F45;
  --ok-tint: #E4F3EA;
  --ink: #000000;
  --ink-hover: #2B2D31;
  --on-accent: #FFFFFF;
  --logo-cyan: #3EC8FF;
  --logo-orange: #FF7A45;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(11, 12, 14, 0.05), 0 8px 24px rgba(11, 12, 14, 0.08);
  --sans: Sora, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Icone de concluido (mesmo traco dos icones da barra), como mascara e como imagem branca. */
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --arrow-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E");
  --check-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) var(--bg); -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  caret-color: var(--blue);
}
::selection { background: var(--blue); color: var(--on-accent); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
h3 { font-size: 16px; font-weight: 600; line-height: 1.3; }
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1px; }
img { max-width: 100%; display: block; }
/* .mono ficou como nome de classe nos modulos; e uma legenda em Sora. A fonte mono fica so em horarios, codigos e placares. */
.mono { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.loading { padding: 48px 16px; text-align: center; }
.error-box { padding: 14px 16px; border: 1px solid var(--orange); border-radius: var(--radius-sm); color: var(--orange); background: var(--orange-tint); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- estrutura ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--blue); color: #FFFFFF; /* sem backdrop-filter: ele prenderia a barra inferior (position: fixed) dentro do topo */
  padding-top: env(safe-area-inset-top);
}
.topbar :focus-visible { outline-color: #FFFFFF; }
.topbar .mono, .topbar .muted { color: rgba(255, 255, 255, 0.78); }
/* Links soltos no topo azul ficam brancos; :where() zera a especificidade para as abas de cada pagina mandarem. */
.topbar :where(a:not(.btn)) { color: #FFFFFF; }
.topbar-in { max-width: 960px; margin: 0 auto; padding: 10px 16px; min-height: 58px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: #FFFFFF; text-decoration: none; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.brand img { width: 34px; height: 34px; }
.brand span { color: var(--logo-cyan); font-weight: 300; }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; color: #FFFFFF; text-decoration: none; padding: 3px 3px 3px 12px; border: 1px solid rgba(255, 255, 255, 0.32); border-radius: 999px; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.user-chip b { color: var(--logo-cyan); }
.user-chip .avatar { width: 32px; height: 32px; }
@media (max-width: 420px) { .brand { font-size: 13px; gap: 7px; } .brand img { width: 28px; height: 28px; } .topbar-in { gap: 8px; } }
@media (max-width: 359px) { .brand { font-size: 0; gap: 0; } }
.admin-link { font-family: var(--sans); font-size: 12px; font-weight: 600; color: #FFFFFF; text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 999px; padding: 6px 12px; }
.nav { display: flex; gap: 2px; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; padding: 6px 2px; flex: 1; min-width: 0; border-radius: 12px; }
.nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a svg { width: 22px; height: 22px; padding: 4px 14px; box-sizing: content-box; border-radius: 999px; transition: background-color 0.2s var(--ease); }
.nav a.on { color: var(--blue); }
main { max-width: 720px; margin: 0 auto; padding: 20px 16px 112px; display: flex; flex-direction: column; gap: 22px; }
main.wide { max-width: 960px; }
section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head a { font-weight: 600; text-decoration: none; }
@media (max-width: 859px) {
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .nav a.on svg { background: var(--blue-tint); }
}
@media (max-width: 374px) { .nav a svg { padding: 4px 8px; } }
@media (min-width: 860px) {
  .nav a { flex-direction: row; gap: 7px; font-size: 13px; padding: 8px 14px; flex: none; color: rgba(255, 255, 255, 0.78); border-radius: 999px; }
  .nav a svg { width: 18px; height: 18px; padding: 0; }
  .nav a:hover { color: #FFFFFF; }
  .nav { margin-left: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav a.on { background: rgba(255, 255, 255, 0.16); color: #FFFFFF; }
  main { padding-bottom: 56px; }
}

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid transparent; border-radius: var(--radius); padding: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1.2 var(--sans); color: var(--on-accent); background: var(--ink);
  border: 1px solid var(--ink); border-radius: 999px; padding: 12px 22px; min-height: 48px; cursor: pointer; text-decoration: none;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.blue { background: var(--blue); border-color: var(--blue); }
.btn.blue:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn.orange { background: var(--orange); border-color: var(--orange); }
.btn.danger { background: var(--surface); color: var(--orange); border-color: var(--orange); }
.btn.danger:hover { background: var(--orange-tint); }
.btn.sm { font-size: 13px; padding: 8px 16px; min-height: 40px; }
.btn.block { width: 100%; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
label[hidden] { display: none; }
input, textarea, select {
  font: 400 16px var(--sans); color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; min-height: 48px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
input::placeholder, textarea::placeholder { color: var(--muted); }
form.stack { display: flex; flex-direction: column; gap: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px; margin: -4px; scrollbar-width: none; } /* a folga deixa o contorno de foco inteiro */
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font: 600 13px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 16px; cursor: pointer; text-transform: capitalize; }
.chip:hover { border-color: var(--text); }
.chip.on { color: var(--on-accent); background: var(--blue); border-color: var(--blue); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 600 12px/1.4 var(--sans); padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; background: var(--surface-2); color: var(--muted); }
.tag.cyan { color: var(--blue); background: var(--blue-tint); }
/* "orange" ficou como nome de classe nos modulos: destaque de status (Novo, Agora) em contorno azul.
   Preto fica so para acao e laranja so para o Nivel 10 e o que pede acao. */
.tag.orange { color: var(--blue); background: var(--surface); border-color: var(--blue); }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.avatar.md { width: 44px; height: 44px; }
.avatar.lg { width: 64px; height: 64px; border: 2px solid var(--blue); }
.avatar.xl { width: 112px; height: 112px; border: 3px solid var(--blue); }
.pts { font-family: var(--mono); font-weight: 700; color: var(--blue); white-space: nowrap; font-variant-numeric: tabular-nums; }
.done-line { position: relative; padding-left: 24px; color: var(--ok); font-weight: 600; font-size: 14px; }
.done-line::before { content: ''; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--check) center / contain no-repeat; mask: var(--check) center / contain no-repeat; }
.go { font-weight: 600; font-size: 14px; color: var(--blue); white-space: nowrap; }
/* Link de voltar: seta desenhada no mesmo traco dos icones da barra. */
a.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; min-height: 40px; }
a.back::before { content: ''; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--arrow-back) center / contain no-repeat; mask: var(--arrow-back) center / contain no-repeat; }
a.back:hover { text-decoration: underline; }

#toasts { position: fixed; inset: calc(66px + env(safe-area-inset-top)) 0 auto 0; /* no topo: embaixo ficaria atras do teclado do celular */ margin: 0; border: 0; background: transparent; width: auto; height: auto; overflow: visible; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--on-accent); font-weight: 600; padding: 12px 18px; border-radius: 16px; box-shadow: var(--shadow); animation: pop 0.3s var(--ease); max-width: 480px; }
.toast.err { background: var(--orange); }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- login ---------- */
.auth { max-width: 440px; margin: 0 auto; padding: 0 16px 48px; display: flex; flex-direction: column; gap: 20px; }
.auth-hero {
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--blue); color: #FFFFFF; margin: 0 -16px; padding: calc(32px + env(safe-area-inset-top)) 20px 30px; border-radius: 0 0 28px 28px;
}
@media (min-width: 472px) { .auth { padding-top: 24px; } .auth-hero { margin: 0; border-radius: 28px; padding-top: 32px; } }
/* Respiro do guia do logo: margem livre igual ao raio do selo 10 (28px nesta largura; 8px ja vem no arquivo). */
.auth-hero .logo-hero { width: 176px; height: auto; margin-bottom: 14px; }
.auth-hero .tagline { font-weight: 800; font-size: 18px; color: var(--logo-orange); }
.auth-hero h1 { font-size: 40px; }
.auth-hero h1 span { color: var(--logo-cyan); font-weight: 300; }
.auth-hero p { color: rgba(255, 255, 255, 0.86); }
.auth-hero .muted { color: rgba(255, 255, 255, 0.86); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.tabs button { font: 600 14px var(--sans); color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 10px; min-height: 40px; cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(11, 12, 14, 0.12); }

/* ---------- inicio ---------- */
.hero-top { display: flex; align-items: center; gap: 14px; }
.hero-top .grow { flex: 1; min-width: 0; }
.hero-top h1 small { font-size: 15px; font-weight: 400; color: var(--muted); }
.level-badge { text-align: center; border: 2px solid var(--blue); border-radius: 16px; padding: 6px 12px; line-height: 1.1; }
.level-badge b { display: block; font-size: 24px; font-weight: 800; color: var(--blue); }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 18px; }
.levels .seg { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.levels .seg i { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.level-names { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.level-names .on { color: var(--blue); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stats div { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 8px; text-align: center; }
.stats b { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11px; color: var(--muted); }

/* Bloco de nivel da tela inicial: o campo azul Samsung onde o jogo aparece. */
.lvl { background: var(--blue); color: #FFFFFF; padding: 20px 18px 18px; gap: 0; }
.lvl .avatar.lg { border-color: #FFFFFF; }
.lvl h1 { font-size: 24px; }
.lvl .level-badge { border-color: rgba(255, 255, 255, 0.55); }
.lvl .level-badge b { color: var(--logo-cyan); }
.lvl .level-badge span { font-size: 11px; color: rgba(255, 255, 255, 0.8); }
.lvl .levels .seg { background: rgba(255, 255, 255, 0.2); }
.lvl .levels .seg i { background: var(--logo-cyan); transform-origin: left center; animation: lvl-fill 0.9s var(--ease) both; }
.lvl .levels .seg:nth-child(2) i { animation-delay: 0.12s; }
.lvl .levels .seg:nth-child(3) i { animation-delay: 0.24s; }
.lvl .levels .seg:nth-child(4) i { animation-delay: 0.36s; }
@keyframes lvl-fill { from { transform: scaleX(0); } }
.lvl .level-names { color: rgba(255, 255, 255, 0.66); }
.lvl .level-names .on { color: #FFFFFF; }
.lvl-next { margin-top: 10px; font-size: 13px; color: rgba(255, 255, 255, 0.86); }
.lvl .stats { gap: 0; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.lvl .stats div { background: none; border-radius: 0; padding: 0 6px; }
.lvl .stats div + div { border-left: 1px solid rgba(255, 255, 255, 0.2); }
.lvl .stats span { color: rgba(255, 255, 255, 0.78); }
.lvl :focus-visible { outline-color: #FFFFFF; }
.missions { display: flex; flex-direction: column; gap: 8px; }
.mission { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; min-height: 64px; }
a.mission:hover { border-color: var(--line-strong); }
.mission .mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; color: var(--on-accent); font-weight: 800; font-size: 14px; }
.mission.done .mark { background: var(--ok) var(--check-white) center / 16px no-repeat; border-color: var(--ok); }
.mission .grow { flex: 1; min-width: 0; }
.mission .grow b { font-weight: 600; }
.mission .grow span { display: block; font-size: 13px; color: var(--muted); }
.mission.done { opacity: 0.72; }

/* Agenda do dia na Inicio: o que ja passou recolhido, a atividade de agora em destaque e o resto numa linha do tempo. */
.dia-feito { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.dia-feito summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; font-size: 13px; color: var(--muted); cursor: pointer; list-style: none; border-radius: inherit; }
.dia-feito summary::-webkit-details-marker { display: none; }
.dia-feito summary .grow { flex: 1; min-width: 0; }
.dia-feito summary .done-line { font-size: 13px; padding-left: 20px; }
.dia-feito summary .done-line::before { width: 16px; height: 16px; top: 1px; }
.dia-feito summary:hover .go { text-decoration: underline; }
.dia-feito .go .off, .dia-feito[open] .go .on { display: none; }
.dia-feito[open] .go .off { display: inline; }
.dia-feito .dia-linha { padding: 6px 14px 14px; color: var(--muted); }
.dia-feito .dia-linha b { font-weight: 400; }
.dia-agora { border: 2px solid var(--blue); display: flex; flex-direction: column; gap: 8px; }
.dia-agora time { font-family: var(--mono); font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.dia-agora h3 { font-size: 19px; letter-spacing: -0.01em; text-wrap: balance; }
.dia-agora .meta { font-size: 13px; color: var(--muted); }
.dia-linha { list-style: none; margin: 0; padding: 0 2px; display: flex; flex-direction: column; }
.dia-linha li { display: grid; grid-template-columns: 48px 12px minmax(0, 1fr) auto; gap: 10px; align-items: start; position: relative; padding-bottom: 14px; }
.dia-linha li:last-child { padding-bottom: 0; }
/* Fio da linha do tempo: liga o ponto de um horario ao do seguinte. */
.dia-linha li:not(:last-child)::after { content: ''; position: absolute; left: 63px; top: 10px; bottom: -10px; width: 2px; background: var(--line-strong); }
.dia-linha time { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.dia-linha .dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--bg); position: relative; z-index: 1; }
.dia-linha li.next .dot { border-color: var(--blue); background: var(--blue); }
.dia-linha b { display: block; font-weight: 600; line-height: 1.3; }
.dia-linha li.geral b { font-weight: 400; }
.dia-linha .sub { display: block; font-size: 13px; color: var(--muted); }
.dia-linha .pts { line-height: 1.3; }
.dia-ok { width: 20px; height: 20px; border-radius: 50%; background: var(--ok) var(--check-white) center / 13px no-repeat; }

/* ---------- agenda ---------- */
.slot { display: grid; grid-template-columns: 50px 1fr; gap: 10px; }
.slot-time { text-align: right; padding-top: 16px; font-family: var(--mono); line-height: 1.3; font-variant-numeric: tabular-nums; }
.slot-time b { display: block; font-size: 15px; }
.slot-time span { font-size: 12px; color: var(--muted); }
.slot .card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.slot.now .card { border: 2px solid var(--blue); }
.slot.now .slot-time b { color: var(--blue); }
.slot.geral .card { background: transparent; border: 1px dashed var(--line-strong); }
.slot .meta { font-size: 13px; color: var(--muted); }
.checkin { display: flex; gap: 8px; margin-top: 4px; }
.checkin input { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em; min-width: 0; }
.checkin input::placeholder { font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; }
.checkin .btn { flex: none; min-height: 48px; }

/* ---------- ranking ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; align-items: end; }
.podium .p { background: var(--surface); border: 1px solid transparent; border-radius: var(--radius); padding: 14px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.podium .p1 { background: var(--blue); color: #FFFFFF; padding-top: 22px; padding-bottom: 22px; }
.podium .p .avatar { width: 56px; height: 56px; }
.podium .p1 .avatar { width: 72px; height: 72px; border: 2px solid #FFFFFF; }
.podium .pos { font-family: var(--mono); font-weight: 700; color: var(--blue); }
.podium .p1 .pos, .podium .p1 .pts { color: var(--logo-cyan); }
.podium .name { font-weight: 600; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-sm); }
.rank-row.me, .podium .p.me { box-shadow: inset 0 0 0 2px var(--blue); }
.podium .p1.me { box-shadow: inset 0 0 0 2px var(--logo-cyan); }
.rank-row .pos { width: 30px; font-family: var(--mono); font-weight: 700; color: var(--muted); }
.rank-row .grow { flex: 1; min-width: 0; }
.rank-row .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .grow span { font-size: 12px; color: var(--muted); }

/* Fechamento de hora em hora: a linha do relogio fica colada aos filtros de dia. */
.rk-clock { display: flex; align-items: center; gap: 8px; margin-top: -10px; font-size: 13px; color: var(--muted); }
.rk-clock svg { width: 16px; height: 16px; flex: none; color: var(--blue); }
.rk-clock b { font: 700 13px var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.rk-jump { font: 600 13px var(--sans); color: var(--blue); background: var(--blue-tint); border: 0; border-radius: 999px; padding: 0 14px; min-height: 40px; cursor: pointer; white-space: nowrap; transition: background-color 0.15s var(--ease); }
.rk-jump:hover { background: #DCE2F4; }

/* Posicao com o movimento desde o fechamento anterior logo abaixo. */
.rank-row .pos, .team-row .pos { width: 38px; flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-family: var(--mono); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rk-move { display: inline-flex; align-items: center; gap: 1px; font: 700 11px/1 var(--mono); font-variant-numeric: tabular-nums; border-radius: 999px; padding: 3px 6px 3px 3px; white-space: nowrap; }
.rk-move svg { width: 11px; height: 11px; stroke-width: 3; }
.rk-move.up { color: var(--ok); background: var(--ok-tint); }
.rk-move.down { color: var(--muted); background: var(--surface-2); }
.rk-move.new { color: var(--blue); background: var(--blue-tint); font: 700 10px/1 var(--sans); padding: 3px 6px; }
.podium .p .rk-move { margin-top: 2px; }
.rk-mine .rk-move, .podium .p1 .rk-move { color: #FFFFFF; background: rgba(255, 255, 255, 0.16); }
.rk-mine .rk-move.up, .podium .p1 .rk-move.up { color: var(--logo-cyan); }

/* Equipes: um painel unico com as 20 linhas e a barra de XP relativa ao lider. */
.team-list { list-style: none; margin: 0; padding: 4px 0; background: var(--surface); border-radius: var(--radius); }
.team-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.team-row + .team-row { border-top: 1px solid var(--line); }
.team-row:nth-child(-n+3) .pos { color: var(--blue); }
.team-row.me { background: var(--blue-tint); border-top-color: transparent; }
.team-row.me + .team-row { border-top-color: transparent; }
.team-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.team-row .grow b { display: flex; align-items: baseline; gap: 8px; font-weight: 600; min-width: 0; }
.team-row .grow b .muted { font-weight: 400; font-size: 13px; white-space: nowrap; }
.team-row .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-sub { font: 400 12px var(--sans); color: var(--muted); white-space: nowrap; margin-left: auto; }
.team-bar { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.team-bar i { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.team-row .pts { min-width: 72px; text-align: right; }

/* Sua equipe: o mesmo campo azul do bloco de nivel da tela inicial. */
.rk-mine { background: var(--blue); color: #FFFFFF; border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.rk-mine-top { display: flex; align-items: center; gap: 12px; }
.rk-mine-top .grow { flex: 1; min-width: 0; }
.rk-mine-name { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; overflow-wrap: anywhere; }
.rk-mine-top .grow span { font-size: 13px; color: rgba(255, 255, 255, 0.8); }
.rk-mine-pos { flex: none; text-align: center; border: 2px solid rgba(255, 255, 255, 0.55); border-radius: 16px; padding: 6px 12px; line-height: 1.1; }
.rk-mine-pos b { display: block; font-size: 24px; font-weight: 800; color: var(--logo-cyan); font-variant-numeric: tabular-nums; }
.rk-mine-pos span { font-size: 11px; color: rgba(255, 255, 255, 0.8); }
.rk-mine-pts { display: flex; align-items: center; gap: 4px; font-size: 14px; color: rgba(255, 255, 255, 0.8); }
.rk-mine-pts b { font: 700 22px var(--mono); color: #FFFFFF; font-variant-numeric: tabular-nums; }
.rk-mine-pts .rk-move { margin-left: 6px; }
.rk-mine-gap { margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 13px; color: rgba(255, 255, 255, 0.88); }
.rk-mine-gap b { color: #FFFFFF; font-family: var(--mono); }
.rk-mine a, .rk-mine :focus-visible { outline-color: #FFFFFF; }

/* ---------- hotel ---------- */
#mapa { scroll-margin-top: 76px; }
.map-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #F6F5F2; }
.map-inner { position: relative; }
.map-wrap.zoom .map-inner { width: 220%; }
.map-inner img { width: 100%; }
.pin { position: absolute; transform: translate(-50%, -100%); width: 30px; height: 38px; display: grid; place-items: start center; pointer-events: none; }
.pin i { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--orange); border: 2px solid #FFFFFF; box-shadow: 0 2px 6px rgba(11, 12, 14, 0.35); display: block; }
.pin b { position: absolute; top: 5px; font: 700 13px var(--mono); color: #FFFFFF; }
.room-pin { position: absolute; transform: translate(-50%, -9px); display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
.room-pin i { width: 14px; height: 14px; border-radius: 50%; background: var(--blue); border: 2px solid #FFFFFF; box-shadow: 0 1px 4px rgba(11, 12, 14, 0.4); display: block; }
.room-pin b { font: 700 11px var(--sans); color: var(--text); background: rgba(255, 255, 255, 0.94); border-radius: 6px; padding: 1px 6px; white-space: nowrap; box-shadow: 0 1px 3px rgba(11, 12, 14, 0.18); }
/* Perto das bordas o rotulo abre para dentro do mapa. */
.room-pin.r { align-items: flex-end; transform: translate(calc(-100% + 9px), -9px); }
.room-pin.l { align-items: flex-start; transform: translate(-9px, -9px); }
.room-pin.focus i { width: 20px; height: 20px; box-shadow: 0 0 0 6px rgba(20, 40, 160, 0.35); animation: ping 1.4s ease-in-out infinite; }
.room-pin.focus b { background: var(--blue); color: #FFFFFF; font-size: 12px; }
@keyframes ping { 50% { box-shadow: 0 0 0 14px rgba(20, 40, 160, 0.1); } }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 8px; vertical-align: baseline; }
.legend:first-child { margin-left: 0; }
.legend.pin-dot { background: var(--orange); }
.legend.room-dot { background: var(--blue); }
.num { width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: #FFFFFF; font: 700 13px var(--mono); display: grid; place-items: center; flex: none; }
.point { display: flex; flex-direction: column; gap: 8px; }
.point-head { display: flex; gap: 10px; align-items: flex-start; }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (min-width: 700px) { .places { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.place { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.place img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.place div { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- enquetes ---------- */
.poll { display: flex; flex-direction: column; gap: 12px; }
.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.options.plain { grid-template-columns: 1fr; }
.option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 12px; background: var(--bg); border: 2px solid transparent; border-radius: var(--radius-sm); cursor: pointer; color: var(--text); font-size: 14px; font-weight: 600; }
.option:hover { border-color: var(--line-strong); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option:has(input:checked) { border-color: var(--blue); background: var(--blue-tint); }
.option:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
/* As artes de logo sao feitas para o cinza da camisa (guia do logo): ficam sobre ele tambem no site claro. */
.option img { width: 100%; max-width: 150px; aspect-ratio: 6 / 5; object-fit: contain; background: #35383D; border-radius: 10px; padding: 6px; }
.result { display: flex; flex-direction: column; gap: 5px; }
.result-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--line-strong); border-radius: 999px; }
.result.mine .bar i { background: var(--blue); }

/* ---------- nps ---------- */
.nps-scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; }
.nps-scale label { position: relative; display: grid; place-items: center; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; font: 700 14px var(--mono); color: var(--text); cursor: pointer; background: var(--surface); }
.nps-scale input { position: absolute; opacity: 0; pointer-events: none; }
.nps-scale label:has(input:checked) { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.nps-scale label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.nps-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---------- perfil ---------- */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.avatar-grid button { padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; overflow: hidden; aspect-ratio: 1; }
.avatar-grid button.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-tint); }
.avatar-grid img { width: 100%; height: 100%; }
@media (max-width: 520px) { .avatar-grid { grid-template-columns: repeat(4, 1fr); } }
.history { display: flex; flex-direction: column; }
.history div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.history div:last-child { border-bottom: 0; }
.history span { display: block; font-size: 12px; color: var(--muted); }

/* ---------- admin ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.kpi { background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 14px; }
.kpi b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-sm); flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 180px; }
.row .grow span { display: block; font-size: 12px; color: var(--muted); }
.row .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.code { font-family: var(--mono); font-weight: 700; letter-spacing: 0.14em; color: var(--orange); background: var(--orange-tint); border: 1px dashed var(--orange); border-radius: 8px; padding: 4px 8px; }
.list { display: flex; flex-direction: column; gap: 8px; }
dialog { background: var(--surface); color: var(--text); border: 0; border-radius: 24px; padding: 22px 20px 20px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(11, 12, 14, 0.5); }
dialog h2 { margin-bottom: 14px; }
/* No celular o dialogo vira folha inferior, ao alcance do polegar. */
@media (max-width: 599px) {
  dialog[open] { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 24px 24px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); animation: sheet 0.32s var(--ease); }
  @keyframes sheet { from { transform: translateY(24px); opacity: 0.6; } }
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
@media (max-width: 599px) { .dialog-actions .btn { flex: 1; } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.pin-picker { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: crosshair; background: #F6F5F2; }
.pin-picker[hidden], .pin-hint[hidden] { display: none; }
.pin-picker img { width: 100%; }
.opt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nps-score { font-size: 56px; font-weight: 800; line-height: 1; color: var(--blue); }
.dist { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; align-items: end; height: 110px; }
.dist div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.dist i { display: block; width: 100%; background: var(--line-strong); border-radius: 4px 4px 0 0; min-height: 2px; }
.dist .pro i { background: var(--blue); }
.dist .det i { background: var(--orange); }

/* ---------- check-in por QR ---------- */
.checkin-body { margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.checkin-big { font-size: 44px; font-weight: 800; color: var(--blue); line-height: 1; font-variant-numeric: tabular-nums; }
img.qr { width: min(260px, 70vw); margin: 4px auto 12px; background: #fff; border-radius: 12px; padding: 10px; border: 1px solid var(--line); }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
label.check input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--blue); }
.dialog-actions { flex-wrap: wrap; }

/* ---------- ajustes da revisao: toque, teclado e leitor de tela ---------- */
.chip, .btn.sm { min-height: 40px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
label.btn { position: relative; color: var(--on-accent); }
label.btn:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
h1[tabindex="-1"]:focus { outline: none; }
@supports (height: 100dvh) { dialog { max-height: calc(100dvh - 24px); } }
@media (max-width: 520px) {
  .nps-scale { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .nps-scale label { min-height: 44px; }
}
button.room-pin { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; pointer-events: auto; font: inherit; }
button.room-pin::before { content: ''; position: absolute; left: 50%; top: 9px; width: 40px; height: 40px; transform: translate(-50%, -50%); }
.room-pin.r::before { left: auto; right: -11px; transform: translate(0, -50%); }
.room-pin.l::before { left: -11px; transform: translate(0, -50%); }
.room-pin.focus, .room-pin.show { z-index: 3; }
.map-inner.dense .room-pin:not(.focus):not(.show) b { display: none; }

/* ---------- tela escura: teloes projetados e palcos de jogo ----------
   Use data-theme="tela" no <html> (telao) ou a classe .tela num bloco. Fundo preto-azulado Samsung;
   ai o ciano e o laranja do logo voltam a ser as cores de destaque e o texto sobre eles fica escuro.
   .n-graph/.n-wall (rede.js) e .s-full (cobrinha) sao telas escuras de equipamento dentro do site claro. */
[data-theme="tela"], .tela, .n-graph, .n-wall, .s-full {
  color-scheme: dark;
  --bg: #060914;
  --surface: #10162E;
  --surface-2: #19213F;
  --line: #2A3358;
  --line-strong: #3B4675;
  --text: #FFFFFF;
  --muted: #A9B2CF;
  --blue: var(--logo-cyan);
  --blue-hover: #6FD6FF;
  --blue-tint: rgba(62, 200, 255, 0.14);
  --cyan: var(--blue);
  --orange: var(--logo-orange);
  --orange-tint: rgba(255, 122, 69, 0.14);
  --ok: #5FD38D;
  --ok-tint: rgba(95, 211, 141, 0.14);
  --ink: #FFFFFF;
  --ink-hover: #E3E7F2;
  --on-accent: #0B0C0E;
  color: var(--text);
}
[data-theme="tela"] body { background: var(--bg); }
[data-theme="tela"] .btn, .tela .btn { color: var(--on-accent); }
[data-theme="tela"] .btn.ghost, .tela .btn.ghost { color: var(--text); background: transparent; border-color: var(--line-strong); }
[data-theme="tela"] .topbar { background: var(--bg); border-bottom: 1px solid var(--line); }
