/* Prancheta CBFS — UI dark navy, mobile-first */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #0D1330;
  --panel: #151C42;
  --panel-2: #1B2452;
  --line: rgba(255,255,255,.10);
  --text: #F2F3F8;
  --dim: #9AA1C2;
  --accent: #F2A900;
  --danger: #E84C4C;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
html, body { height: 100%; overscroll-behavior: none; }
body {
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none; -webkit-user-select: none;
}

/* ---------- topbar ---------- */
#topbar {
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--sat)) 12px 8px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.wordmark { display: flex; align-items: center; gap: 7px; color: var(--accent); flex: none; }
.wm-ball { width: 24px; height: 24px; }
.wm-txt { font-size: 17px; font-weight: 800; letter-spacing: -.03em; color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif; }
.tb-emblem { height: 38px; width: auto; flex: none; display: block; }
.tb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; }
#playName {
  font-size: 15px; font-weight: 600; padding: 4px 8px; border-radius: 8px;
  max-width: 40vw; overflow: hidden; white-space: nowrap; outline: none;
}
#playName:focus { background: var(--panel-2); }
.spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border: none; border-radius: 12px;
  background: transparent; color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn:active { background: var(--panel-2); }
.icon-btn.accent { background: var(--accent); color: #14172B; }
.icon-btn.authed { color: var(--accent); }

/* ---------- board ---------- */
main { flex: 1; position: relative; min-height: 0; }
#board { position: absolute; inset: 0; display: block; }

/* ---------- timeline ---------- */
#timeline {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--panel); border-top: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
#timeline::-webkit-scrollbar { display: none; }
#frameChips { display: flex; gap: 6px; }
.frame-chip {
  min-width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--dim); font-weight: 700; font-size: 14px; cursor: pointer;
}
.frame-chip.on { background: var(--accent); border-color: var(--accent); color: #14172B; }
.frame-chip.add { color: var(--accent); border-style: dashed; font-size: 18px; }
.play-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #14172B; font-size: 15px; font-weight: 700; flex: none;
}
.play-btn.pulse { animation: pulse 2.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(242,169,0,.45); } 50% { box-shadow: 0 0 0 9px rgba(242,169,0,0); } }

/* ---------- toolbar ---------- */
#toolbar {
  display: flex; align-items: stretch; justify-content: center; gap: 2px;
  padding: 6px 8px calc(8px + var(--sab));
  background: var(--panel); border-top: 1px solid var(--line);
}
.tool {
  flex: 1; max-width: 96px; border: none; background: transparent; color: var(--dim);
  border-radius: 12px; padding: 6px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tool svg { width: 22px; height: 22px; }
.tool span { font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
.tool.on { color: var(--accent); background: rgba(242,169,0,.10); }
.divider { width: 1px; background: var(--line); margin: 6px 4px; }
.hidden { display: none !important; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.sheet-backdrop {
  position: absolute; inset: 0; background: rgba(4,6,18,.66);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s;
}
.sheet-backdrop.dark { background: rgba(5,8,22,.88); }
.sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--panel); border-radius: 22px 22px 0 0;
  padding: 16px 18px calc(20px + var(--sab));
  transform: translateY(105%);
  visibility: hidden;
  transition: transform .25s cubic-bezier(.3,1,.4,1), visibility 0s .25s;
  max-height: 78vh; overflow-y: auto;
  border-top: 1px solid var(--line);
}
.sheet.open .sheet-card { visibility: visible; transition: transform .25s cubic-bezier(.3,1,.4,1); }
.sheet.open { pointer-events: auto; }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-card { transform: translateY(0); }
.sheet-card.narrow { max-width: 420px; margin: 0 auto; }
.sheet-card.center {
  top: 50%; bottom: auto; left: 50%; transform: translate(-50%, -46%) scale(.96);
  width: min(92vw, 400px); border-radius: 22px; text-align: center; opacity: 0;
  transition: opacity .25s, transform .25s;
}
.sheet.open .sheet-card.center { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.sheet-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 17px; font-weight: 700; margin-bottom: 12px;
}
@media (min-width: 720px) {
  .sheet-card { left: 50%; right: auto; transform: translate(-50%, 105%); width: 460px; border-radius: 22px; bottom: 24px; }
  .sheet.open .sheet-card { transform: translate(-50%, 0); }
  .sheet.open .sheet-card.center { transform: translate(-50%, -50%) scale(1); }
  .sheet-card.center { bottom: auto; }

  /* login/criar conta = painel lateral (direita) no desktop */
  #modalAuth .sheet-card {
    top: 0; bottom: 0; left: auto; right: 0;
    width: 420px; max-width: 94vw; height: 100%; max-height: none;
    border-radius: 26px 0 0 26px; padding: 34px 30px calc(30px + var(--sab));
    transform: translateX(106%);
    display: flex; flex-direction: column; justify-content: center;
    box-shadow: -34px 0 90px rgba(0,0,0,.42);
  }
  #modalAuth.open .sheet-card { transform: translateX(0); }
}

/* chips e controles */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button {
  flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--dim); font-weight: 700; cursor: pointer;
}
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #14172B; }
.label { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); margin: 12px 0 7px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip {
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.chip.small { padding: 6px 12px; font-size: 12.5px; flex: none; }
.chip.primary { background: var(--accent); border-color: var(--accent); color: #14172B; }
.chip.danger { color: var(--danger); border-color: rgba(232,76,76,.4); }
.chip.wide { width: 100%; text-align: center; padding: 12px; font-size: 15px; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255,255,255,.25);
}
.swatch.on { border: 3px solid #fff; box-shadow: 0 0 0 2px var(--accent); }
.row-toggle { display: flex; align-items: center; gap: 9px; padding: 12px 0; font-size: 14px; }
.row-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

/* share */
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-btn {
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2);
  color: var(--text); padding: 16px 10px; font-size: 22px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.share-btn b { font-size: 14.5px; }
.share-btn span { font-size: 11px; color: var(--dim); }
.share-btn:active { background: var(--panel); }

/* adicionar */
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.add-btn {
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2);
  color: var(--text); padding: 15px 10px; font-size: 22px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.add-btn b { font-size: 14.5px; }
.add-btn span { font-size: 10.5px; color: var(--dim); }
.add-btn:active { background: var(--panel); }
.hint { font-size: 11.5px; color: var(--dim); margin-top: 12px; line-height: 1.5; text-align: center; }

/* modo apresentação */
#presentBar { display: none; }
body.presenting #topbar,
body.presenting #timeline,
body.presenting #toolbar { display: none; }
body.presenting #presentBar {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  position: fixed; left: 50%; bottom: calc(18px + var(--sab)); transform: translateX(-50%);
  background: rgba(21,28,66,.92); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 12px; z-index: 70; backdrop-filter: blur(10px);
}
#presentBar button {
  border: none; background: transparent; color: var(--text); cursor: pointer;
  font-size: 15px; font-weight: 700; padding: 8px 10px; border-radius: 999px;
}
#presentBar #pPlay { background: var(--accent); color: #14172B; width: 40px; height: 40px; }
#presentBar #pExit { color: var(--dim); font-size: 12.5px; }
#presentBar #pInfo { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; min-width: 42px; text-align: center; }

/* biblioteca */
.lib-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lib-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lib-info b { font-size: 14.5px; }
.lib-info span { font-size: 12px; color: var(--dim); }
.empty { color: var(--dim); text-align: center; padding: 22px 0; font-size: 14px; line-height: 1.6; }
.lib-sec { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); margin: 14px 0 4px; }
.acct { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 6px; }
.acct span { flex: 1; font-size: 12.5px; color: var(--dim); line-height: 1.45; }
.acct b { color: var(--text); font-size: 14px; }
.acct-days { display: inline-block; margin-top: 4px; font-size: 11.5px; font-style: normal; color: var(--accent); font-weight: 600; }
.acct .chip { flex: none; }

/* campos */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--dim); margin-bottom: 14px; }
.field input {
  padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 16px; outline: none;
}
.field input:focus { border-color: var(--accent); }

/* onboarding */
/* tela de boas-vindas */
#welcome {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center; padding: 28px;
  background: radial-gradient(120% 90% at 50% 0%, #1A2352 0%, var(--bg) 60%);
}
#welcome.show { display: flex; }
.wl-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.wl-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.wl-glow.a { width: 60vw; height: 60vw; background: var(--accent); top: -20vw; left: -14vw; opacity: .28; }
.wl-glow.b { width: 50vw; height: 50vw; background: #2B62C9; bottom: -18vw; right: -12vw; opacity: .35; }
.wl-inner { position: relative; text-align: center; max-width: 380px; width: 100%; animation: wlUp .5s cubic-bezier(.2,.9,.3,1); }
/* lockup editorial "sou Futsal" (SF Pro Rounded) */
.logo-lockup {
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  font-weight: 800; letter-spacing: -.035em; line-height: .82;
  color: var(--text); display: inline-block; text-align: left;
}
.wl-emblem { width: min(52vw, 190px); height: auto; margin: 0 auto 14px; display: block; filter: drop-shadow(0 10px 30px rgba(0,0,0,.4)); }
.wl-logolock { font-size: clamp(50px, 15vw, 66px); margin: 6px auto 12px; }
.ll-r1 { display: flex; align-items: center; gap: .14em; }
.ll-ball { width: .58em; height: .58em; color: var(--accent); flex: none; }
.ll-sou { color: var(--text); }
.ll-r2 { display: flex; align-items: flex-start; }
.ll-reg { font-size: .24em; font-weight: 700; letter-spacing: 0; margin: .35em 0 0 .14em; color: var(--dim); }
.wl-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .01em; color: #14172B;
  background: linear-gradient(135deg, var(--accent), #FFD35A);
  padding: 8px 16px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(242,169,0,.4);
  animation: badgePulse 2.6s ease-in-out infinite;
}
.wl-badge b { font-weight: 800; }
@keyframes badgePulse { 0%,100% { box-shadow: 0 8px 24px rgba(242,169,0,.4); } 50% { box-shadow: 0 8px 30px rgba(242,169,0,.65); } }
.wl-congrats { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 8px; }
.wl-tag b { color: var(--text); font-weight: 700; }
.wl-perk {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: rgba(242,169,0,.10); border: 1px solid rgba(242,169,0,.32);
  border-radius: 14px; padding: 12px 14px; margin: 4px 0 22px;
}
.wl-perk-ic { width: 24px; height: 24px; color: var(--accent); flex: none; }
.wl-perk span:last-child { font-size: 12.8px; line-height: 1.45; color: var(--dim); }
.wl-perk b { color: var(--accent); font-weight: 700; }
@keyframes wlUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.wl-brand { display: flex; align-items: center; justify-content: center; gap: 11px; color: var(--accent); margin-bottom: 18px; }
.wl-ball { width: 46px; height: 46px; filter: drop-shadow(0 4px 14px rgba(242,169,0,.35)); }
.wl-name { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: var(--text); }
.wl-name b { color: var(--accent); }
.wl-tag { font-size: 15.5px; line-height: 1.5; color: var(--dim); margin-bottom: 20px; font-weight: 300; }
.wl-feats { display: flex; justify-content: center; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.wl-feats span { font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; }
.wl-cta { display: flex; flex-direction: column; gap: 10px; }
.wl-ghost { background: transparent; border: none; color: var(--dim); font-size: 14px; font-weight: 600; padding: 8px; cursor: pointer; }
.wl-ghost:active { color: var(--text); }
.wl-note { font-size: 11.5px; color: var(--dim); margin-top: 20px; opacity: .8; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: calc(120px + var(--sab)); transform: translateX(-50%) translateY(8px);
  background: #232C5E; color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  z-index: 60; max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
