/* ============================================================
   BOLÃO COPA 2026 — RadarFin Design System
   ============================================================ */

:root {
  --teal:        #00C5B4;
  --teal-dark:   #00A89A;
  --teal-light:  rgba(0, 197, 180, 0.08);
  --teal-mid:    rgba(0, 197, 180, 0.15);
  --black:       #0A0A0A;
  --white:       #FFFFFF;
  --gray-dark:   #222222;
  --gray-mid:    #555555;
  --gray-light:  #CCCCCC;
  --gray-bg:     #F5F5F5;
  --gray-border: #E8E8E8;
  --red:         #E53935;
  --green:       #16A34A;
  --gold:        #D97706;
  --silver:      #64748B;
  --bronze:      #92400E;

  --text-primary:   #0A0A0A;
  --text-secondary: #555555;
  --text-muted:     #AAAAAA;
  --bg:             #F5F5F5;
  --surface:        #FFFFFF;
  --border:         #E8E8E8;

  --success: #16A34A;
  --error:   #E53935;
  --warning: #D97706;

  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;
  --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 24px rgba(0,0,0,0.10);
  --transition:   0.18s ease;
  --max-width:    680px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.page { padding-bottom: 100px; }

/* ── Header ── */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-wordmark {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--black);
  line-height: 1;
}

.logo-wordmark span { color: var(--teal); }

.logo-divider {
  display: block;
  width: 1px;
  height: 18px;
  background: var(--border);
}

.logo-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.nav { display: flex; gap: 2px; }

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav a:hover {
  color: var(--text-primary);
  background: var(--gray-bg);
}

.nav a.active {
  color: var(--teal);
  background: var(--teal-light);
  font-weight: 600;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 12px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  min-height: 42px;
  font-family: inherit;
  letter-spacing: -0.1px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 197, 180, 0.35);
}

.btn-secondary {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-bg);
  border-color: var(--gray-light);
}

.btn-danger {
  background: rgba(229, 57, 53, 0.07);
  border: 1px solid rgba(229, 57, 53, 0.2);
  color: var(--red);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(229, 57, 53, 0.13);
}

.btn-success {
  background: rgba(22, 163, 74, 0.07);
  border: 1px solid rgba(22, 163, 74, 0.2);
  color: var(--success);
}

.btn-sm  { padding: 6px 12px; font-size: 12px; min-height: 32px; }
.btn-full { width: 100%; }

/* ── Inputs ── */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
input[type="file"],
textarea,
select {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  padding: 10px 14px;
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 197, 180, 0.12);
}

input[type="file"] { padding: 8px 12px; cursor: pointer; }
input::placeholder { color: var(--text-muted); }
select option { background: var(--white); color: var(--text-primary); }

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

/* ── Score Inputs ── */
.score-input {
  width: 52px !important;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--gray-bg) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 0 !important;
  appearance: textfield;
  -moz-appearance: textfield;
  transition: var(--transition);
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.score-input:focus {
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 3px rgba(0, 197, 180, 0.12) !important;
  background: var(--white) !important;
  color: var(--teal) !important;
}

.score-input:disabled {
  color: var(--text-muted);
  border-color: var(--border) !important;
  background: var(--gray-bg) !important;
  cursor: not-allowed;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-open   { background: rgba(22,163,74,0.10);   color: var(--success);  border: 1px solid rgba(22,163,74,0.20); }
.badge-closed { background: var(--gray-bg);          color: var(--gray-mid); border: 1px solid var(--border); }
.badge-active { background: var(--teal-light);        color: var(--teal);     border: 1px solid rgba(0,197,180,0.25); }
.badge-done   { background: rgba(22,163,74,0.08);    color: var(--success);  border: 1px solid rgba(22,163,74,0.18); }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success { background: rgba(22,163,74,0.08);  border: 1px solid rgba(22,163,74,0.20);  color: var(--success); }
.alert-error   { background: rgba(229,57,53,0.08);  border: 1px solid rgba(229,57,53,0.20);  color: var(--red); }
.alert-warning { background: rgba(217,119,6,0.08);  border: 1px solid rgba(217,119,6,0.20);  color: var(--warning); }
.alert-info    { background: var(--teal-light);      border: 1px solid rgba(0,197,180,0.22);  color: var(--teal-dark); }

/* ── Loading ── */
#loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { color: var(--text-secondary); font-size: 14px; }

/* ── Escolher Apelido ── */
#escolher-apelido {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 20px;
  background: var(--bg);
}

.apelido-card {
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 48px rgba(0,0,0,0.12);
  overflow: hidden;
}

/* Hero section */
.apelido-hero {
  background: linear-gradient(140deg, #009688 0%, #00C5B4 100%);
  padding: 36px 32px 32px;
  text-align: center;
  position: relative;
}

.apelido-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 24px;
}

.apelido-brand-name {
  font-size: 13px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.3px;
}

.apelido-brand-name span {
  color: rgba(255,255,255,0.65);
}

.apelido-brand-divider {
  display: block;
  width: 1px;
  height: 12px;
  background: rgba(255,255,255,0.4);
}

.apelido-brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
}

.apelido-ball {
  font-size: 60px;
  display: block;
  margin-bottom: 14px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.20));
  line-height: 1;
}

.apelido-hero-title {
  font-size: 26px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  line-height: 1.2;
}

.apelido-hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.72);
  font-weight: 400;
}

/* Form section */
.apelido-form {
  padding: 32px;
}

.apelido-form-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.apelido-form-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.apelido-status {
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

.apelido-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  margin-top: -8px;
}

.apelido-btn {
  height: 48px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,197,180,0.30);
}

/* ── Bloqueio ── */
#bloqueio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 24px;
  text-align: center;
  gap: 20px;
}

.bloqueio-icon  { font-size: 52px; margin-bottom: 4px; opacity: 0.7; }
.bloqueio-title { font-size: 24px; font-weight: 700; color: var(--black); letter-spacing: -0.5px; }
.bloqueio-text  { font-size: 15px; color: var(--text-secondary); max-width: 360px; line-height: 1.7; }

/* ── Section Headers ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-top: 32px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* ── Rodada Info Card ── */
.rodada-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.rodada-nome {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.rodada-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.rodada-meta span { display: flex; align-items: center; gap: 4px; }

/* ── Game Card ── */
.game-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 10px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.game-card:not(.locked):hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--gray-light);
  transform: translateY(-1px);
}

.game-card.locked {
  background: var(--gray-bg);
}

.game-card.submitted {
  border-left: 3px solid var(--teal);
}

.game-time {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 16px;
  font-weight: 500;
}

.game-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  min-width: 0;
}

.team-flag  { font-size: 28px; line-height: 1; }

.team-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.2;
}

.score-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.score-sep {
  font-size: 18px;
  font-weight: 300;
  color: var(--gray-light);
  line-height: 1;
}

.game-result {
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.game-card.submitted .game-result { display: flex; }
.game-card.submitted .score-area  { display: none; }

.result-score {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.points-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 8px;
  text-align: center;
}

.points-high { background: rgba(217,119,6,0.10);  color: var(--gold); }
.points-mid  { background: rgba(22,163,74,0.10);  color: var(--success); }
.points-low  { background: var(--teal-light);      color: var(--teal-dark); }
.points-0    { background: var(--gray-bg);         color: var(--text-muted); }

/* ── Submit Section ── */
.submit-section {
  position: sticky;
  bottom: 0;
  padding: 32px 0 32px;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
}

/* ── Scoring Legend ── */
.scoring-legend {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 28px;
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

.scoring-legend strong { color: var(--text-primary); }

/* ── Ranking Tabs ── */
.ranking-tabs {
  display: flex;
  gap: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-top: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.ranking-tab {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
  font-family: inherit;
}

.ranking-tab.active {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 1px 4px rgba(0, 197, 180, 0.3);
}

.ranking-list { display: flex; flex-direction: column; gap: 8px; }

.ranking-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.ranking-item.pos-1 { border-left: 3px solid var(--gold); }
.ranking-item.pos-2 { border-left: 3px solid var(--silver); }
.ranking-item.pos-3 { border-left: 3px solid #B08D6A; }

.rank-pos {
  font-size: 16px;
  font-weight: 800;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.pos-1 .rank-pos { color: var(--gold); }
.pos-2 .rank-pos { color: var(--silver); }
.pos-3 .rank-pos { color: #B08D6A; }

.rank-info { flex: 1; min-width: 0; }

.rank-email {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.rank-points {
  font-size: 20px;
  font-weight: 800;
  color: var(--teal);
  flex-shrink: 0;
}

.rank-pts-label { font-size: 10px; color: var(--text-secondary); text-align: right; }

/* ── Admin Login ── */
.admin-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
}

.admin-login-box {
  width: 100%;
  max-width: 380px;
}

.admin-login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.admin-login-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.5px;
  display: block;
  margin-bottom: 6px;
}

.admin-login-logo span { color: var(--teal); }

.admin-login-title {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Admin Panel ── */
/* (admin tabs são definidos inline no admin.html para maior controle) */

.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 10px 16px;
  height: 38px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--gray-bg);
}

td {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
  font-size: 13px;
  height: 42px;
}

tr:last-child td  { border-bottom: none; }
tr:hover td       { background: rgba(0,0,0,0.02); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@media (min-width: 480px) { .modal-overlay { align-items: center; } }

.modal {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.modal-actions .btn { flex: 1; }

/* ── Empty states ── */
.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: var(--text-secondary);
}

.empty-state-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p    { font-size: 14px; line-height: 1.6; }

/* ── Helpers ── */
.hidden         { display: none !important; }
.text-center    { text-align: center; }
.text-muted     { color: var(--text-secondary); font-size: 13px; }
.mt-8           { margin-top: 8px; }
.mt-12          { margin-top: 12px; }
.mt-16          { margin-top: 16px; }
.mt-24          { margin-top: 24px; }
.gap-8          { gap: 8px; }
.flex           { display: flex; }
.flex-wrap      { flex-wrap: wrap; }
.items-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full         { width: 100%; }

/* ── Responsive ── */
@media (min-width: 480px) {
  .container    { padding: 0 28px; }
  .score-input  { width: 56px !important; height: 56px; font-size: 24px; }
  .rodada-nome  { font-size: 22px; }
}

@media (min-width: 768px) {
  .container    { padding: 0 40px; }
  .card         { padding: 28px 32px; }
  .rodada-card  { padding: 24px 32px; }
  .game-card    { padding: 24px 28px; }
  .section-header { padding-top: 40px; margin-bottom: 20px; }
  .rodada-card  { margin-top: 36px; margin-bottom: 36px; }
  .scoring-legend { padding: 16px 28px; }
}
