/* ═══════════════════════════════════════════════════════════
   RegrasFABR — Design System Compartilhado
   Tokens, Topbar, Logo, Firebase Auth UI
   v2026.4.0.0
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange:      #C87A08;
  --orange-dim:  #9E6006;
  --orange-bg:   rgba(200,122,8,.12);
  --orange-lite: #FFF3EC;
  --dark:        #0D0D0D;
  --dark-panel:  #141414;
  --dark-border: #242424;
  --dark-2:      #1A1A1A;
  --light:       #FAFAF8;
  --bg:          #F2EEE7;
  --t1: #111111;
  --t2: #555555;
  --t3: #999999;
  --border: #E2DDD5;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Courier New', monospace;
  --radius: 8px;
  --topbar-h: 56px;
}

html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--t1); }

/* ── Logo mark ── */
.logo-mark {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: #006B2B;
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0;
}
.logo-mark-r {
  font-family: var(--font);
  font-weight: 800; font-size: 17px;
  color: #FFE234; line-height: 1;
}
.logo-mark-dot {
  position: absolute; top: 3px; right: 3px;
  width: 8px; height: 8px;
  border-radius: 50%; background: #002776;
}
.logo-name {
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.3px;
}

/* ── Topbar ── */
#topbar-global {
  height: var(--topbar-h);
  display: flex; align-items: center;
  padding: 0 28px; gap: 4px;
  position: sticky; top: 0; z-index: 500;
  font-family: var(--font);
}
#topbar-global.dark {
  background: var(--dark);
  border-bottom: 1px solid var(--dark-border);
}
#topbar-global.light {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.tb-logo {
  display: flex; align-items: center; gap: 9px;
  margin-right: 36px; text-decoration: none;
  flex-shrink: 0;
}
.dark .tb-logo .logo-name { color: #fff; }
.light .tb-logo .logo-name { color: var(--t1); }

.tb-nav {
  display: flex; gap: 2px; flex: 1;
}
.tb-nav-item {
  padding: 6px 14px; border-radius: 6px;
  font-size: 14px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, background .15s;
}
.dark .tb-nav-item         { color: #666; }
.dark .tb-nav-item:hover   { color: #bbb; }
.dark .tb-nav-item.active  { color: var(--orange); border-bottom-color: var(--orange); font-weight: 600; }
.light .tb-nav-item        { color: var(--t2); }
.light .tb-nav-item:hover  { color: var(--t1); background: var(--bg); }
.light .tb-nav-item.active { color: var(--orange); border-bottom-color: var(--orange); font-weight: 600; }

.tb-right {
  display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0;
}

/* Split view toggle — inline in nav between Livro and Mecânicas */
.tb-split-btn {
  height: 30px; padding: 0 9px;
  border-radius: 6px; cursor: pointer;
  display: flex; /* always visible when in the DOM */
  align-items: center; justify-content: center; gap: 3px;
  transition: all .15s; opacity: .8;
}
.tb-split-btn:hover { opacity: 1; }
.dark  .tb-split-btn { border: 1px dashed #444; background: none; }
.light .tb-split-btn { border: 1px dashed #ccc; background: none; }
.tb-split-btn.active  { background: var(--orange-bg) !important; border-color: var(--orange) !important; border-style: solid !important; opacity: 1; }
.tb-split-bar {
  width: 9px; height: 14px; border-radius: 1.5px;
}
.tb-split-bar.dim { opacity: .5; }
.dark  .tb-split-bar { background: #555; }
.light .tb-split-bar { background: #aaa; }
.tb-split-btn.active .tb-split-bar { background: var(--orange) !important; opacity: 1 !important; }
.tb-split-divider { width: 1px; height: 14px; }
.dark  .tb-split-divider { background: #444; }
.light .tb-split-divider { background: var(--border); }

/* Auth button */
#auth-btn {
  border-radius: 6px; padding: 6px 18px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  font-family: var(--font);
  transition: all .15s;
  display: flex; align-items: center; gap: 8px;
}
.dark  #auth-btn { border: 1.5px solid #333; color: #888; background: none; }
.dark  #auth-btn:hover { border-color: #555; color: #ccc; }
.light #auth-btn { border: 1.5px solid var(--orange); color: var(--orange); background: none; }
.light #auth-btn:hover { background: var(--orange-lite); }

.auth-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}

/* ── Auth Modal ── */
#auth-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7); z-index: 1000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
#auth-modal-overlay.open { display: flex; }

#auth-modal {
  background: rgba(20,20,20,.95);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px; padding: 48px 52px;
  width: 440px; max-width: 95vw;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  animation: modal-in .2s ease;
}
@keyframes modal-in {
  from { opacity:0; transform: scale(.95) translateY(8px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
#auth-modal .logo-mark { width: 48px; height: 48px; border-radius: 10px; margin-bottom: 20px; }
#auth-modal .logo-mark-r { font-size: 24px; }
#auth-modal h2 {
  font-size: 24px; font-weight: 800; color: #fff;
  letter-spacing: -.5px; text-align: center; margin-bottom: 8px;
}
#auth-modal p {
  font-size: 14px; color: #555; text-align: center;
  line-height: 1.6; margin-bottom: 32px;
}
.auth-provider-btn {
  width: 100%; border-radius: 10px; padding: 14px 20px;
  display: flex; align-items: center; justify-content: center;
  gap: 12px; cursor: pointer; font-size: 15px; font-weight: 600;
  font-family: var(--font); transition: all .15s; margin-bottom: 10px;
  border: none;
}
.auth-provider-btn.google { background: #fff; color: #111; }
.auth-provider-btn.google:hover { background: #f5f5f5; }
.auth-provider-btn.discord {
  background: transparent;
  border: 1px solid rgba(255,255,255,.1);
  color: #666;
}
.auth-modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: #444;
  font-size: 20px; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: color .15s;
}
.auth-modal-close:hover { color: #888; }
#auth-modal-overlay { position: fixed; }
#auth-modal { position: relative; }
.auth-terms {
  font-size: 11px; color: #333; text-align: center;
  margin-top: 20px; line-height: 1.7;
}
.auth-terms a { color: #555; }

/* ── Gradient hero ── */
.gradient-hero {
  position: relative; overflow: hidden;
  background: #060F08;
}
.gradient-hero .blob {
  position: absolute; border-radius: 50%;
  pointer-events: none;
}
.gradient-hero .content {
  position: relative; z-index: 1;
}

/* ── Utility ── */
.pill {
  display: inline-flex; align-items: center;
  border-radius: 20px; padding: 5px 16px;
  font-size: 12px; font-weight: 600;
  letter-spacing: .05em;
}


/* ══════════════════════════════════════════════════════
   Auth modal v2 — email tab, user menu
══════════════════════════════════════════════════════ */

#auth-modal-body { display: flex; flex-direction: column; text-align: center; width: 100%; }
#auth-modal-body h2 { font-size: 20px; font-weight: 800; color: #eee; margin-bottom: 6px; }
#auth-modal-body p  { font-size: 13px; color: #888; margin-bottom: 20px; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 0; color: #444; font-size: 11px;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08); }

.auth-provider-btn.email {
  background: none;
  border: 1.5px solid rgba(255,255,255,.12);
  color: #888;
}
.auth-provider-btn.email:hover { background: rgba(255,255,255,.05); }

.auth-label {
  font-size: 12px; font-weight: 600; color: #555;
  display: block; text-align: left; margin-bottom: 6px;
}
.auth-input {
  width: 100%; background: #fff;
  border: 1px solid #E2DDD5; border-radius: 8px;
  padding: 11px 14px; font-size: 14px;
  font-family: inherit; color: #111; outline: none;
  display: block;
}
.auth-input:focus { border-color: #C87A08; }

/* ── Onboarding overlay ── */
#onboarding-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.6);
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  padding: 16px;
}
#onboarding-modal {
  background: #fff; border-radius: 20px;
  padding: 40px 44px;
  width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
  font-family: var(--font);
}
/* ══════════════════════════════════════════════════════
   Mobile topbar — burger menu → left sidebar
══════════════════════════════════════════════════════ */

#mobile-nav-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 40px; height: 48px;
  align-items: center; justify-content: center;
  color: var(--t2); flex-shrink: 0;
  padding: 0;
}

/* Dark overlay behind sidebar */
#mobile-nav-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: none;
}
#mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar sliding in from the left */
#mobile-nav-menu {
  display: none;
  position: fixed; top: 0; right: 0; bottom: 0;
  z-index: 800;
  width: 272px;
  background: #fff;
  box-shadow: -4px 0 32px rgba(0,0,0,.12);
  overflow-y: auto;
  font-family: var(--font);
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.25,.46,.45,.94);
  flex-direction: column;
}
#mobile-nav-menu.open {
  transform: translateX(0);
}

/* Sidebar header with logo */
.mnav-header {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.mnav-logo-name {
  font-size: 15px; font-weight: 800; color: var(--t1); letter-spacing: -.3px;
}
.mnav-close {
  position: absolute; top: 16px; right: 14px;
  width: 28px; height: 28px; border-radius: 7px;
  border: none; background: var(--bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--t3); font-size: 17px; line-height: 1;
}

/* Nav items */
.mnav-section { padding: 8px 0; border-bottom: 1px solid var(--border); }
.mnav-section:last-child { border-bottom: none; flex: 1; }
.mnav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--t3); padding: 6px 20px 2px; text-transform: uppercase;
}
.mnav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px;
  font-size: 15px; font-weight: 500;
  color: var(--t1); text-decoration: none;
  transition: background .1s;
  position: relative;
}
.mnav-item:active, .mnav-item:hover { background: var(--bg); }
.mnav-item.active {
  color: var(--orange); font-weight: 700; background: #FFF6EC;
}
.mnav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--orange);
}
.mnav-item-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--t3);
}
.mnav-item.active .mnav-item-icon { color: var(--orange); }

@media (max-width: 800px) {
  #mobile-nav-btn { display: flex; }
  #mobile-nav-overlay { display: block; }
  #mobile-nav-menu { display: flex; }
  #topbar-global .tb-nav { display: none !important; }
  #auth-btn .tb-auth-name,
  #auth-btn .tb-auth-chevron { display: none; }
  #topbar-global { padding: 0 14px; }
}
@media (min-width: 801px) {
  #mobile-nav-btn     { display: none !important; }
  #mobile-nav-overlay { display: none !important; }
  #mobile-nav-menu    { display: none !important; }
}

@media (max-width: 600px) {
  #onboarding-modal { padding: 28px 20px; }
  #auth-modal { padding: 32px 24px; }
  #auth-modal-body { width: 100%; }
}
.ob-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: #FFF3EC;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.ob-label {
  font-size: 12px; font-weight: 700; color: #999;
  letter-spacing: .06em; display: block; margin-bottom: 6px;
}
.ob-input {
  border: 1px solid #E2DDD5; border-radius: 8px;
  padding: 11px 14px; font-size: 14px;
  font-family: inherit; color: #111; outline: none;
  display: block;
}
.ob-input:focus { border-color: #C87A08; }
.ob-check-row {
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; margin-bottom: 14px;
}
.ob-check-box {
  width: 20px; height: 20px; border-radius: 4px;
  border: 1.5px solid #E2DDD5;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
  transition: all .15s;
}
.ob-check-box.checked {
  background: #006B2B; border-color: #006B2B;
}

/* ── Configurações overlay ── */
#config-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.5);
  align-items: center; justify-content: center;
  padding: 16px;
}
#config-modal {
  background: #FAFAF8; border-radius: 20px;
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font);
  box-shadow: 0 16px 48px rgba(0,0,0,.2);
}
.cfg-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #E2DDD5;
}
.cfg-section {
  background: #fff; border: 1px solid #E2DDD5;
  border-radius: 14px; padding: 20px 24px;
  margin: 0 20px 12px;
}
.cfg-section-label {
  font-size: 11px; font-weight: 700; color: #999;
  letter-spacing: .07em; margin-bottom: 14px;
}
.cfg-input {
  border: 1px solid #E2DDD5; border-radius: 8px;
  padding: 10px 12px; font-size: 14px;
  font-family: inherit; color: #111; outline: none;
}
.cfg-input:focus { border-color: #C87A08; }
.cfg-input:disabled {
  background: #F5F2EC; color: #999; cursor: not-allowed;
  border-color: #E2DDD5;
}
.cfg-toggle-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 18px;
}
.cfg-toggle-row:last-child { margin-bottom: 0; }
.cfg-toggle {
  width: 40px; height: 22px; border-radius: 11px;
  background: #ddd; cursor: pointer; position: relative;
  transition: background .2s; flex-shrink: 0;
  border: none; padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.cfg-toggle.on { background: #006B2B; }
.cfg-toggle::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  pointer-events: none;
}
.cfg-toggle.on::after { left: 21px; }
@media (max-width: 700px) {
  .cfg-toggle {
    width: 48px; height: 28px; border-radius: 14px;
    min-width: 48px; /* prevent shrinking */
  }
  .cfg-toggle::after {
    top: 4px; left: 4px;
    width: 20px; height: 20px;
  }
  .cfg-toggle.on::after { left: 24px; }
  /* Larger touch area for the whole row */
  .cfg-toggle-row { min-height: 44px; align-items: center; }
}
