/* ===================================================
   SPIN & WIN — DESIGN SYSTEM MINIMALISTA
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ------- Variáveis Globais ------- */
:root {
  --bg: #0B0914;
  --surface: #151226;
  --surface2: #1E1A36;
  --border: rgba(255, 255, 255, 0.06);
  --border-hi: rgba(255, 255, 255, 0.12);
  --text: #F8F9FA;
  --muted: rgba(248, 249, 250, 0.5);
  --accent: #6366F1;
  --accent-hi: #818CF8;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
}

/* ------- Reset & Base ------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ------- Cards / Surfaces ------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-sm {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ------- Botões ------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  outline: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hi);
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.06);
}

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-success:hover {
  background: #16a34a;
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* ------- Inputs ------- */
.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.admin-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 10px 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
}

.admin-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.admin-input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

input[type="color"].admin-input {
  padding: 4px;
  height: 44px;
  cursor: pointer;
}

/* ------- Admin Nav (Tabs) ------- */
.admin-nav {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border);
}

.admin-tab {
  flex: 1;
  padding: 9px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
  border: none;
  background: transparent;
  letter-spacing: 0.03em;
  user-select: none;
}

.admin-tab.active {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.admin-tab:hover:not(.active) {
  color: var(--text);
}

/* ------- Badges ------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-accent {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-hi);
}

.badge-green {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
}

.badge-red {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

/* ------- Roleta / Pointer ------- */
#pub-pointer,
.pointer-tri {
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--pointer-color, #fff);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));

  /* Posicionamento sobre a roleta */
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}

/* ------- Botão Girar ------- */
#spin-btn {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-xl);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  padding: 16px 40px;
  font-weight: 900;
  border: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.35);
}

#spin-btn:hover {
  background: var(--accent-hi);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.5);
}

#spin-btn:active {
  transform: scale(0.96);
}

#spin-btn:disabled {
  background: var(--surface2);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* ------- Animação de entrada no Modal ------- */
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pop-in {
  animation: pop-in 0.3s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* ------- Modal Overlay ------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

/* ------- Métricas ------- */
.metric-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ------- Scrollbar ------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ------- Utilidades ------- */
.text-muted {
  color: var(--muted);
}

.text-accent {
  color: var(--accent-hi);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.select-none {
  user-select: none;
}