/* 03-leaderboard-print.css - Leaderboard, advanced settings, rematch warning, print buttons + @media print */
/* ═══ LEADERBOARD ═══ */
#leaderboard-screen {
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 50px 20px 80px;
  background: radial-gradient(ellipse at 30% 10%, rgba(124,58,237,0.12) 0%, transparent 60%), radial-gradient(ellipse at 70% 90%, rgba(59,130,246,0.08) 0%, transparent 60%), var(--bg);
}
.lb-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #a78bfa;
  text-align: center;
  margin-bottom: 4px;
}
.lb-subtitle {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 0;
}
.lb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 8px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(124,58,237,0.12);
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 7px;
  padding: 9px 12px;
  margin-bottom: 7px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow:
    -1px -1px 0   rgba(0,0,0,0.45),
     1px -1px 0   rgba(0,0,0,0.45),
    -1px  1px 0   rgba(0,0,0,0.45),
     1px  1px 0   rgba(0,0,0,0.45),
     0    2px 6px rgba(0,0,0,0.55);
  animation: chipIn 0.3s ease both;
}
.lb-row:nth-child(1) { animation-delay: 0.05s; }
.lb-row:nth-child(2) { animation-delay: 0.1s; }
.lb-row:nth-child(3) { animation-delay: 0.15s; }
.lb-rank-num {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
  background: rgba(0,0,0,0.32);
  border-radius: 4px;
  padding: 2px 6px;
  text-shadow: none;
}
.lb-name { flex: 1; }
.lb-pts {
  background: rgba(0,0,0,0.28);
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  padding: 2px 8px;
  white-space: nowrap;
  text-shadow: none;
}
.lb-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: center;
}
.btn-new-game {
  background: var(--accent);
  border: none;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 28px;
  transition: background 0.15s, transform 0.1s;
}
.btn-new-game:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ═══ ADVANCED SETTINGS SECTION ═══ */
.advanced-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 20px;
  overflow: hidden;
}
.advanced-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 11px 14px;
  list-style: none;
  user-select: none;
  transition: color 0.15s, background 0.15s;
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary:hover { color: var(--text-2); background: var(--accent-light); }
.advanced-summary::after {
  content: '▸';
  font-size: 10px;
  transition: transform 0.2s;
}
details[open] .advanced-summary::after { transform: rotate(90deg); }
.advanced-body { padding: 4px 0 4px; }
.advanced-body .toggle-option { margin-bottom: 0; border: none; border-top: 1px solid var(--border); border-radius: 0; }
.advanced-body .toggle-option:hover { border-color: var(--border); }

/* ═══ REMATCH WARNING ═══ */
.rematch-warning {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(234,179,8,0.12);
  border: 1px solid rgba(234,179,8,0.35);
  border-radius: 4px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 6px 5px 10px;
  margin: 0 12px 10px;
  line-height: 1.4;
}
.rematch-warning-icon { font-size: 12px; flex-shrink: 0; }
.rematch-warning-text { flex: 1; }
.rematch-dismiss-btn {
  background: transparent;
  border: none;
  color: var(--amber);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
  padding: 2px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: opacity 0.15s, background 0.15s;
}
.rematch-dismiss-btn:hover { opacity: 1; background: rgba(234,179,8,0.15); }

/* ═══ PRINT BUTTONS ═══ */
.btn-print {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-print:hover { border-color: var(--accent-dim); color: var(--text); background: var(--accent-light); }

/* ═══ PRINT STYLES ═══ */
@media print {
  body > * { display: none !important; }

  #print-tables-container:not(:empty),
  #print-lb-container:not(:empty) {
    display: block !important;
    position: fixed;
    inset: 0;
    background: #fff;
    padding: 32px 36px;
    overflow: visible;
    font-family: 'DM Sans', Arial, sans-serif;
    color: #000;
  }

  /* ── Header block ── */
  .print-doc-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 22px;
  }
  .print-page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #000;
  }
  .print-page-sub {
    font-size: 12px;
    color: #555;
    font-family: 'DM Sans', Arial, sans-serif;
  }

  /* ── Table seating grid ── */
  .print-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
  }
  .print-table-card {
    border: 1px solid #bbb;
    padding: 12px 14px;
    break-inside: avoid;
  }
  .print-table-heading {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #bbb;
    color: #000;
  }
  .print-player-line {
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #000;
  }
  .print-player-line:last-child { border-bottom: none; }
  .print-player-num {
    font-size: 11px;
    color: #888;
    min-width: 18px;
  }
  .print-player-pts {
    font-size: 11px;
    color: #666;
    font-family: 'DM Sans', Arial, sans-serif;
  }

  /* ── Leaderboard table ── */
  .print-lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 4px;
  }
  .print-lb-table thead tr {
    border-bottom: 2px solid #000;
  }
  .print-lb-table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #000;
  }
  .print-lb-table th:last-child { text-align: right; }
  .print-lb-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #000;
    vertical-align: middle;
  }
  .print-lb-table td:last-child { text-align: right; font-weight: 600; }
  .print-lb-table tr:first-child td { font-weight: 700; }
  .print-rank-num {
    font-size: 12px;
    color: #888;
    font-weight: 400;
  }
  .print-rank-1 .print-rank-num { color: #000; font-weight: 700; }
  .print-rank-2 .print-rank-num,
  .print-rank-3 .print-rank-num { color: #333; font-weight: 600; }
}

/* Hidden print containers - only visible during print */
#print-tables-container,
#print-lb-container {
  display: none;
}
.lb-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 500px;
  margin-bottom: 6px;
}
.lb-heading { flex: 1; text-align: center; }
.btn-back-tournament {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-back-tournament:hover { border-color: var(--accent-dim); color: #a78bfa; background: var(--accent-light); }
.lb-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 500px;
  margin-bottom: 16px;
}
.lb-search-wrap { position: relative; flex: 1; }
.lb-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--text-3);
  pointer-events: none;
}
.lb-search-input {
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 8px 10px 8px 30px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.lb-search-input:focus { border-color: var(--accent-dim); background: rgba(124,58,237,0.05); }
.lb-search-input::placeholder { color: var(--text-3); }
html[data-theme="light"] .lb-search-input { background: rgba(124,58,237,0.04); }
html[data-theme="light"] .lb-search-input:focus { background: rgba(124,58,237,0.08); }
.btn-skip-bottom {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-skip-bottom:hover { border-color: var(--accent-dim); color: #a78bfa; background: var(--accent-light); }
.lb-no-results {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  padding: 20px 0 8px;
  display: none;
}
