/* Início: cabeçalho, cartões principais e medidor do ciclo de empate */

/* ---------- cabeçalho ---------- */
.inicio-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.inicio-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 5px 12px; border-radius: 999px;
  font-size: 10px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase;
  color: #6ee7b7; background: rgba(16, 185, 129, .1); border: 1px solid rgba(16, 185, 129, .28);
}
.inicio-live { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: in-pulse 1.8s infinite; }
@keyframes in-pulse { 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.inicio-title { font-size: clamp(30px, 4vw, 44px); font-weight: 900; letter-spacing: -.03em; line-height: 1; color: #fff; }
.inicio-sub { margin-top: 8px; font-size: 13px; color: rgba(255, 255, 255, .42); }
.inicio-head__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Acertos seguidos: o tom (data-tier) vem de BacBoUI.renderWinStreak */
.inicio-streak {
  --sk: 148, 163, 184;
  display: inline-flex; align-items: center; gap: 14px; padding: 10px 16px 10px 10px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(var(--sk), .14), rgba(var(--sk), .03)), rgba(10, 12, 18, .8);
  border: 1px solid rgba(var(--sk), .32); box-shadow: 0 14px 34px -20px rgba(var(--sk), .8), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: border-color .4s, box-shadow .4s, background .4s;
}
.inicio-streak[data-tier="warm"] { --sk: 251, 191, 36; }
.inicio-streak[data-tier="fire"] { --sk: 52, 211, 153; }
.inicio-streak[data-tier="loss"] { --sk: 248, 113, 113; }
.inicio-streak__flame {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px;
  color: rgb(var(--sk)); background: rgba(var(--sk), .14); border: 1px solid rgba(var(--sk), .4);
  transition: color .4s, background .4s, border-color .4s;
}
.inicio-streak[data-tier="fire"] .inicio-streak__flame { box-shadow: 0 0 22px rgba(var(--sk), .55); animation: in-flame 1.6s ease-in-out infinite; }
@keyframes in-flame { 50% { transform: scale(1.08); box-shadow: 0 0 30px rgba(var(--sk), .8); } }
.inicio-streak__main { display: flex; flex-direction: column; gap: 4px; min-width: 124px; }
.inicio-streak__label, .inicio-streak__best small { font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .42); }
.inicio-streak__row { display: flex; align-items: baseline; gap: 8px; }
.inicio-streak b { font-size: 30px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; color: rgb(var(--sk)); transition: color .4s; }
.inicio-streak__note { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .55); }
.inicio-streak__track { height: 4px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.inicio-streak__track i { display: block; height: 100%; width: 0; border-radius: inherit; background: rgb(var(--sk)); transition: width .7s cubic-bezier(.2, .8, .2, 1), background .4s; }
.inicio-streak__best { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .1); }
.inicio-streak__best strong { font-size: 18px; font-weight: 900; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.inicio-customize {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 12px; cursor: pointer;
  font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); transition: .2s;
}
.inicio-customize:hover { color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); }

/* ---------- cartões principais ---------- */
.inicio-card {
  position: relative; border-radius: 22px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015)),
    rgba(10, 12, 18, .8) !important;
  border: 1px solid rgba(255, 255, 255, .09) !important;
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: border-color .3s, box-shadow .3s, transform .3s;
}
.inicio-card:hover { border-color: rgba(255, 255, 255, .18) !important; }
.inicio-card__label {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: 10px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .5);
}
.inicio-card__label svg { color: var(--theme-primary, #ef4036); }

.inicio-hero {
  background:
    radial-gradient(90% 70% at 0% 0%, rgba(239, 64, 54, .16), transparent 60%),
    radial-gradient(70% 60% at 100% 100%, rgba(99, 102, 241, .1), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .01)),
    rgba(10, 12, 18, .85) !important;
}
.inicio-hero::after { /* faixa de luz no topo */
  content: ''; position: absolute; left: 12%; right: 12%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
}

/* ---------- medidor do ciclo de empate ---------- */
.inicio-tie {
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(245, 158, 11, .12), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .01)),
    rgba(10, 12, 18, .85) !important;
}
.tie-gauge { --tc: #34d399; position: relative; width: 210px; height: 210px; display: grid; place-items: center; }
.tie-gauge--gold { --tc: #fbbf24; }
.tie-gauge--red { --tc: #f87171; }
.tie-gauge__ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--tc) 0, var(--tc) var(--p), rgba(255, 255, 255, .07) var(--p), rgba(255, 255, 255, .07) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 14px), #000 calc(100% - 13px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 14px), #000 calc(100% - 13px));
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--tc) 70%, transparent));
  transition: --p .6s;
}
.tie-gauge::before { /* anel pontilhado girando */
  content: ''; position: absolute; inset: 20px; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .14); animation: in-spin 24s linear infinite;
}
@keyframes in-spin { to { transform: rotate(360deg); } }
.tie-gauge__core { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tie-gauge__num { font-size: 68px; font-weight: 900; line-height: 1; color: var(--tc); text-shadow: 0 0 30px color-mix(in srgb, var(--tc) 60%, transparent); font-variant-numeric: tabular-nums; }
.tie-gauge__core small { font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .4); }
.tie-zone {
  padding: 7px 18px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase;
  color: #34d399; background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .35);
}
.tie-zone--gold { color: #fbbf24; background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .4); }
.tie-zone--red { color: #f87171; background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .5); animation: in-alert 1.2s ease-in-out infinite; }
@keyframes in-alert { 50% { box-shadow: 0 0 22px rgba(248, 113, 113, .55); } }

/* ---------- bead road ---------- */
#bb-beadRoad { padding: 14px; border-radius: 16px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .06); }

@media (max-width: 640px) {
  .tie-gauge { width: 170px; height: 170px; }
  .tie-gauge__num { font-size: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  .inicio-live, .tie-gauge::before, .tie-zone--red, .inicio-streak__flame { animation: none !important; }
}

/* ---------- "Entrei neste sinal" ---------- */
.inicio-follow { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.inicio-follow small { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .4); }
.inicio-follow small.hidden, .inicio-follow__btn.hidden { display: none; }
.inicio-follow__btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px; cursor: pointer;
  font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #05070b;
  background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 10px 26px -10px rgba(245, 158, 11, .8); border: 0; transition: transform .2s;
}
.inicio-follow__btn:hover:not(:disabled) { transform: translateY(-2px); }
.inicio-follow__btn:disabled { cursor: default; color: #6ee7b7; background: rgba(16, 185, 129, .14); box-shadow: none; border: 1px solid rgba(16, 185, 129, .4); }

/* ---------- Controle de Sessão ---------- */
.session-card { display: flex; flex-direction: column; gap: 18px; }
.session-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.session-help { margin-top: 8px; max-width: 34ch; font-size: 12px; line-height: 1.55; color: rgba(255, 255, 255, .5); }
.session-help b { color: #fde68a; }
.session-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
}
.session-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.session-card[data-state="on"] .session-pill { color: #6ee7b7; background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .4); }
.session-card[data-state="on"] .session-dot { background: #34d399; animation: in-pulse 1.6s infinite; }

.session-timer-wrap { display: flex; align-items: baseline; gap: 12px; }
.session-timer { font-size: clamp(34px, 5vw, 48px); font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; color: rgba(255, 255, 255, .35); }
.session-card[data-state="on"] .session-timer { color: #fff; text-shadow: 0 0 30px rgba(52, 211, 153, .35); }
.session-timer-wrap small { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .35); }

.session-score { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.session-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.session-tile small { font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1.3; color: rgba(255, 255, 255, .42); }
.session-tile b { font-size: 26px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; }
.session-tile--win b { color: #34d399; } .session-tile--gale b { color: #fbbf24; } .session-tile--loss b { color: #f87171; } .session-tile--pts b { color: #67e8f9; }
.session-bump { animation: session-bump .5s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes session-bump { 40% { transform: scale(1.35); } }

.session-rate { display: flex; flex-direction: column; gap: 8px; }
.session-rate__bar { height: 8px; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.session-rate__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: #f87171; transition: width .8s cubic-bezier(.2, .8, .2, 1), background .4s; }
.session-rate__bar i[data-tone="mid"] { background: #fbbf24; } .session-rate__bar i[data-tone="good"] { background: #34d399; box-shadow: 0 0 12px rgba(52, 211, 153, .6); }
.session-rate span { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .5); }

.session-open { padding: 8px 12px; border-radius: 10px; font-size: 11px; font-weight: 800; color: #fcd34d; background: rgba(245, 158, 11, .1); border: 1px dashed rgba(245, 158, 11, .4); }
.session-open.hidden, .session-money.hidden, .session-summary.hidden { display: none; }

.session-money { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .08); }
.session-money small { display: block; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .4); }
.session-money b { font-size: 18px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.session-money b.is-up { color: #34d399; } .session-money b.is-down { color: #f87171; }

.session-btn {
  width: 100%; padding: 16px; border-radius: 14px; border: 0; cursor: pointer; margin-top: auto;
  font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: #fff;
  background: linear-gradient(135deg, var(--theme-primary, #ef4036), #ff7a45); box-shadow: 0 14px 30px -14px rgba(239, 64, 54, .8); transition: transform .2s, filter .2s;
}
.session-btn:hover:not(:disabled) { transform: translateY(-2px); }
.session-btn:disabled { opacity: .6; cursor: wait; }
.session-btn.is-stop { background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .45); color: #fca5a5; box-shadow: none; }
.session-btn.is-locked { background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .45); box-shadow: none; cursor: default; }

.session-summary { padding: 12px 14px; border-radius: 12px; font-size: 12px; line-height: 1.6; color: rgba(255, 255, 255, .7); background: rgba(16, 185, 129, .08); border: 1px solid rgba(16, 185, 129, .3); }
.session-summary b { color: #fff; }

/* ---------- resultado do sinal: GREEN / LOSS / EMPATE ---------- */
.inicio-result {
  --rc: #34d399; --rc-rgb: 52, 211, 153;
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 0;
  animation: res-in .55s cubic-bezier(.2, 1.4, .4, 1) both;
}
.inicio-result.hidden { display: none; }
.inicio-result--loss { --rc: #f87171; --rc-rgb: 248, 113, 113; animation: res-in .45s cubic-bezier(.2, 1, .4, 1) both, res-shake .5s .1s both; }
.inicio-result--tie { --rc: #fbbf24; --rc-rgb: 251, 191, 36; }
.inicio-result::before { /* clarão de fundo */
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 24px;
  background: radial-gradient(60% 70% at 50% 40%, rgba(var(--rc-rgb), .22), transparent 70%);
  animation: res-flash 1.2s ease-out both;
}
.inicio-result__badge {
  position: relative; display: grid; place-items: center; width: 96px; height: 96px; margin-bottom: 28px; border-radius: 50%;
  color: var(--rc); background: rgba(var(--rc-rgb), .14); border: 1px solid rgba(var(--rc-rgb), .45);
  box-shadow: 0 0 44px rgba(var(--rc-rgb), .35);
}
.inicio-result__badge svg { animation: res-icon .7s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.inicio-result__ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--rc); opacity: 0; animation: res-ring 1.3s ease-out 2; }
.inicio-result__ring--2 { animation-delay: .35s; }
.inicio-result__title {
  font-size: clamp(48px, 7vw, 72px); font-weight: 900; font-style: italic; letter-spacing: -.03em; line-height: 1; color: var(--rc);
  text-shadow: 0 0 34px rgba(var(--rc-rgb), .55); animation: res-title .6s .1s cubic-bezier(.2, 1.3, .4, 1) both;
}
.inicio-result__sub { margin-top: 22px; font: 700 10px/1 ui-monospace, monospace; letter-spacing: .45em; text-transform: uppercase; color: rgba(255, 255, 255, .42); animation: res-fade .6s .35s both; }
.inicio-result__confetti { position: absolute; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; }
.inicio-result__confetti i {
  position: absolute; width: 7px; height: 12px; border-radius: 2px; background: #34d399; opacity: 0;
  animation: res-confetti 1.3s var(--d, 0s) cubic-bezier(.15, .7, .3, 1) both;
}
.inicio-result__confetti i:nth-child(3n) { background: #fde68a; } .inicio-result__confetti i:nth-child(3n+1) { background: #6ee7b7; } .inicio-result__confetti i:nth-child(4n) { background: #fff; width: 5px; height: 5px; border-radius: 50%; }
@keyframes res-in { from { opacity: 0; transform: scale(.88); } }
@keyframes res-flash { from { opacity: 1; } to { opacity: .35; } }
@keyframes res-icon { from { transform: scale(0) rotate(-40deg); } }
@keyframes res-title { from { opacity: 0; transform: translateY(14px) scale(.9); } }
@keyframes res-fade { from { opacity: 0; } }
@keyframes res-ring { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(2.1); } }
@keyframes res-shake { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes res-confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.6); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 150px)) rotate(var(--r)) scale(1); }
}

/* aviso flutuante "+ GREEN" (criado por App.showWinPopup) */
.win-popup {
  position: fixed; top: 22px; right: 22px; z-index: 9999; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px;
  color: #052e1c; background: linear-gradient(135deg, #6ee7b7, #34d399); box-shadow: 0 16px 40px -12px rgba(16, 185, 129, .7);
  opacity: 0; pointer-events: none; transform: translateY(-16px) scale(.95); transition: opacity .3s, transform .35s cubic-bezier(.2, 1.4, .4, 1);
}
.win-popup.show { opacity: 1; transform: none; }
.win-popup svg { width: 20px; height: 20px; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .inicio-head { align-items: stretch; }
  .inicio-head__actions { width: 100%; }
  .inicio-streak { flex: 1; }
  .inicio-customize { flex: 1; justify-content: center; min-height: 44px; }
  .inicio-card { border-radius: 18px !important; }

  .inicio-result { padding: 32px 8px; text-align: center; }
  .inicio-result__badge { width: 80px; height: 80px; margin-bottom: 20px; }
  .inicio-result__sub { margin-top: 16px; letter-spacing: .22em; line-height: 1.7; font-size: 10px; }
  .inicio-result__confetti { transform: scale(.7); }

  .inicio-follow { flex-direction: column; align-items: stretch; }
  .inicio-follow__btn { width: 100%; justify-content: center; min-height: 48px; }
  .inicio-follow small { text-align: center; }

  .session-help { max-width: none; }
  .session-head { flex-wrap: wrap; }
  .session-tile small, .session-money small, .inicio-streak__label, .inicio-streak__best small { font-size: 10px; }
  .inicio-streak__main { flex: 1; }
  .session-btn { min-height: 52px; }

  /* aviso "+ GREEN" abaixo do cabeçalho, largura da tela */
  .win-popup { top: calc(56px + env(safe-area-inset-top)); left: 12px; right: 12px; justify-content: center; }
}
@media (max-width: 520px) { .session-score { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) {
  .session-bump, .session-card[data-state="on"] .session-dot { animation: none; }
  .inicio-result, .inicio-result::before, .inicio-result__badge svg, .inicio-result__ring, .inicio-result__title, .inicio-result__sub { animation: none; }
  .inicio-result__confetti { display: none; }
  .win-popup { transition: opacity .2s; transform: none; }
}
