/* Estilos específicos para o Portal do Consultor (Mobile First) */

/* Tela de espera do portal (neutra, branding Vizio) — bloqueia cadastro até a arena iniciar */
.portal-standby {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, var(--vizio-gold-glow), transparent 55%),
    var(--vizio-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
  padding: 2rem;
  z-index: 50;
}
.portal-standby .ps-brand {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 4px;
  font-size: 2.4rem;
  line-height: 1;
}
.portal-standby .ps-vz { color: var(--vizio-text); }
.portal-standby .ps-cap { color: var(--vizio-gold); }
.portal-standby .ps-msg {
  font-family: var(--font-body);
  color: var(--vizio-text-muted);
  font-size: 1rem;
  letter-spacing: 1px;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: center;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: var(--vizio-gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Card Principal */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Formulário de Registro */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: oklch(0.67 0.18 245);
  box-shadow: 0 0 0 3px oklch(0.67 0.18 245 / 0.25);
}

/* Seleção de Mascotes */
.mascot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.mascot-option {
  background-color: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.mascot-option:hover {
  border-color: var(--text-secondary);
}

.mascot-option.selected {
  border-color: var(--selected-color, oklch(0.67 0.18 245));
  background-color: oklch(from var(--selected-color, oklch(0.67 0.18 245)) 0.2 0.05 h / 0.2);
  transform: scale(1.05);
}

.mascot-option .emoji {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.25rem;
}

.mascot-option .name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Botões */
.btn {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  border: none;
  font-family: var(--font-family);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--vizio-gradient-gold);
  color: var(--vizio-bg);
  box-shadow: 0 4px 18px rgba(201, 168, 76, 0.35);
}

.btn-primary:active {
  transform: scale(0.97);
}

/* Tela Principal do Consultor (Logado) */
.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.user-avatar {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  background-color: var(--user-color-light);
  border: 2px solid var(--user-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--user-color-glow);
}

.user-info h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.user-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Botão Gigante do TA */
.ta-button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
  position: relative;
}

.ta-btn {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle, var(--user-color) 0%, oklch(from var(--user-color) l c h / 0.7) 100%);
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  box-shadow: 0 0 30px var(--user-color-glow), inset 0 4px 10px rgba(255,255,255,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ta-btn:active {
  transform: scale(0.92);
  box-shadow: 0 0 15px var(--user-color-glow), inset 0 2px 5px rgba(0,0,0,0.5);
}

.ta-btn-label {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ta-counter-status {
  text-align: center;
  margin-top: 1rem;
}

.ta-counter-status h3 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--user-color);
  text-shadow: 0 0 10px var(--user-color-glow);
}

.ta-counter-status p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Histórico de TAs do Dia */
.history-section {
  margin-top: 1.5rem;
}

.history-section h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.history-list {
  list-style: none;
  max-height: 150px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-dark);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  border-left: 3px solid var(--user-color);
}

.history-item span {
  font-weight: 600;
}

.history-item time {
  color: var(--text-muted);
}

/* Rodapé / Configurações */
.footer-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 2rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.btn-text:hover {
  color: var(--text-secondary);
}

/* Feedback de Notificação */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--success);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  opacity: 0;
  z-index: 100;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Partículas para animação de clique */
.particle {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  animation: particle-fly 0.6s ease-out forwards;
  z-index: 99;
}

@keyframes particle-fly {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}

/* Seção de Duelo */
.active-duel-box {
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.duel-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.duel-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.duel-versus {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 0.75rem 0;
  gap: 0.5rem;
}

.duel-fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.duel-fighter .mascot {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.duel-fighter .name {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.duel-fighter .score {
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 0.25rem;
}

.duel-vs-divider {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.duel-progress-container {
  margin-top: 0.5rem;
}

.duel-progress-bar-bg {
  height: 8px;
  background-color: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.duel-progress-left {
  height: 100%;
  transition: width 0.3s ease;
}

.duel-progress-right {
  height: 100%;
  transition: width 0.3s ease;
}

/* Barra da Copa (mini HUD no portal) */
.copa-bar-mobile {
  background: linear-gradient(135deg, oklch(0.18 0.06 150) 0%, oklch(0.14 0.04 240) 100%);
  border: 1px solid var(--gold-trophy, oklch(0.80 0.14 85));
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 15px oklch(0.80 0.14 85 / 0.2);
}
.copa-bar-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.copa-bar-emoji { font-size: 1.3rem; }
.copa-bar-name {
  font-weight: 800;
  color: #fff;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}
.copa-bar-hp {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-trophy, oklch(0.80 0.14 85));
  white-space: nowrap;
}
.copa-bar-track {
  height: 10px;
  background-color: oklch(0.10 0.02 260);
  border-radius: 5px;
  overflow: hidden;
}
.copa-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, oklch(0.62 0.16 150), oklch(0.80 0.14 85));
  transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}
.copa-bar-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-weight: 600;
}

/* Barra de meta pessoal */
.personal-goal {
  margin-top: 1rem;
}
.personal-goal-track {
  height: 10px;
  background-color: var(--bg-dark);
  border-radius: 5px;
  overflow: hidden;
}
.personal-goal-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--user-color), var(--success));
  box-shadow: 0 0 8px var(--user-color-glow);
  transition: width 0.4s ease;
}
.personal-goal-text {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ─── Abas de Avatar (Seleções / Bichos) ─────────────────────────────── */
.avatar-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.avatar-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-dark);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-tab.active {
  border-color: var(--gold-trophy, oklch(0.80 0.14 85));
  background-color: oklch(0.80 0.14 85 / 0.12);
  color: var(--gold-trophy, oklch(0.80 0.14 85));
}

.avatar-panel {
  /* visibilidade controlada via style.display no JS */
}

/* ─── Role Badge (titular / reserva) ─────────────────────────────────── */
.role-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.5px;
  margin-top: 0.2rem;
}

.role-titular {
  background-color: oklch(0.78 0.22 142 / 0.18);
  color: oklch(0.78 0.22 142);
  border: 1px solid oklch(0.78 0.22 142 / 0.35);
}

.role-reserva {
  background-color: oklch(0.55 0.01 260 / 0.18);
  color: var(--text-muted);
  border: 1px solid oklch(0.55 0.01 260 / 0.35);
}

/* ─── Flash "GOOOOL!" ─────────────────────────────────────────────────── */
.goal-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, oklch(0.50 0.22 142 / 0.85) 0%, oklch(0.12 0.02 260 / 0.90) 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.goal-flash.active {
  opacity: 1;
}

.goal-flash-text {
  font-family: var(--font-display);
  font-size: clamp(3rem, 18vw, 5rem);
  font-weight: 800;
  color: oklch(0.80 0.14 85);
  letter-spacing: -2px;
  text-shadow: 0 0 30px oklch(0.80 0.14 85 / 0.6), 0 4px 0 oklch(0.30 0.10 85);
  animation: goal-pulse 0.3s ease-out;
}

.goal-flash-name {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 6vw, 2rem);
  font-weight: 600;
  color: #fff;
  margin-top: 0.5rem;
  letter-spacing: 1px;
}

@keyframes goal-pulse {
  0%   { transform: scale(0.5); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ─── Aviso de banco no onboarding ──────────────────────────────────── */
.onboarding-bench-notice {
  background: oklch(0.55 0.01 260 / 0.14);
  border: 1px solid oklch(0.55 0.01 260 / 0.4);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1.25rem;
  text-align: center;
}
.onboarding-bench-notice strong {
  color: var(--text-primary);
}

/* ─── Card de Status em Campo / Banco ───────────────────────────────── */
.field-status-card {
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.field-status {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.field-status-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}

.field-status-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.field-status-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.field-status-label strong {
  color: var(--text-primary);
}

.field-status-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.field-status-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.fstat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fstat-val {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.fstat-key {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.fstat-sep {
  color: var(--border-color);
  font-size: 1.2rem;
  align-self: center;
}

.field-status-cta {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-trophy, oklch(0.80 0.14 85));
  letter-spacing: 0.3px;
}

/* Titular: bordas verdes */
.field-status--titular {
  /* herda do card */
}

.field-status--titular .field-status-card,
.field-status-card:has(.field-status--titular) {
  border-color: oklch(0.78 0.22 142 / 0.5);
  background: linear-gradient(135deg, oklch(0.78 0.22 142 / 0.08), oklch(0.14 0.04 240 / 0.5));
}

.field-status--titular .fstat-val {
  color: oklch(0.78 0.22 142);
  text-shadow: 0 0 8px oklch(0.78 0.22 142 / 0.4);
}

/* Reserva: bordas neutras/amarelas */
.field-status-card:has(.field-status--reserva) {
  border-color: oklch(0.80 0.14 85 / 0.35);
  background: linear-gradient(135deg, oklch(0.80 0.14 85 / 0.06), oklch(0.14 0.04 240 / 0.5));
}

.field-status--reserva .fstat-val {
  color: oklch(0.80 0.14 85);
}

/* ─── Botão secundário (cancelar duelo) ─────────────────────────────── */
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:active {
  transform: scale(0.97);
  background: var(--bg-hover);
}
