/*
  Painel do subathon — 3 temas (paletas enviadas), vidro leve sobre foto de fundo.
  Variáveis do painel usam o prefixo --p- (as sem prefixo são das cores dos overlays,
  que o painel recebe ao vivo e mostra na amostra da aba Aparência).
*/

/* ── Temas ─────────────────────────────────────────────── */
:root,
[data-theme='tunel'] {
  /* 🌿 Túnel florido — verde floresta e rosas */
  --p-bg: #1a3121;
  --p-img: url('bg/tunel.jpg');
  --p-img-portrait: url('bg/tunel-retrato.jpg');
  --p-img-pos: 50% 58%;
  --p-tint-a: rgba(16, 34, 22, .38);
  --p-tint-b: rgba(16, 34, 22, .8);
  --p-glass: rgba(26, 49, 33, .34);
  --p-glass-hi: rgba(62, 92, 75, .42);
  --p-glass-strong: rgba(26, 49, 33, .82);
  --p-border: rgba(210, 197, 139, .2);
  --p-hl: rgba(255, 255, 255, .1);
  --p-field: rgba(12, 26, 16, .42);
  --p-field-border: rgba(210, 197, 139, .2);
  --p-text: #f6f1de;
  --p-text-2: #d2c58b;
  --p-text-3: #a7ae6f;
  --p-accent: #d56761;
  --p-on-accent: #fff8f0;
  --p-accent-soft: rgba(213, 103, 97, .22);
  --p-accent-2: #a7ae6f;
  --p-accent-2-soft: rgba(167, 174, 111, .22);
  --p-accent-3: #6c8f72;
  --p-danger: #e8837a;
  --p-shadow: 0 20px 44px -22px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

[data-theme='jardim'] {
  /* 🌼 Jardim iluminado — verde lima e amarelo (tema claro) */
  --p-bg: #dcdda5;
  --p-img: url('bg/jardim.jpg');
  --p-img-portrait: url('bg/jardim-retrato.jpg');
  --p-img-pos: 50% 42%;
  --p-tint-a: rgba(240, 242, 205, .34);
  --p-tint-b: rgba(226, 228, 178, .72);
  --p-glass: rgba(255, 255, 238, .4);
  --p-glass-hi: rgba(255, 255, 242, .58);
  --p-glass-strong: rgba(250, 250, 228, .9);
  --p-border: rgba(255, 255, 255, .62);
  --p-hl: rgba(255, 255, 255, .55);
  --p-field: rgba(255, 255, 246, .6);
  --p-field-border: rgba(82, 105, 17, .22);
  --p-text: #1d2806;
  --p-text-2: #4a5f10;
  --p-text-3: #6d8a4b;
  --p-accent: #b5cc0e;
  --p-on-accent: #1d2806;
  --p-accent-soft: rgba(181, 204, 14, .3);
  --p-accent-2: #57638e;
  --p-accent-2-soft: rgba(87, 99, 142, .18);
  --p-accent-3: #839917;
  --p-danger: #c2453b;
  --p-shadow: 0 20px 40px -22px rgba(70, 80, 10, .38);
  color-scheme: light;
}

[data-theme='vagao'] {
  /* 🍃 Vagão abandonado — verde esmeralda e limão */
  --p-bg: #225a14;
  --p-img: url('bg/vagao.jpg');
  --p-img-portrait: url('bg/vagao-retrato.jpg');
  --p-img-pos: 50% 62%;
  --p-tint-a: rgba(14, 44, 10, .3);
  --p-tint-b: rgba(12, 38, 8, .8);
  --p-glass: rgba(34, 90, 20, .3);
  --p-glass-hi: rgba(64, 104, 50, .46);
  --p-glass-strong: rgba(24, 64, 14, .86);
  --p-border: rgba(236, 246, 219, .2);
  --p-hl: rgba(255, 255, 255, .12);
  --p-field: rgba(10, 32, 8, .42);
  --p-field-border: rgba(89, 210, 192, .24);
  --p-text: #ecf6db;
  --p-text-2: #b8e3c8;
  --p-text-3: #8fbf7c;
  --p-accent: #d8f30e;
  --p-on-accent: #183509;
  --p-accent-soft: rgba(216, 243, 14, .2);
  --p-accent-2: #59d2c0;
  --p-accent-2-soft: rgba(12, 166, 154, .26);
  --p-accent-3: #0ca69a;
  --p-danger: #ff8f7a;
  --p-shadow: 0 20px 44px -22px rgba(0, 0, 0, .65);
  color-scheme: dark;
}

:root {
  --p-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --p-ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --p-sans: 'Nunito Variable', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --p-serif: 'Fraunces Variable', 'Fraunces', Georgia, serif;
}

/* ── Base ──────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--p-bg); }
body {
  font-family: var(--p-sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--p-text);
  -webkit-font-smoothing: antialiased;
  transition: color .5s var(--p-ease);
}
::selection { background: var(--p-accent-soft); }
a { color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--p-text-3); font-weight: 700; text-transform: none; letter-spacing: 0; }
.small { font-size: 12px; }
.grow { flex: 1; }
.mt { margin-top: 14px; }
.hint { color: var(--p-text-2); font-size: 13.5px; font-weight: 600; line-height: 1.5; margin: 0; }
.hint a { color: var(--p-text); }
.ic { display: block; flex: none; }

* { scrollbar-width: thin; scrollbar-color: var(--p-border) transparent; }

/* ── Fundo ─────────────────────────────────────────────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--p-bg); }
.bg-img {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: var(--p-img-pos, 50% 50%);
  opacity: 0;
  transition: opacity 1.1s var(--p-ease);
  animation: drift 46s ease-in-out infinite alternate;
  will-change: transform;
}
.bg-img.show { opacity: 1; }
@keyframes drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.09) translate3d(-1.6%, -1.2%, 0); }
}
.bg-tint {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 30%, var(--p-tint-b) 100%),
    linear-gradient(180deg, var(--p-tint-a), var(--p-tint-b));
  transition: background .8s var(--p-ease);
}

/* ── Vidro ─────────────────────────────────────────────── */
.glass {
  background: var(--p-glass);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid var(--p-border);
  box-shadow: inset 0 1px 0 var(--p-hl), var(--p-shadow);
  transition: background-color .5s var(--p-ease), border-color .5s var(--p-ease);
}

/* ── Layout ────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 266px minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
  min-height: 100vh;
  max-width: 1720px;
  margin: 0 auto;
}

.side {
  position: sticky;
  top: 22px;
  height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 12px 14px;
  border-radius: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 6px; }
.brand-mark, .login-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--p-accent);
  color: var(--p-on-accent);
  box-shadow: 0 10px 22px -10px var(--p-accent);
  flex: none;
}
.brand b { display: block; font-family: var(--p-serif); font-size: 21px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.brand small { color: var(--p-text-3); font-weight: 700; font-size: 12.5px; }

.nav { position: relative; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--p-text-2);
  text-decoration: none;
  font-weight: 800;
  font-size: 14.5px;
  transition: color .2s var(--p-ease);
  -webkit-tap-highlight-color: transparent;
}
.nav a b { font-weight: inherit; white-space: nowrap; }
.nav a.active { color: var(--p-text); }
.nav a:active { transform: scale(.98); }
.nav-glow {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 44px;
  border-radius: 14px;
  background: var(--p-glass-hi);
  border: 1px solid var(--p-border);
  box-shadow: inset 0 1px 0 var(--p-hl);
  pointer-events: none;
}
.nav-glow::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 3px;
  background: var(--p-accent);
}
@media (hover: hover) and (pointer: fine) {
  .nav a:not(.active):hover { color: var(--p-text); }
}

.side-foot { margin-top: auto; padding: 0 8px; }
.conn { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--p-text-3); }
.conn i { width: 9px; height: 9px; border-radius: 50%; background: var(--p-danger); box-shadow: 0 0 10px var(--p-danger); }
.conn.on i { background: var(--p-accent-2); box-shadow: 0 0 10px var(--p-accent-2); }

.main { min-width: 0; display: flex; flex-direction: column; gap: 20px; padding-bottom: 30px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 6px 4px 0; }
/* botão ☰ (só no celular): 3 tracinhos que viram X */
.menu-btn {
  display: none;
  flex: none;
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--p-text);
  transition: transform 140ms cubic-bezier(.23, 1, .32, 1);
}
.menu-btn:active { transform: scale(.94); }
.menu-btn i {
  position: absolute;
  left: 13px;
  width: 20px;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 300ms cubic-bezier(.23, 1, .32, 1), opacity 200ms ease;
}
.menu-btn i:nth-child(1) { top: 15px; }
.menu-btn i:nth-child(2) { top: 22px; }
.menu-btn i:nth-child(3) { top: 29px; }
.menu-open .menu-btn i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-btn i:nth-child(2) { opacity: 0; transform: scaleX(.3); }
.menu-open .menu-btn i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.titles h1 {
  margin: 0;
  font-family: var(--p-serif);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}
.titles p { margin: 6px 0 0; color: var(--p-text-2); font-size: 15.5px; font-weight: 700; }
[data-theme='jardim'] .titles h1 { text-shadow: 0 2px 18px rgba(255, 255, 230, .5); }

.mini-timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 18px;
  border-radius: 99px;
  color: var(--p-text);
  font: 900 19px var(--p-sans);
  cursor: pointer;
  transition: transform .16s var(--p-ease);
}
.mini-timer:active { transform: scale(.97); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--p-text-3); flex: none; }
.dot.on { background: var(--p-accent); box-shadow: 0 0 0 0 var(--p-accent); animation: pulse 1.8s var(--p-ease) infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 10px transparent; } }

.pages { position: relative; }
.page { display: none; }
.page.active { display: block; }

/* ── Grades ────────────────────────────────────────────── */
.grid { display: grid; gap: 18px; align-items: start; }
/* cascata (painel.js → masonry): linhas de 1px, o espaço entre cards vem do "span" */
.grid.masonry { grid-auto-rows: 1px; row-gap: 0 !important; } /* vence o .grid.inner (gap 18px em cada linha de 1px estica tudo) */
.g-1 { grid-template-columns: minmax(0, 1fr); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.inner { gap: 18px; }
.span-2 { grid-column: 1 / -1; }
.stack-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.g-live {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    'timer timer actions'
    'stats stats stats'
    'feed feed rmini';
}
.timer-card { grid-area: timer; }
.actions-card { grid-area: actions; align-self: stretch; }
.stats { grid-area: stats; }
.feed-card { grid-area: feed; }
.rmini-card { grid-area: rmini; }

/* ── Cards ─────────────────────────────────────────────── */
.card { position: relative; border-radius: 26px; padding: 20px 22px 22px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 28px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--p-text-2);
}
.eyebrow .ic { color: var(--p-accent); }
[data-theme='jardim'] .eyebrow .ic { color: var(--p-accent-3); }

/* ── Controles ─────────────────────────────────────────── */
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.row.end { justify-content: flex-end; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 17px;
  border-radius: 13px;
  border: 1px solid var(--p-border);
  background: var(--p-glass-hi);
  color: var(--p-text);
  font: 800 14.5px var(--p-sans);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s var(--p-ease), background-color .2s var(--p-ease), border-color .2s var(--p-ease), box-shadow .2s var(--p-ease), filter .2s var(--p-ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: var(--p-accent);
  color: var(--p-on-accent);
  border-color: transparent;
  box-shadow: 0 10px 22px -12px var(--p-accent), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn.danger { background: rgba(224, 100, 90, .2); border-color: var(--p-danger); color: var(--p-text); }
.btn.ghost { background: transparent; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn.lg { height: 50px; font-size: 16px; }
.btn.xl { height: 60px; padding: 0 28px; font-size: 19px; border-radius: 18px; }
.btn.wide { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--p-text-3); filter: brightness(1.06); }
  .btn.primary:hover { box-shadow: 0 14px 26px -12px var(--p-accent), inset 0 1px 0 rgba(255, 255, 255, .25); }
}

.chip {
  height: 38px;
  padding: 0 15px;
  border-radius: 99px;
  border: 1px solid var(--p-field-border);
  background: var(--p-field);
  color: var(--p-text);
  font: 800 14px var(--p-sans);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform .14s var(--p-ease), background-color .2s, border-color .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.chip:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) {
  .plus .chip:hover { border-color: var(--p-accent-2); color: var(--p-accent-2); }
  .minus .chip:hover { border-color: var(--p-danger); color: var(--p-danger); }
  [data-theme='jardim'] .plus .chip:hover { color: var(--p-accent-3); border-color: var(--p-accent-3); }
}

.field {
  height: 42px;
  min-width: 0;
  padding: 0 13px;
  border-radius: 13px;
  border: 1px solid var(--p-field-border);
  background: var(--p-field);
  color: var(--p-text);
  font: 700 14.5px var(--p-sans);
  outline: none;
  transition: border-color .2s var(--p-ease), box-shadow .2s var(--p-ease);
}
.field::placeholder { color: var(--p-text-3); opacity: .85; }
.field:focus { border-color: var(--p-accent); box-shadow: 0 0 0 4px var(--p-accent-soft); }
select.field { padding-right: 8px; cursor: pointer; }
select.field option { background: var(--p-glass-strong); color: var(--p-text); }
/* ── editor de cenas ── */
.scene-prev { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 4px; box-shadow: inset 0 0 0 1px var(--p-line, rgba(255,255,255,.12)); }
.scene-prev iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; }
.scene-tip { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; pointer-events: none; }
.seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.06); }
.seg button { padding: 6px 12px; border: 0; border-radius: 9px; background: transparent; color: inherit; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; transition: background-color 150ms ease, transform 120ms var(--p-ease, ease); }
.seg button:hover { background: rgba(255,255,255,.1); }
.seg button:active { transform: scale(.96); }
/* redes: pílulas que acendem na cor da plataforma */
.soc-toggles { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.soc-toggles button {
  --c: var(--p-text-2);
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px 0 10px;
  border-radius: 99px;
  border: 1px solid var(--p-field-border);
  background: var(--p-field);
  color: var(--p-text-3);
  font: inherit; font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 120ms cubic-bezier(.23, 1, .32, 1);
}
.soc-toggles button svg { width: 15px; height: 15px; flex: none; opacity: .55; transition: opacity 180ms ease, color 180ms ease; }
.soc-toggles button[data-v='twitch'] { --c: #a970ff; }
.soc-toggles button[data-v='kick'] { --c: #53fc18; }
.soc-toggles button[data-v='youtube'] { --c: #ff4e5e; }
.soc-toggles button[data-v='instagram'] { --c: #f77fbe; }
.soc-toggles button[aria-pressed='true'] {
  color: var(--p-text);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 16%, var(--p-field));
}
.soc-toggles button[aria-pressed='true'] svg { color: var(--c); opacity: 1; }
.soc-toggles button:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { .soc-toggles button:hover { border-color: var(--p-border); color: var(--p-text-2); } }
.range.sm { width: 160px; margin: 0; }
.w220 { width: 260px; }
/* integrações */
.steps { margin: 10px 0 12px; padding-left: 20px; color: var(--p-text-2); font-size: 13.5px; font-weight: 600; line-height: 1.6; }
.steps a { color: var(--p-text); }
.copy-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; margin-bottom: 10px; }
.copy-row small { grid-column: 1 / -1; font-size: 11.5px; font-weight: 800; color: var(--p-text-3); }
.copy-row code { min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--p-field); border: 1px solid var(--p-field-border); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.disabled { opacity: .45; pointer-events: none; }
/* regras: separador de plataforma */
.rule-sep { grid-column: 1 / -1; margin: 10px 0 2px; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--p-text-3); }
/* cotações */
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.fx { display: flex; align-items: center; gap: 8px; }
.fx span { width: 36px; font-weight: 900; font-size: 13px; color: var(--p-text-2); }
.fx .field { width: 100%; min-width: 0; }
/* tabela de animações das cenas */
.anim-box { margin: 6px 0 4px; padding: 14px; border-radius: 16px; background: rgba(0, 0, 0, .14); box-shadow: inset 0 0 0 1px var(--p-border); }
.anim-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.anim-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; padding: 3px 0; }
.anim-row > span:first-child { font-weight: 800; font-size: 13.5px; color: var(--p-text-2); }
.anim-row .sel, .anim-row .field { width: 100%; }
.anim-hd small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--p-text-3); }
.w70 { width: 74px; } .w80 { width: 86px; } .w90 { width: 96px; } .w140 { width: 180px; }
input[type=number].field { font-variant-numeric: tabular-nums; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; color: var(--p-text-2); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: var(--p-field);
  border: 1px solid var(--p-field-border);
  transition: background-color .22s var(--p-ease), border-color .22s var(--p-ease);
  flex: none;
}
.switch i::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--p-text-2);
  transition: transform .26s var(--p-ease), background-color .22s;
}
.switch input:checked + i { background: var(--p-accent); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(18px); background: var(--p-on-accent); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px var(--p-accent-soft); }

.seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 14px; background: var(--p-field); border: 1px solid var(--p-field-border); flex-wrap: wrap; }
.seg button {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--p-text-2);
  font: 800 14px var(--p-sans);
  cursor: pointer;
  transition: background-color .22s var(--p-ease), color .22s var(--p-ease), transform .14s var(--p-ease);
}
.seg button:active { transform: scale(.96); }
.seg button.on { background: var(--p-accent); color: var(--p-on-accent); }
.seg.big button { height: 42px; padding: 0 22px; font-size: 15px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--p-field);
  border: 1px solid var(--p-field-border);
  color: var(--p-text-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill.live { background: var(--p-accent); color: var(--p-on-accent); border-color: transparent; }
.pill.warn { border-color: var(--p-text-2); color: var(--p-text); }
.pill.ok { background: var(--p-accent-2-soft); color: var(--p-text); border-color: var(--p-accent-2); }

.inline { display: inline-flex; align-items: center; gap: 8px; color: var(--p-text-2); font-weight: 700; }

/* ── Ao vivo: timer ────────────────────────────────────── */
.timer-main { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.big-clock {
  font-size: 96px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, .16));
  transition: color .7s var(--p-ease);
}
.big-clock.gain { color: var(--p-accent); transition: color .15s; }
.timer-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; color: var(--p-text-2); font-weight: 700; }
.timer-meta b { color: var(--p-text); font-weight: 900; }
.quick { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.qgroup { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.qlabel { width: 56px; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--p-text-3); }
details.more { margin-top: 16px; border-top: 1px solid var(--p-border); padding-top: 12px; }
details.more summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--p-text-2); font-weight: 800; list-style: none; user-select: none; }
details.more summary::-webkit-details-marker { display: none; }
.more-body { display: grid; gap: 10px; padding-top: 12px; }
.more-body .row > .field:first-child { flex: 1; min-width: 200px; }

/* dígitos (shared/digits.js) */
.digits { display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; line-height: 1; }
.digits .slot { position: relative; display: inline-block; width: .62em; height: 1.08em; overflow: hidden; }
.digits .slot > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.digits .colon { display: inline-block; width: .3em; text-align: center; color: var(--p-accent); transform: translateY(-.06em); }

/* ── Ao vivo: ações, números, feed ─────────────────────── */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--p-border);
  background: var(--p-glass-hi);
  color: var(--p-text);
  text-align: left;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: transform .16s var(--p-ease), background-color .25s var(--p-ease), border-color .25s var(--p-ease);
  -webkit-tap-highlight-color: transparent;
}
.action:active { transform: scale(.97); }
.action b { font-weight: 900; font-size: 15px; margin-top: 8px; }
.action small { color: var(--p-text-3); font-weight: 700; font-size: 12.5px; }
.a-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--p-accent-soft); color: var(--p-accent); }
[data-theme='jardim'] .a-ic { color: var(--p-text-2); }
.action.on { background: var(--p-accent-soft); border-color: var(--p-accent); }
@media (hover: hover) and (pointer: fine) {
  .action:hover { border-color: var(--p-text-3); transform: translateY(-2px); }
  .action:hover:active { transform: scale(.97); }
}

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; }
.s-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--p-accent-soft); color: var(--p-accent); flex: none; }
[data-theme='jardim'] .s-ic { color: var(--p-text-2); }
.stat b { display: block; font-size: 27px; font-weight: 900; line-height: 1.1; }
.stat small { color: var(--p-text-2); font-weight: 700; font-size: 13px; }

.feed { display: flex; flex-direction: column; gap: 4px; max-height: 380px; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.f-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; }
.f-item:first-child { background: var(--p-field); }
.f-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--p-field); color: var(--p-text-2); flex: none; }
.f-ic.k-pix, .f-ic.k-tip, .f-ic.k-bits { color: var(--p-accent); background: var(--p-accent-soft); }
.f-ic.k-sub, .f-ic.k-gift, .f-ic.k-follow, .f-ic.k-raid { color: var(--p-accent-2); background: var(--p-accent-2-soft); }
[data-theme='jardim'] .f-ic.k-pix, [data-theme='jardim'] .f-ic.k-tip, [data-theme='jardim'] .f-ic.k-bits { color: var(--p-text-2); }
.f-text { flex: 1; min-width: 0; font-weight: 700; line-height: 1.35; }
.f-time { color: var(--p-text-3); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; flex: none; }
.empty { color: var(--p-text-3); font-weight: 700; padding: 14px 4px; }

.rmini { display: flex; flex-direction: column; gap: 10px; }
.rmini .big { font-family: var(--p-serif); font-size: 22px; font-weight: 600; line-height: 1.2; }
.rmini small { color: var(--p-text-2); font-weight: 700; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--p-text-2); font-weight: 800; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .link-btn:hover { color: var(--p-text); } }

/* ── Testes ────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles.t5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--p-field-border);
  background: var(--p-field);
  color: var(--p-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .14s var(--p-ease), border-color .2s, background-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.tile b { font-size: 16px; font-weight: 900; }
.tile small { color: var(--p-text-3); font-weight: 700; font-size: 12.5px; }
.tile:active { transform: scale(.96); }
.tile.accent { align-items: center; border-color: var(--p-accent); background: var(--p-accent-soft); }
.tile.hot { border-color: var(--p-accent-2); background: var(--p-accent-2-soft); }
.tile.fired { animation: fired .5s var(--p-ease); }
@keyframes fired { 0% { box-shadow: 0 0 0 0 var(--p-accent); } 100% { box-shadow: 0 0 0 12px transparent; } }
@media (hover: hover) and (pointer: fine) { .tile:hover { border-color: var(--p-text-3); } }

/* ── Listas editáveis ──────────────────────────────────── */
.items { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 16px; }
.item .field { height: 38px; }
.item .lab { flex: 1; }
.item .ic-prev { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--p-field); flex: none; }
.item .ic-sel { width: 132px; flex: none; }
.item .wt { width: 62px; flex: none; text-align: center; }
.item .x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--p-text-3); cursor: pointer; flex: none; transition: color .2s, background-color .2s; }
.item .x:hover { color: var(--p-danger); background: var(--p-field); }
.item.off .lab { opacity: .5; text-decoration: line-through; }
.check { appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 7px; border: 1.5px solid var(--p-text-3); background: var(--p-field); cursor: pointer; flex: none; display: grid; place-items: center; transition: background-color .2s, border-color .2s; }
.check:checked { background: var(--p-accent); border-color: var(--p-accent); }
.check:checked::after { content: ''; width: 6px; height: 11px; border: solid var(--p-on-accent); border-width: 0 2.5px 2.5px 0; transform: translate(0, -1px) rotate(45deg); }

.history { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.h-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 15px; background: var(--p-field); cursor: pointer; transition: opacity .3s; }
.h-item.done { opacity: .55; }
.h-item.done .h-label { text-decoration: line-through; }
.h-label { font-weight: 800; }
.h-meta { font-size: 12.5px; color: var(--p-text-3); font-weight: 700; margin-top: 2px; }

/* formulários */
.form { display: grid; gap: 10px; }
.form.two { grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.frow { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; padding: 6px 0; border-bottom: 1px solid var(--p-border); }
.frow:last-child { border-bottom: 0; }
.frow > span { display: inline-flex; align-items: center; gap: 6px; color: var(--p-text-2); }
.pre { color: var(--p-text-3); font-weight: 800; }
.fstack { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 900; letter-spacing: .04em; color: var(--p-text-2); }

/* metas */
.goals { display: flex; flex-direction: column; gap: 10px; }
.g { padding: 13px 15px; border-radius: 16px; background: var(--p-field); border: 1px solid transparent; }
.g.current { border-color: var(--p-accent); }
.g-top { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; }
.g-top span { color: var(--p-text-2); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-bar { height: 9px; border-radius: 9px; background: rgba(0, 0, 0, .18); margin-top: 10px; overflow: hidden; }
.g-bar i { display: block; height: 100%; border-radius: inherit; background: var(--p-accent); transform-origin: 0 50%; transition: transform .9s var(--p-ease); }
.g.reached .g-bar i { background: var(--p-accent-2); }
[data-theme='jardim'] .g-bar { background: rgba(82, 105, 17, .14); }

/* intervalo */
.inter-card { display: flex; flex-direction: column; gap: 16px; transition: box-shadow .5s var(--p-ease), border-color .5s; }
.inter-card.on { border-color: var(--p-accent); box-shadow: inset 0 1px 0 var(--p-hl), 0 0 0 4px var(--p-accent-soft), var(--p-shadow); }
.inter-state { display: flex; align-items: center; gap: 16px; }
.inter-ic { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 20px; background: var(--p-accent-soft); color: var(--p-accent); flex: none; }
[data-theme='jardim'] .inter-ic { color: var(--p-text-2); }
.inter-state b { display: block; font-family: var(--p-serif); font-size: 25px; font-weight: 600; }
.inter-state small { color: var(--p-text-2); font-weight: 700; }
.reasons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.reasons button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 4px 12px;
  border-radius: 16px;
  border: 1px solid var(--p-field-border);
  background: var(--p-field);
  color: var(--p-text-2);
  font: 800 13px var(--p-sans);
  cursor: pointer;
  transition: transform .14s var(--p-ease), background-color .22s, color .22s, border-color .22s;
}
.reasons button:active { transform: scale(.96); }
.reasons button.on { background: var(--p-accent); color: var(--p-on-accent); border-color: transparent; }

/* chat */
.range { width: 100%; margin: 6px 0 14px; }

/* regras */
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rule { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--p-field); cursor: text; }
.rule b { flex: 1; font-weight: 800; }
.r-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--p-accent-soft); color: var(--p-accent); flex: none; }
[data-theme='jardim'] .r-ic { color: var(--p-text-2); }
.rule .field { text-align: right; }
.rule small { width: 70px; color: var(--p-text-3); font-weight: 800; font-size: 12.5px; }

/* aparência (a amostra usa as cores DOS OVERLAYS: --accent, --bg, --fg...) */
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 14px 0 8px;
  border-radius: 99px;
  border: 1px solid var(--p-field-border);
  background: var(--p-field);
  color: var(--p-text);
  font: 800 13.5px var(--p-sans);
  cursor: pointer;
  transition: transform .14s var(--p-ease), border-color .2s;
}
.preset:active { transform: scale(.96); }
.preset i { display: flex; }
.preset i b { width: 13px; height: 24px; display: block; }
.preset i b:first-child { border-radius: 8px 0 0 8px; }
.preset i b:last-child { border-radius: 0 8px 8px 0; }
.colors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.colors label { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--p-text-2); cursor: pointer; }
.colors input { width: 100%; height: 46px; padding: 0; border: 1px solid var(--p-field-border); border-radius: 14px; background: none; cursor: pointer; }
.colors input::-webkit-color-swatch-wrapper { padding: 4px; }
.colors input::-webkit-color-swatch { border: 0; border-radius: 10px; }
.sample { margin-top: 16px; padding: 18px; border-radius: 18px; background: rgba(0, 0, 0, .18); display: flex; justify-content: center; }
.s-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: 99px;
  background: var(--bg, #1d1230);
  border: 3px solid var(--accent, #b597f0);
  box-shadow: 0 0 0 3px var(--outline, #0d0816), 0 0 16px var(--accent-a35, transparent);
  color: var(--fg, #fff);
  font-family: var(--p-sans);
}
.s-star { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bg-3, #453562); color: var(--gold, #f6d08a); font-size: 22px; box-shadow: 0 0 0 2px var(--accent, #b597f0); }
.s-card b { display: block; font-size: 16px; font-weight: 900; }
.s-card small { color: var(--mute, #c9bae1); font-weight: 700; }
.s-card small i { font-style: normal; color: var(--pink, #f7a8cf); }
.s-chip { padding: 5px 11px; border-radius: 99px; background: var(--accent, #b597f0); color: var(--on-accent, #170e26); font-weight: 900; font-size: 13px; }

/* conexões */
.links { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.link-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--p-field); }
.link-row b { font-weight: 900; text-transform: capitalize; }
.link-row .desc { display: block; color: var(--p-text-3); font-size: 12.5px; font-weight: 700; }
.link-row code { font: 600 12.5px ui-monospace, Consolas, monospace; color: var(--p-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row .size { font-size: 12.5px; font-weight: 900; color: var(--p-text-2); font-variant-numeric: tabular-nums; }

/* configurações */
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid var(--p-border);
  background: var(--p-field);
  color: var(--p-text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform .2s var(--p-ease), border-color .3s var(--p-ease), box-shadow .3s var(--p-ease);
}
.theme-card .th-img { height: 150px; background-size: cover; background-position: center 60%; transition: transform .6s var(--p-ease); }
.theme-card .th-body { padding: 12px 14px 14px; }
.theme-card .th-body b { display: block; font-family: var(--p-serif); font-size: 19px; font-weight: 600; }
.theme-card .th-body small { color: var(--p-text-2); font-weight: 700; font-size: 13px; }
.theme-card .th-dots { position: absolute; left: 12px; top: 112px; display: flex; gap: 4px; }
.theme-card .th-dots i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.theme-card .th-check {
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--p-accent);
  color: var(--p-on-accent);
  opacity: 0;
  transform: scale(.85);
  transition: opacity .25s var(--p-ease), transform .3s var(--p-ease);
}
.theme-card.on { border-color: var(--p-accent); box-shadow: 0 0 0 4px var(--p-accent-soft); }
.theme-card.on .th-check { opacity: 1; transform: scale(1); }
.theme-card:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .theme-card:hover { transform: translateY(-3px); }
  .theme-card:hover .th-img { transform: scale(1.05); }
}
.danger-card .btn { flex: 1; }
.foot-row { padding: 4px 6px; }
.credits a { color: var(--p-text-2); }

/* ── Avisos (toasts) ───────────────────────────────────── */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  max-width: 420px;
  padding: 11px 12px 11px 11px;
  border-radius: 18px;
  background: var(--p-glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--p-border);
  box-shadow: var(--p-shadow);
  font-weight: 800;
  pointer-events: auto;
  overflow: hidden;
}
.toast .t-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--p-accent-2-soft); color: var(--p-accent-2); flex: none; }
.toast.err .t-ic { background: rgba(224, 100, 90, .22); color: var(--p-danger); }
.toast .t-tx { flex: 1; }
.toast .t-act { height: 32px; padding: 0 12px; border-radius: 10px; border: 0; background: var(--p-accent); color: var(--p-on-accent); font: 900 13px var(--p-sans); cursor: pointer; }
.toast .t-act:active { transform: scale(.96); }
.toast .t-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--p-accent); transform-origin: 0 50%; opacity: .7; }

/* ── Confirmação ───────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .32); }
.modal-card { width: min(440px, 100%); padding: 24px; border-radius: 26px; background: var(--p-glass-strong); }
.modal-card h3 { margin: 0; font-family: var(--p-serif); font-size: 25px; font-weight: 600; }
.modal-card p { margin: 10px 0 20px; color: var(--p-text-2); font-weight: 700; line-height: 1.5; }

/* ── Login ─────────────────────────────────────────────── */
/* enquanto o login está na tela, o painel fica escondido atrás */
body.locked .app, body.locked .toasts { visibility: hidden; }

.login {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: radial-gradient(60% 60% at 50% 50%, transparent, var(--p-tint-b));
}
.login-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  padding: 38px 36px 26px;
  border-radius: 34px;
  background: var(--p-glass);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--p-border);
  box-shadow: inset 0 1px 0 var(--p-hl), 0 40px 80px -30px rgba(0, 0, 0, .6);
  isolation: isolate;
}
/* brilho suave na cor do tema atrás do card */
.lb-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 340px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--p-accent-soft), transparent);
  filter: blur(10px);
  pointer-events: none;
}
.login-mark { width: 62px; height: 62px; border-radius: 20px; }
.lb-title {
  margin: 22px 0 0;
  font-family: var(--p-serif);
  font-weight: 600;
  font-size: 38px;
  line-height: 1.04;
  letter-spacing: -.02em;
}
.lb-hello {
  display: block;
  margin-bottom: 6px;
  font-family: var(--p-sans);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--p-accent);
}
[data-theme='jardim'] .lb-hello { color: var(--p-accent-3); }
.lb-sub { margin: 12px 0 24px; color: var(--p-text-2); font-weight: 700; font-size: 15.5px; line-height: 1.5; }

.key-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 8px 0 16px;
  border-radius: 17px;
  background: var(--p-field);
  border: 1px solid var(--p-field-border);
  cursor: text;
  transition: border-color .2s var(--p-ease), box-shadow .2s var(--p-ease);
}
.key-field:focus-within { border-color: var(--p-accent); box-shadow: 0 0 0 4px var(--p-accent-soft); }
.key-field.bad { border-color: var(--p-danger); box-shadow: 0 0 0 4px rgba(224, 100, 90, .2); }
.kf-ic { color: var(--p-text-3); display: grid; }
.key-field:focus-within .kf-ic { color: var(--p-accent); }
[data-theme='jardim'] .key-field:focus-within .kf-ic { color: var(--p-accent-3); }
.key-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--p-text);
  font: 800 16.5px var(--p-sans);
  letter-spacing: .02em;
  outline: none;
}
.key-field input::placeholder { color: var(--p-text-3); font-weight: 700; letter-spacing: 0; }
.kf-eye {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--p-text-3);
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .14s var(--p-ease);
}
.kf-eye:hover { background: var(--p-glass-hi); color: var(--p-text); }
.kf-eye:active { transform: scale(.94); }

.lb-err { min-height: 22px; margin: 8px 2px 8px; color: var(--p-danger); font-weight: 800; font-size: 14px; }
.lb-go { height: 56px; font-size: 17px; border-radius: 17px; }
.lb-go .lb-arrow { transition: transform .25s var(--p-ease); }
@media (hover: hover) and (pointer: fine) { .lb-go:hover .lb-arrow { transform: translateX(4px); } }
.lb-go .spin {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.lb-go.loading { pointer-events: none; }
.lb-go.loading .spin { display: block; }
.lb-go.loading .lb-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.lb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--p-border);
  color: var(--p-text-3);
  font-size: 13px;
  font-weight: 800;
}
.lb-themes { display: flex; gap: 8px; }
.lb-themes button {
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--p-border);
  transition: transform .2s var(--p-ease), border-color .2s;
}
.lb-themes button.on { border-color: var(--p-accent); box-shadow: 0 0 0 3px var(--p-accent-soft); }
.lb-themes button:active { transform: scale(.92); }
@media (hover: hover) and (pointer: fine) { .lb-themes button:hover { transform: translateY(-2px); } }

/* pétalas/folhinhas caindo atrás do card */
.petals { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute;
  top: -40px;
  width: 14px;
  height: 10px;
  border-radius: 80% 0 80% 0;
  opacity: .85;
  animation: fall linear infinite;
}
.petal i { display: block; width: 100%; height: 100%; border-radius: inherit; background: inherit; animation: sway ease-in-out infinite alternate; animation-duration: inherit; }
@keyframes fall {
  0% { transform: translate3d(0, -5vh, 0) rotate(0deg); }
  100% { transform: translate3d(var(--dx, 40px), 110vh, 0) rotate(var(--rot, 540deg)); }
}
[data-motion='reduced'] .petals { display: none; }

/* ── Animações reduzidas (escolha do painel, não do Windows) ─ */
[data-motion='reduced'] .bg-img { animation: none; transform: scale(1.03); }
[data-motion='reduced'] .dot.on { animation: none; }

/* ── Celular / telas estreitas ─────────────────────────── */
@media (orientation: portrait) {
  .bg-img { background-position: center; }
}
@media (max-width: 1200px) {
  .g-live { grid-template-columns: 1fr 1fr; grid-template-areas: 'timer timer' 'actions rmini' 'stats stats' 'feed feed'; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .themes { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; padding: 12px 14px 28px; gap: 14px; }
  /* menu vira gaveta que entra pela esquerda (curva de gaveta do iOS: rápida no começo, assenta macio) */
  .side {
    position: fixed;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: min(300px, 84vw);
    z-index: 60;
    background: var(--p-glass-strong);
    transform: translateX(calc(-100% - 20px));
    transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  .menu-open .side { transform: translateX(0); transition-duration: 420ms; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
  .side.dragging { transition: none; }
  .nav-glow { display: none; }
  .nav a.active { background: var(--p-glass-hi); }
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, .45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
  }
  .menu-open .scrim { opacity: 1; pointer-events: auto; transition-duration: 380ms; }
  .menu-open { overflow: hidden; }
  /* barra do topo: ☰ | título | mini-timer, presa no alto ao rolar */
  .top {
    position: sticky;
    top: 0;
    z-index: 30;
    align-items: center;
    gap: 12px;
    margin: -12px -14px 0;
    padding: 10px 14px;
    background: linear-gradient(var(--p-bg) 55%, transparent);
  }
  .menu-btn { display: inline-flex; }
  .titles { flex: 1; min-width: 0; }
  .titles h1 { font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .titles p { display: none; }
  .g-2, .rules, .form.two { grid-template-columns: 1fr; }
  .g-live { grid-template-columns: 1fr; grid-template-areas: 'timer' 'actions' 'stats' 'rmini' 'feed'; }
  .big-clock { font-size: 64px; }
  .tiles.t5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reasons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .link-row { grid-template-columns: 1fr auto; }
  .link-row code, .link-row .size { display: none; }
  .themes { grid-template-columns: 1fr; }
  .toasts { left: 14px; right: 14px; bottom: 14px; align-items: stretch; }
}

/* ── Select estilizado (painel/select.js) ──────────────── */
.sel { position: relative; display: inline-flex; min-width: 0; }
.sel-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.sel-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 120px;
  cursor: pointer;
  text-align: left;
}
.item .sel-trigger { height: 38px; }
.sel-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sel-caret { display: grid; place-items: center; color: var(--p-text-3); transition: transform .22s var(--p-ease); flex: none; }
.sel-trigger.open { border-color: var(--p-accent); box-shadow: 0 0 0 4px var(--p-accent-soft); }
.sel-trigger.open .sel-caret { transform: rotate(180deg); }
.sel-ic { display: grid; place-items: center; width: 20px; height: 20px; flex: none; }
.sel-ic svg { width: 18px; height: 18px; }
.sel-list {
  position: fixed;
  z-index: 80;
  max-height: min(320px, 60vh);
  overflow-y: auto;
  padding: 6px;
  border-radius: 16px;
  background: var(--p-glass-strong);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--p-border);
  box-shadow: inset 0 1px 0 var(--p-hl), 0 24px 48px -16px rgba(0, 0, 0, .55);
  font: 700 14.5px var(--p-sans);
  color: var(--p-text);
}
.sel-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .12s var(--p-ease);
}
.sel-opt.active { background: var(--p-glass-hi); }
.sel-opt.on { color: var(--p-accent); }
[data-theme='jardim'] .sel-opt.on { color: var(--p-text-2); }
.sel-opt.on::after {
  content: '';
  width: 6px;
  height: 11px;
  margin-left: auto;
  border: solid currentColor;
  border-width: 0 2.5px 2.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
/* fim das listas com rolagem: some num degradê em vez de cortar seco */
.history[data-fit] { -webkit-mask: linear-gradient(#000 calc(100% - 28px), transparent); mask: linear-gradient(#000 calc(100% - 28px), transparent); padding-bottom: 20px; }

/* ── controle deslizante (range) ──
   trilho com a parte percorrida preenchida (--pct vem do painel.js), bolinha branca com halo */
input[type='range'].range {
  -webkit-appearance: none;
  appearance: none;
  height: 26px;
  background: transparent;
  cursor: pointer;
  --pct: 50%;
  --ring: color-mix(in srgb, var(--p-accent) 24%, transparent);
}
.range:focus { outline: none; }
.range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--p-accent) 0 var(--pct), rgba(255, 255, 255, .12) var(--pct) 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35), 0 0 0 0 var(--ring);
  transition: transform 160ms cubic-bezier(.23, 1, .32, 1), box-shadow 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .range:hover::-webkit-slider-thumb { box-shadow: 0 2px 6px rgba(0, 0, 0, .35), 0 0 0 6px var(--ring); }
}
.range:active::-webkit-slider-thumb { transform: scale(1.12); box-shadow: 0 2px 8px rgba(0, 0, 0, .4), 0 0 0 9px var(--ring); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 2px 6px rgba(0, 0, 0, .35), 0 0 0 6px var(--ring); }
/* Firefox */
.range::-moz-range-track { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.range::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--p-accent); }
.range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }

/* ═════════ celular: check-up geral ═════════ */
@media (max-width: 960px) {
  /* entalhe / barra de gestos do iPhone */
  .app { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); padding-bottom: max(28px, env(safe-area-inset-bottom)); }
  .top { padding-top: max(10px, env(safe-area-inset-top)); }
  .side { top: max(10px, env(safe-area-inset-top)); bottom: max(10px, env(safe-area-inset-bottom)); }

  /* linhas "rótulo | controle": o controle desce pra linha de baixo quando não cabe */
  .frow { flex-wrap: wrap; row-gap: 8px; }
  .frow > .sel, .frow .w220, .frow .w140 { width: 100%; }
  .frow > .inline, .frow > span.inline { flex-wrap: wrap; }
  .seg { flex-wrap: wrap; }

  /* iPhone dá zoom sozinho em campo com letra < 16px */
  .field, input.field, select, textarea { font-size: 16px; }

  /* alvos de toque confortáveis (~44px) */
  .btn.sm { min-height: 40px; }
  .seg button { min-height: 40px; padding: 0 14px; }
  .soc-toggles button { height: 40px; }
  label.switch { min-height: 40px; }
  .x { width: 40px; height: 40px; }
  .check { width: 28px; height: 28px; }
  .tile { min-height: 64px; }

  /* controles deslizantes: bolinha maior pro dedo */
  .range::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -10px; }
  .range.sm { width: 100%; }

  /* endereços das integrações: quebra linha em vez de cortar com "…" */
  .copy-row code { white-space: normal; word-break: break-all; text-overflow: clip; }

  /* tabela de animações das cenas: rótulo em cima, os dois seletores lado a lado */
  .anim-row { grid-template-columns: 1fr 1fr; }
  .anim-row > span:first-child { grid-column: 1 / -1; margin-top: 6px; }
  .anim-hd { display: none; }
}
@media (max-width: 960px) {
  /* linhas de desafio (Roleta) e de meta (Metas): controles em cima, texto embaixo na largura toda */
  .item { flex-wrap: wrap; row-gap: 8px; padding: 10px; border-radius: 16px; background: rgba(0, 0, 0, .14); box-shadow: inset 0 0 0 1px var(--p-border); }
  .item > .lab { order: 99; flex: 1 0 100%; width: 100%; }
  .item > .sel { flex: 1 1 auto; min-width: 0; }
  .item .x { width: 40px; height: 40px; }
}
