/* ════════════════════════════════════
   ICONS (Lucide)
   ════════════════════════════════════ */

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  vertical-align: middle;
}

.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 40px; height: 40px; stroke-width: 1.5; }

/* ════════════════════════════════════
   BUTTONS
   Uso: <button class="btn btn-primary shape-a">
        <div class="btn-frame shape-b"><button class="btn btn-ghost">
   ════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  clip-path: var(--clip-A);
  transition: filter var(--t-fast), transform var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); filter: brightness(0.88) !important; }
.btn:disabled { opacity: 0.35; pointer-events: none; }

/* Shapes */
.shape-a  { clip-path: var(--clip-A); }
.shape-b  { clip-path: var(--clip-B); }
.shape-c  { clip-path: var(--clip-C); }
.shape-d  { clip-path: var(--clip-D); }

/* Sizes */
.btn-lg   { font-size: 17px; padding: 0 32px; height: 52px; }
.btn-md   { font-size: 16px; padding: 0 28px; height: 48px; }
.btn-sm   { font-size: 12px; padding: 0 14px; height: 34px; clip-path: var(--clip-A-sm); }

.shape-a.btn-sm { clip-path: var(--clip-A-sm); }
.shape-b.btn-sm { clip-path: var(--clip-B-sm); }
.shape-c.btn-sm { clip-path: var(--clip-C-sm); }
.shape-d.btn-sm { clip-path: var(--clip-D-sm); }

/* Color variants */
.btn-primary {
  background: linear-gradient(90deg, var(--accent-yellow), var(--accent-orange));
  color: var(--bg-base);
  filter: drop-shadow(0 0 8px rgba(255,215,0,0.5)) drop-shadow(0 0 18px rgba(255,215,0,0.2));
}
.btn-primary:hover {
  filter: drop-shadow(0 0 12px rgba(255,215,0,0.75)) drop-shadow(0 0 24px rgba(255,215,0,0.4));
}

.btn-secondary {
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-light));
  color: #fff;
  filter: drop-shadow(0 0 8px rgba(91,63,214,0.6)) drop-shadow(0 0 18px rgba(91,63,214,0.25));
}
.btn-secondary:hover {
  filter: drop-shadow(0 0 12px rgba(91,63,214,0.85)) drop-shadow(0 0 24px rgba(91,63,214,0.4));
}

.btn-danger {
  background: linear-gradient(90deg, #C0183A, var(--accent-pink));
  color: #fff;
  filter: drop-shadow(0 0 8px rgba(255,45,120,0.5));
}
.btn-danger:hover {
  filter: drop-shadow(0 0 12px rgba(255,45,120,0.75));
}

.btn-cyan {
  background: linear-gradient(90deg, var(--brand-dark), var(--accent-cyan));
  color: var(--bg-base);
  filter: drop-shadow(0 0 8px rgba(0,229,255,0.45)) drop-shadow(0 0 18px rgba(0,229,255,0.2));
}
.btn-cyan:hover {
  filter: drop-shadow(0 0 12px rgba(0,229,255,0.7)) drop-shadow(0 0 24px rgba(0,229,255,0.35));
}

/* Ghost — requer wrapper .btn-frame */
.btn-frame {
  display: inline-block;
  padding: 1px;
  clip-path: var(--clip-A);
  background: var(--border-default);
  transition: filter var(--t-fast);
}
.btn-frame:hover { filter: drop-shadow(0 0 6px rgba(176,174,207,0.3)); }
.btn-frame.shape-a { clip-path: var(--clip-A); }
.btn-frame.shape-b { clip-path: var(--clip-B); }
.btn-frame.shape-c { clip-path: var(--clip-C); }
.btn-frame.shape-d { clip-path: var(--clip-D); }
.btn-frame.btn-sm  { clip-path: var(--clip-A-sm); }

.btn-ghost {
  background: var(--bg-base);
  color: var(--text-secondary);
}
.btn-ghost.btn-lg { height: 50px; }
.btn-ghost.btn-md { height: 46px; }
.btn-ghost.btn-sm { height: 32px; clip-path: var(--clip-A-sm); }

/* Full-width helper */
.btn-block { width: 100%; }
.btn-frame.btn-block { display: block; }
.btn-frame.btn-block .btn { width: 100%; }

/* ════════════════════════════════════
   INPUTS
   ════════════════════════════════════ */

.input-group { display: flex; flex-direction: column; gap: var(--space-2); }

.input-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 var(--space-4);
  height: 48px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
}

.input:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(91,63,214,0.2);
}

.input::placeholder { color: var(--text-muted); }

.input-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

.input-row .input { flex: 1; }

/* Number input */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ════════════════════════════════════
   CARDS
   ════════════════════════════════════ */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-card), var(--inner-glow);
}

.card-featured {
  background: linear-gradient(135deg, var(--bg-surface-2), var(--bg-overlay));
  border: 1px solid rgba(91,63,214,0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-card), var(--glow-purple);
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

/* ════════════════════════════════════
   BADGES
   ════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  line-height: 1;
}

.badge-yellow { background: var(--accent-yellow); color: var(--bg-base); }
.badge-purple { background: rgba(91,63,214,0.3); color: #B09AFF; border: 1px solid rgba(91,63,214,0.4); }
.badge-live   {
  background: rgba(255,45,120,0.2);
  color: var(--accent-pink);
  border: 1px solid rgba(255,45,120,0.4);
}
.badge-live::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-pink);
  border-radius: var(--radius-full);
  box-shadow: var(--glow-pink);
  animation: glow-pulse 1.6s ease infinite;
}
.badge-green  { background: rgba(57,255,20,0.15); color: var(--accent-green); border: 1px solid rgba(57,255,20,0.35); }
.badge-muted  { background: rgba(107,104,148,0.2); color: var(--text-muted); border: 1px solid rgba(107,104,148,0.2); }

/* ════════════════════════════════════
   AVATAR
   ════════════════════════════════════ */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--brand-purple);
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-secondary);
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar-sm { width: 28px; height: 28px; font-size: 11px; border-width: 1.5px; }
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }

.avatar-yellow { border-color: var(--accent-yellow); box-shadow: 0 0 10px rgba(255,215,0,0.4); }
.avatar-purple { border-color: var(--brand-purple);  box-shadow: 0 0 10px rgba(91,63,214,0.4); }

/* ════════════════════════════════════
   PLAYER LIST ITEM
   ════════════════════════════════════ */

.player-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-fast);
  animation: card-enter 0.2s ease both;
}

.player-item:hover { border-color: rgba(91,63,214,0.4); }

.player-item-name {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.player-item-action {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: var(--space-1);
  transition: color var(--t-fast);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.player-item-action:hover { color: var(--accent-pink); }

/* ════════════════════════════════════
   TEAM CARD
   ════════════════════════════════════ */

.team-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.team-card-header {
  padding: var(--space-3) var(--space-4);
  background: rgba(91,63,214,0.15);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.team-card-header.team-a-header {
  background: rgba(255,215,0,0.08);
  border-bottom-color: rgba(255,215,0,0.15);
}

.team-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: 1;
}

.team-card-title.title-a { color: var(--accent-yellow); }
.team-card-title.title-b { color: var(--brand-light); }

.team-card-body {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.team-player-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ════════════════════════════════════
   MATCH ARENA (tela de partida)
   ════════════════════════════════════ */

.match-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-3);
  align-items: stretch;
  margin-bottom: var(--space-5);
}

.vs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: var(--space-5);
  gap: var(--space-2);
}

.vs-label {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.match-result-btns {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* ════════════════════════════════════
   QUEUE ITEM
   ════════════════════════════════════ */

.queue-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  animation: card-enter 0.2s ease both;
}

.queue-position {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.queue-position.pos-1 { color: var(--accent-yellow); text-shadow: 0 0 8px rgba(255,215,0,0.5); }

.queue-players {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ════════════════════════════════════
   SORTEIO — stepper visual
   ════════════════════════════════════ */

.sorteio-config {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.qty-btn {
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.qty-btn:hover { background: rgba(91,63,214,0.2); color: var(--text-primary); }
.qty-btn:active { background: rgba(91,63,214,0.4); }

.qty-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-yellow);
  min-width: 40px;
  text-align: center;
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
}

.sorteio-info {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

/* ════════════════════════════════════
   COUNTER / STAT
   ════════════════════════════════════ */

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  flex: 1;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--accent-yellow);
  text-shadow: 0 0 12px rgba(255,215,0,0.4);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ════════════════════════════════════
   RANKING SCREEN
   ════════════════════════════════════ */

.sort-chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.chip {
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.chip-active {
  border-color: var(--accent-cyan);
  background: color-mix(in srgb, var(--accent-cyan) 15%, transparent);
  color: var(--accent-cyan);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: none;
  border-bottom: 1px solid var(--border-default);
  border-left: 3px solid var(--border-default);
  background: transparent;
  transition: background 0.15s;
  cursor: pointer;
}

.ranking-row:last-child { border-bottom: none; }
.ranking-row:hover { background: var(--bg-surface-2); }

/* Destaque por posição */
.ranking-rank-1 {
  border-left-color: var(--accent-yellow);
  background: color-mix(in srgb, var(--accent-yellow) 6%, transparent);
}
.ranking-rank-2 { border-left-color: #B8C4D4; }
.ranking-rank-3 { border-left-color: #C88B50; }

.ranking-pos {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  min-width: 30px;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ranking-rank-1 .ranking-pos { color: var(--accent-yellow); text-shadow: 0 0 10px rgba(255,215,0,.5); }
.ranking-rank-2 .ranking-pos { color: #B8C4D4; }
.ranking-rank-3 .ranking-pos { color: #C88B50; }

.ranking-nome {
  flex: 1;
  font-weight: 600;
  text-align: start;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-stats {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.ranking-stat {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 2px 5px;
}

.icon-xs {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
