/* Janelas "penduradas": perfil, edição, prêmio de marco e configurações.
   O cartão desce de um fio, balança um pouco e para. */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hang-overlay {
  z-index: 80; /* acima do botão do perfil (70) e da tela inicial (60) */
  align-items: flex-start;
  padding: clamp(70px, 13vh, 150px) 14px 24px;
  background: rgba(20, 10, 14, 0.62);
  overflow-y: auto;
}
.milestone-overlay { z-index: 90; }

.hang-card {
  position: relative;
  width: min(100%, 360px);
  margin: 0 auto;
  background: var(--card);
  color: var(--text);
  border-radius: 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transform-origin: 50% -60px; /* balança preso ao fio */
  transform: translateY(-50px) rotate(-3deg);
  transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.overlay.show .hang-card { transform: none; animation: hang-swing 1.2s ease-out; }
@keyframes hang-swing {
  0% { transform: translateY(-50px) rotate(-3deg); }
  35% { transform: rotate(2deg); }
  65% { transform: rotate(-1deg); }
  100% { transform: rotate(0); }
}
/* O fio: sobe até o topo da tela, com um nó onde prende no cartão */
.hang-card::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: 4px;
  height: 100vh;
  margin-left: -2px;
  border-radius: 2px;
  background: linear-gradient(#d2ad72, #8a6a3e);
}
.hang-card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -11px;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe9b0, #c89a4e);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.hang-close, .hang-back {
  position: absolute;
  top: -14px;
  z-index: 3;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.hang-close { right: -10px; background: #e5484d; }
.hang-back { left: -10px; background: var(--accent); font-size: 1.5rem; padding-bottom: 3px; }
.hang-close:active, .hang-back:active { transform: scale(0.92); }

/* Cabeçalho: céu da noite com o avatar e o nome */
.hang-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 18px 16px;
  border-radius: 26px 26px 0 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 226, 138, 0.35), transparent 42%),
    radial-gradient(circle at 88% 70%, rgba(255, 150, 160, 0.25), transparent 40%),
    linear-gradient(180deg, #43263a, #7a3a50);
  color: #fff4e6;
}
.hang-who { flex: 1; min-width: 0; }
.hang-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hang-sub { min-height: 1.3em; margin: 2px 0 8px; font-size: 0.85rem; opacity: 0.88; }
.hang-banner {
  margin: 0;
  padding: 24px 16px 4px;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  color: var(--accent-dark);
}

.hang-panel { padding: 8px 16px 18px; }
.hang-panel h3 { margin: 14px 0 6px; font-family: var(--font-title); font-size: 1rem; font-weight: 600; color: var(--accent-dark); }

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--card-soft);
  font-size: 0.92rem;
}
.stat-icon { width: 1.4em; text-align: center; }
.stat-name { flex: 1; }
.stat-row b { font-variant-numeric: tabular-nums; }

/* Dica da primeira visita, no pé do cartão */
.hang-tip {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: #fff2cf;
  color: #5c3a2a;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.hang-tip[hidden] { display: none; }
.hang-tip p { margin: 0 0 10px; font-weight: 600; line-height: 1.35; color: inherit; }
/* Foco da dica: o cartão escurece, e só o alvo fica por cima, claro e brilhando */
.tour-dim {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 26px;
  background: rgba(18, 8, 28, 0.68);
  animation: dim-in 0.25s ease-out;
}
.tour-dim[hidden] { display: none; }
.tour-dim.light { background: rgba(18, 8, 28, 0.38); }
@keyframes dim-in { from { opacity: 0; } }
.tour-spot {
  position: relative;
  z-index: 3;
  animation: spot 0.9s ease-in-out infinite alternate;
}
@keyframes spot {
  from { box-shadow: 0 0 0 3px rgba(255, 226, 138, 0.55), 0 0 16px 4px rgba(255, 226, 138, 0.4); }
  to { box-shadow: 0 0 0 4px #ffe28a, 0 0 28px 10px rgba(255, 226, 138, 0.75); }
}

/* ---------- Edição ---------- */
.pf-input {
  width: 100%;
  padding: 8px 14px;
  border: 3px solid #8fd0ff;
  border-radius: 999px;
  background: #fff;
  color: #2a1a20;
  font: inherit;
  font-size: 1rem; /* 16px ou mais, para o iPhone não ampliar a tela */
  font-weight: 700;
  text-align: center;
}
.pf-input:focus { outline: none; border-color: #3a7bd5; }
.pf-input.invalid { border-color: #e5484d; }
.pf-counter, .pf-rule { margin: 4px 0 0; font-size: 0.72rem; text-align: center; opacity: 0.9; }
.pf-rule { margin-top: 0; opacity: 0.75; }
.pf-input.invalid ~ .pf-counter { color: #ffb3b6; opacity: 1; font-weight: 700; }

.pf-tabs { display: flex; gap: 6px; margin: 8px 0 12px; }
.pf-tabs button {
  flex: 1;
  padding: 9px 6px;
  border: 0;
  border-radius: 14px;
  background: var(--card-soft);
  color: var(--muted);
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.pf-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }

.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pf-opt {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 18px;
  background: var(--card-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pf-opt:active { transform: scale(0.95); }
.pf-opt-art { display: grid; place-items: center; --avatar: 54px; }
.pf-opt-art .profile-frame { --avatar: 42px; }
.pf-opt.selected { border-color: #3fbf6f; }
.pf-opt.selected::after {
  content: "✓";
  position: absolute;
  right: -7px;
  bottom: -7px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3fbf6f;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}
.pf-opt.locked .pf-opt-art { opacity: 0.4; filter: grayscale(0.5); }
.pf-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  font-size: 1.3rem;
}
.pf-lock small { font-size: 0.62rem; font-weight: 800; color: var(--text); }

/* ---------- Prêmio de marco ---------- */
.ms-body { text-align: center; }
.ms-body p { margin: 0 0 6px; color: var(--text); line-height: 1.4; }
.ms-now { font-size: 0.85rem; color: var(--muted) !important; }
.ms-locked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #f6e3b0;
  color: #5c3a2a;
  font-weight: 700;
}

.ms-equip { display: block; width: 100%; min-width: 0; margin-top: 12px; font-family: var(--font-title); font-size: 1.4rem; font-weight: 700; }
.ms-equip[hidden], .ms-locked[hidden] { display: none; }

/* ---------- Configurações ---------- */
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1;
  padding: 10px 8px;
  border: 3px solid transparent;
  border-radius: 14px;
  background: var(--card-soft);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--card); box-shadow: var(--shadow); }
.st-help { margin: 0 0 10px; font-size: 0.85rem; line-height: 1.4; color: var(--muted); }
.st-msg { min-height: 1.2em; margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); }
.st-error { color: #d62839; }
.st-toggle {
  display: block;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Login ---------- */
.lg-label { display: block; margin: 12px 0 6px; font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.lg-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--card-soft);
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* 16px ou mais, para o iPhone não ampliar a tela */
}
.lg-input:focus { outline: none; border-color: var(--accent); }
.lg-pass { position: relative; }
.lg-pass .lg-input { padding-right: 84px; }
.lg-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.lg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.lg-who { margin: 0 0 6px; word-break: break-all; font-size: 1.05rem; }
.lg-error { color: #d62839; }
.lg-ok { color: #1f8a4c; font-weight: 600; }
#login-dialog [hidden] { display: none !important; }
#login-dialog button:disabled, #login-dialog input:disabled { opacity: 0.55; cursor: progress; }

/* ---------- Cartão de início da fase ---------- */
.level-card .hang-panel { padding-top: 4px; }
.lv-hard {
  width: fit-content;
  margin: 6px auto 0;
  padding: 3px 14px;
  border-radius: 999px;
  background: #7b4bd1;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}
.lv-hard[hidden], .lv-best[hidden], .lv-gate[hidden] { display: none; }
.lv-goal { margin: 8px 0 4px; text-align: center; font-size: 0.9rem; line-height: 1.4; color: var(--muted); }
#lv-stars .stat-icon { width: 3.1em; color: #f2b705; font-weight: 800; letter-spacing: 1px; text-align: left; }
#lv-stars .stat-name { font-size: 0.9rem; }
.lv-best { margin: 10px 0 0; text-align: center; font-weight: 700; color: var(--accent-dark); }
.lv-gate {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(123, 75, 209, 0.12);
  font-size: 0.85rem;
  line-height: 1.4;
}
.lv-hints { margin-top: 12px; }
.level-card .btn-play { display: block; width: 100%; min-width: 0; margin-top: 16px; font-family: var(--font-title); font-size: 1.7rem; font-weight: 700; }

/* ---------- Corrida e loja ---------- */
.map-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.race-chip {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: #7b4bd1;
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.race-chip.gold-chip { background: #d99a12; }
.race-chip[hidden], #btn-lose-extra[hidden], #race-giveup[hidden], .lv-race[hidden] { display: none; }
.game-race { display: block; margin: 0 auto 8px; }
body:not([data-screen="game"]) .game-race { display: none; }
.lv-race { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(217, 154, 18, 0.16); font-size: 0.88rem; line-height: 1.4; text-align: center; }
.lv-race p { margin: 0 0 8px; }
.lv-race .btn { width: 100%; }
.race-rows { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.race-row { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.06); }
.race-row.mine { background: rgba(217, 154, 18, 0.28); font-weight: 800; }
.race-pos { width: 1.4em; text-align: center; font-weight: 800; }
.race-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-val { font-variant-numeric: tabular-nums; }
.shop-balance { margin: 8px 0; text-align: center; font-size: 1.05rem; }
.shop-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.shop-icon { font-size: 1.6rem; }
.shop-info { flex: 1; display: grid; }
.shop-info small { color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.shop-item.soon { opacity: 0.55; }
.shop-buy { min-width: 74px; }

#ri-ask .btn { display: block; width: 100%; margin-top: 8px; }
#ri-search[hidden] { display: none; }
.ri-count { margin: 8px 0; text-align: center; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ri-bar { height: 10px; border-radius: 99px; background: rgba(0,0,0,0.1); overflow: hidden; }
.ri-bar i { display: block; height: 100%; width: 10%; background: #d99a12; transition: width 0.5s; }

/* Loja: pílula discreta no canto, logo abaixo dos botões de início e tema */
.map-shop {
  position: relative;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.map-shop:active { transform: scale(0.94); }
body:not([data-screen="map"]) .map-shop { display: none; }

.map-shop { display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 10px; }
.map-shop .shop-line, .map-shop .shop-awn { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-shop .shop-awn { fill: #ffcf5c; }
.map-shop .shop-coin { fill: #e0a82e; filter: drop-shadow(0 0 2px rgba(255, 207, 92, 0.9)); }

/* ---------- Tela da loja ---------- */
.shop-screen[hidden] { display: none; }
.shop-back { display: grid; }
.shop-screen .shop-wallet { font-size: 1.05rem; }
.shop-screen-items { max-width: 420px; margin: 18px auto 0; padding: 4px 14px 14px; border-radius: 22px; background: var(--card); color: var(--ink, inherit); box-shadow: var(--shadow); }
.shop-screen-items h3 { margin: 14px 0 2px; font-family: var(--font-title); font-size: 1.1rem; font-weight: 600; color: var(--accent-dark); }
.shop-note { margin: 14px 0 4px; text-align: center; font-size: 0.8rem; color: var(--muted); }

/* A loja é uma área inteira sobre o campo à noite (sem cartão branco): seções com títulos e peças grandes */
.shop-screen { padding: 16px 16px 48px; min-height: 100vh; }
.shop-screen-items { max-width: 460px; margin: 22px auto 0; padding: 0; background: none; box-shadow: none; }
.shop-screen-items h3 { margin: 22px 4px 8px; font-size: 1.25rem; color: #ffd98a; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.shop-screen-items .shop-item {
  gap: 14px;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 226, 150, 0.22);
  border-radius: 20px;
  background: rgba(24, 12, 16, 0.55);
  color: #fff4e6;
  backdrop-filter: blur(4px);
}
.shop-screen-items .shop-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 207, 92, 0.16); font-size: 2rem; }
.shop-screen-items .shop-info b { font-size: 1.1rem; }
.shop-screen-items .shop-info small { color: rgba(255, 244, 230, 0.75); font-size: 0.82rem; }
.shop-screen-items .shop-item.soon { opacity: 0.6; }
.shop-screen-items .shop-item em { color: rgba(255, 244, 230, 0.7); }
.shop-screen-items .shop-buy { min-width: 84px; font-size: 1rem; }
.shop-screen-items .shop-note { color: rgba(255, 244, 230, 0.7); }

/* Pacotes de Lumes (prévia, só com ?vendas=1): três cartões lado a lado, o do meio e o da direita com faixa e borda dourada */
.lumes-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 10px; }
.lumes-pack {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 0; padding: 18px 6px 10px;
  border: 1px solid rgba(255, 226, 150, 0.22); border-radius: 20px;
  background: rgba(24, 12, 16, 0.55); color: #fff4e6;
  font: inherit; cursor: pointer; backdrop-filter: blur(4px);
  transition: transform 0.12s;
}
.lumes-pack:active { transform: scale(0.96); }
.lumes-pack.featured {
  border: 2px solid #ffcf5c;
  background: linear-gradient(180deg, rgba(255, 207, 92, 0.22), rgba(24, 12, 16, 0.6) 70%);
  box-shadow: 0 0 18px rgba(255, 207, 92, 0.35);
}
.lp-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  padding: 2px 9px; border-radius: 99px; white-space: nowrap;
  background: linear-gradient(180deg, #ff8a5c, #e5484d); color: #fff;
  font-size: 0.68rem; font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.lp-coins { display: flex; justify-content: center; height: 2.6rem; align-items: flex-end; font-size: 2rem; }
.lp-coins .gold { margin: 0 -0.32em; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.lp-coins .gold:nth-child(2) { transform: translateY(-0.28em); }
.lp-amount { margin-top: 4px; font-family: var(--font-title); font-size: 1.45rem; font-weight: 600; line-height: 1; color: #ffd98a; }
.lumes-pack small { font-size: 0.78rem; color: rgba(255, 244, 230, 0.75); }
.lumes-pack small em { font-style: normal; font-weight: 700; color: #7ee08a; }
.lp-price {
  margin-top: 8px; padding: 6px 4px; width: 100%; border-radius: 12px;
  background: linear-gradient(180deg, #ffe08a, #e0a82e); color: #4a2a06;
  font-weight: 800; font-size: 0.92rem; box-shadow: inset 0 -2px 0 rgba(120, 70, 0, 0.35);
}
.shop-note.flash { animation: lp-flash 0.6s; color: #ffd98a; }
@keyframes lp-flash { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .shop-note.flash { animation: none; } }

/* Grade de skins: 2 colunas, avatar grande e o nome embaixo (o vagalume precisa ser bem visível para escolher) */
.pf-grid.avatars { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pf-grid.avatars .pf-opt { aspect-ratio: auto; padding: 12px 6px 8px; gap: 4px; }
.pf-grid.avatars .pf-opt-art { --avatar: min(112px, 34vw); }
.pf-grid.avatars .avatar-fly { width: 96%; height: 96%; }
.pf-opt-name { font-family: var(--font-title); font-size: 0.95rem; font-weight: 600; color: var(--accent-dark); }
.pf-opt-name:empty { display: none; }
.pf-grid.avatars .pf-lock { top: 38%; }

/* Skins bloqueadas: a prévia fica viva (cores e asas batendo) e só não dá para escolher; o cadeado vira uma etiqueta no canto */
.pf-grid.avatars .pf-opt.locked .pf-opt-art { opacity: 1; filter: none; }
.pf-grid.avatars .avatar-fly .skin-wing.l { animation: flutter-l 0.32s ease-in-out infinite alternate; }
.pf-grid.avatars .avatar-fly .skin-glow { animation: skin-glow 1.6s ease-in-out infinite alternate; }
.pf-grid.avatars .pf-opt.locked { cursor: default; }
.pf-grid.avatars .pf-lock {
  inset: auto;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(30, 14, 20, 0.78);
  color: #fff4e6;
  font-size: 0.8rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.pf-grid.avatars .pf-lock small { font-size: 0.72rem; font-weight: 700; color: #ffe9b8; }
@media (prefers-reduced-motion: reduce) { .pf-grid.avatars .avatar-fly .skin-wing.l, .pf-grid.avatars .avatar-fly .skin-glow { animation: none; } }

/* Grade de molduras: igual à de skins (2 colunas, grande, com nome e prévia viva mesmo bloqueada) */
.pf-grid.frames { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pf-grid.frames .pf-opt { aspect-ratio: auto; padding: 30px 6px 12px; gap: 12px; align-content: start; }
.pf-grid.frames .pf-opt-art .profile-frame { --avatar: min(88px, 26vw); }
.pf-grid.frames .pf-opt.locked .pf-opt-art { opacity: 1; filter: none; }
/* molduras de líder: o hexágono e o brilho passam do avatar, então o nome desce um pouco e fica em creme, legível sobre o brilho */
/* nomes (molduras e avatares): em creme com sombra, sempre legíveis; nas molduras o nome desce mais porque o desenho passa do avatar */
.pf-grid.frames .pf-opt { gap: 28px; }
.pf-grid.frames .pf-opt .pf-opt-name, .pf-grid.avatars .pf-opt .pf-opt-name { color: #ffe9b8; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.pf-grid.avatars .pf-opt { gap: 8px; }
.pf-grid.frames .pf-opt.locked { cursor: default; }
.pf-grid.frames .pf-lock {
  position: static;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: -6px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(30, 14, 20, 0.85);
  color: #fff4e6;
  font-size: 0.8rem;
  text-align: center;
}
.pf-grid.frames .pf-lock small { font-size: 0.7rem; font-weight: 700; color: #ffe9b8; }

/* Desafio do dia */
/* Botão do ranking: fixo na borda esquerda, no meio da tela do mapa, com a contagem até o ranking recomeçar */
.rank-side { position: fixed; left: 6px; top: 48%; z-index: 5; display: grid; justify-items: center; gap: 3px; width: 64px; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rank-side[hidden] { display: none; }
.rank-podium { display: block; width: 64px; height: 48px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); transition: transform 0.15s; }
.rank-side:active .rank-podium { transform: scale(0.92); }
.rank-podium svg { display: block; width: 100%; height: 100%; }
.rank-clock { padding: 1px 8px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(20, 14, 18, 0.8); color: #fff; font: 800 11px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
/* Ranking do dia */
.rk-panel { text-align: center; }
.rk-time { margin: 0 0 6px; }
.rk-time span { display: inline-block; padding: 2px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.12); font-weight: 800; font-variant-numeric: tabular-nums; }
.rk-podium { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 8px 0 10px; }
.rk-pod { position: relative; display: grid; justify-items: center; gap: 2px; flex: 1; padding: 8px 4px 6px; border-radius: 14px 14px 6px 6px; min-width: 0; }
.rk-pod.first { padding-top: 14px; padding-bottom: 12px; background: linear-gradient(#ffe27a55, #ffb34722); }
.rk-pod.second { background: linear-gradient(#b8c4d855, #b8c4d822); }
.rk-pod.third { background: linear-gradient(#e0925a55, #e0925a22); }
.rk-pod.mine { box-shadow: 0 0 0 2px #ffb347; }
.rk-pod.empty { min-height: 70px; opacity: 0.4; }
.rk-medal { display: grid; place-items: center; width: 22px; height: 22px; margin-top: -6px; border-radius: 50%; font-size: 0.8rem; font-weight: 900; color: #3a2a10; background: #ffd34a; }
.second .rk-medal { background: #c9d3e0; }
.third .rk-medal { background: #e0925a; }
.rk-pname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; }
.rk-ppts { font-weight: 900; color: #e07a1e; }
.rk-ago { font-size: 0.62rem; color: var(--muted); }
.rk-list { display: grid; gap: 4px; margin: 0; padding: 3px; list-style: none; max-height: 34vh; overflow-y: auto; }
.rk-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 12px; background: rgba(0, 0, 0, 0.08); text-align: left; }
.rk-row.mine { background: rgba(255, 179, 71, 0.35); box-shadow: 0 0 0 2px #ffb347; }
.rk-pos { min-width: 24px; font-weight: 900; text-align: center; color: var(--muted); }
.rk-who { display: grid; flex: 1; min-width: 0; line-height: 1.1; }
.rk-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-who small { font-size: 0.65rem; color: var(--muted); }
.rk-pts { color: #e07a1e; font-variant-numeric: tabular-nums; }
.rk-gap { text-align: center; color: var(--muted); line-height: 0.8; }
.rk-top { margin: 10px 0 0; font-weight: 700; }
.rk-play { display: block; width: 100%; margin: 10px 0 4px; }

/* Entrar | Criar conta */
#lg-tabs { margin-bottom: 10px; }
#lg-tabs button { flex: 1; }
#lg-tabs button[aria-selected="true"] { border-color: var(--accent); background: var(--card); box-shadow: var(--shadow); }
#lg-confirm-wrap[hidden], #lg-forgot[hidden] { display: none; }

/* Sequência diária */
/* A sequência diária fica logo abaixo do perfil, no canto de cima à esquerda do mapa (pedido do dono) */
.streak-chip { background: #5a4038; }
body[data-screen="map"] #btn-streak { position: fixed; z-index: 65; left: 14px; top: calc(max(20px, env(safe-area-inset-top)) + 88px); }
.streak-chip.lit { background: #d9631e; }
.streak-chip:not(.lit) .flame { filter: grayscale(1) opacity(0.6); }
.streak-chip.gift { animation: sk-pulse 1.3s ease-in-out infinite; }
@keyframes sk-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(0,0,0,.3); } 50% { transform: scale(1.1); box-shadow: 0 0 14px rgba(255,200,80,.9); } }
.sk-panel { text-align: center; }
.sk-flame { width: 70px; height: 88px; margin: 4px auto 0; filter: grayscale(1) opacity(0.5); }
.sk-flame.lit { filter: drop-shadow(0 0 10px rgba(255, 150, 40, 0.85)); animation: sk-flame 1.6s ease-in-out infinite alternate; }
.sk-flame svg { width: 100%; height: 100%; }
@keyframes sk-flame { from { transform: scale(1) rotate(-2deg); } to { transform: scale(1.06) rotate(2deg); } }
.sk-big { margin: -4px 0 0; font-family: var(--font-title); font-size: 3rem; font-weight: 700; color: #e07a1e; line-height: 1; }
.sk-sub { margin: 0; font-weight: 800; color: #e07a1e; }
.sk-best { display: inline-block; margin: 8px 0 12px; padding: 3px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.08); font-size: 0.85rem; font-weight: 700; }
.sk-week { display: flex; justify-content: space-between; gap: 4px; margin: 4px 0 8px; }
.sk-col { display: grid; justify-items: center; gap: 4px; flex: 1; }
.sk-label { font-size: 0.62rem; font-weight: 800; color: var(--muted); }
.sk-label.now { color: #e07a1e; }
.sk-day { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, 0.12); font-weight: 900; color: #fff; }
.sk-day.done { background: linear-gradient(145deg, #ffb347, #e07a1e); box-shadow: 0 2px 6px rgba(224, 122, 30, 0.5); }
.sk-day.today { box-shadow: 0 0 0 3px #ffb347; background: rgba(255, 179, 71, 0.25); }
.sk-day.gift { border-radius: 10px; padding: 3px; background: rgba(0, 0, 0, 0.12); }
.sk-day.gift svg { width: 100%; height: 100%; filter: grayscale(0.7) opacity(0.6); }
.sk-day.gift.done svg, .sk-day.gift.ready svg { filter: none; }
.sk-day.gift.ready { animation: sk-pulse 1.3s ease-in-out infinite; background: rgba(255, 211, 74, 0.35); }
.sk-claim { display: block; width: 100%; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .streak-chip.gift, .sk-flame.lit, .sk-day.gift.ready { animation: none; } }

/* Ranking depois da vitória (win-rank.js): barra do multiplicador x1›x5, "+N ♥" voando até a linha da pessoa, balão da posição */
.rk-heart { font-style: normal; color: #e0405a; }
.wr-mult { display: flex; justify-content: center; margin: 2px 0 8px; }
.wr-step {
  padding: 4px 13px 4px 17px;
  margin-left: -5px;
  background: #ffe3b8;
  color: #a0662a;
  font-weight: 900;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%);
}
.wr-step:first-child { margin-left: 0; padding-left: 13px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); border-radius: 999px 0 0 999px; }
.wr-step.past { background: #ffcf86; }
.wr-step.on { background: #3cc46a; color: #fff; animation: wr-step-on 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes wr-step-on { from { transform: scale(0.7); } }
.wr-gain {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 400;
  padding: 3px 12px;
  border-radius: 999px;
  background: #fff8ec;
  color: #e07a1e;
  font-size: 1.25rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 0 2px #ffb347;
  pointer-events: none;
}
.wr-bubble {
  position: relative;
  margin: 0 auto 10px;
  padding: 7px 14px;
  width: fit-content;
  max-width: 100%;
  border-radius: 14px;
  background: #fff8ec;
  color: #7a4a2a;
  font-weight: 800;
  box-shadow: 0 0 0 2px #ffb347;
}
.wr-bubble:not(.show) { visibility: hidden; }
.wr-bubble.show { animation: wr-bubble 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
.wr-bubble b { color: #e07a1e; }
@keyframes wr-bubble { from { transform: scale(0.6); opacity: 0; } }
.rk-row.wr-hit, .rk-pod.wr-hit { animation: wr-hit 0.8s ease-out; }
@keyframes wr-hit { 30% { transform: scale(1.04); box-shadow: 0 0 0 3px #ffd23f, 0 0 18px 4px rgba(255, 210, 63, 0.8); } }
.wr-list { max-height: none; }
.wr-tap { margin: 12px 0 0; font-weight: 800; color: #e07a1e; animation: wr-blink 1.1s ease-in-out infinite alternate; }
@keyframes wr-blink { to { opacity: 0.45; } }
.wr-dialog { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .wr-step.on, .wr-bubble.show, .rk-row.wr-hit, .rk-pod.wr-hit, .wr-tap { animation: none; } }

/* Anúncio de mentira do modo ?anuncio=teste (ads.js) */
.ad-fake {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #111; color: #fff; text-align: center;
}
.ad-fake-label { font-family: var(--font-title); font-size: 1.6rem; }
.ad-fake-count { color: rgba(255, 255, 255, 0.75); }
