/* ============================================
   FANTASY DRAG — Global Styles
   Dark mode, orange/pink/purple palette
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --orange:      #FF6B2B;
  --orange-dim:  #c94e18;
  --pink:        #FF3DA0;
  --pink-dim:    #c41f77;
  --purple:      #9B5DE5;
  --purple-dim:  #6d37b3;

  --bg:          #0d0d0f;
  --bg2:         #141418;
  --bg3:         #1c1c23;
  --border:      #2a2a35;
  --border-glow: #3a2a50;

  --text:        #f0eaf8;
  --text-muted:  #8a85a0;
  --text-dim:    #5a5570;

  --gold:        #FFD700;
  --silver:      #C0C0C0;
  --bronze:      #CD7F32;

  --radius:      12px;
  --radius-sm:   7px;
  --shadow:      0 4px 24px rgba(0,0,0,0.5);
  --glow-orange: 0 0 18px rgba(255,107,43,0.35);
  --glow-pink:   0 0 18px rgba(255,61,160,0.35);
  --glow-purple: 0 0 18px rgba(155,93,229,0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 10% 0%, rgba(155,93,229,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(255,61,160,0.06) 0%, transparent 50%);
}

/* ---- HEADER ---- */
.site-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.site-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 900;
  font-style: italic;
  background: linear-gradient(90deg, var(--orange), var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.site-nav a:hover, .site-nav a.active {
  color: var(--text);
  background: var(--bg3);
}

.site-nav .admin-link {
  color: var(--pink);
  border: 1px solid rgba(255,61,160,0.3);
  margin-left: 0.5rem;
}

.site-nav .admin-link:hover {
  background: rgba(255,61,160,0.1);
  color: var(--pink);
}

/* ---- LAYOUT ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 900;
  font-style: italic;
  margin-bottom: 0.25rem;
  background: linear-gradient(90deg, var(--orange), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ---- CARDS ---- */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ---- TABLES ---- */
.fancy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.fancy-table th {
  background: var(--bg3);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.fancy-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.fancy-table tr:last-child td { border-bottom: none; }

.fancy-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ---- RANK BADGES ---- */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
}
.rank-1 { background: var(--gold);   color: #111; }
.rank-2 { background: var(--silver); color: #111; }
.rank-3 { background: var(--bronze); color: #111; }
.rank-n { background: var(--bg3);    color: var(--text-muted); }

/* ---- TEAM COLOR PILLS ---- */
.team-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.team-orange { background: rgba(255,107,43,0.18); color: var(--orange); border: 1px solid rgba(255,107,43,0.3); }
.team-pink   { background: rgba(255,61,160,0.18); color: var(--pink);   border: 1px solid rgba(255,61,160,0.3); }
.team-purple { background: rgba(155,93,229,0.18); color: var(--purple); border: 1px solid rgba(155,93,229,0.3); }

/* ---- SCORE DISPLAY ---- */
.score-positive { color: #4ade80; font-weight: 600; }
.score-negative { color: #f87171; font-weight: 600; }
.score-zero     { color: var(--text-muted); }

.big-score {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 900;
  font-style: italic;
}

/* ---- PLACEMENT BADGES ---- */
.placement-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.p-win           { background: rgba(255,215,0,0.15);   color: #FFD700; border: 1px solid rgba(255,215,0,0.3); }
.p-high          { background: rgba(74,222,128,0.12);  color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
.p-safe          { background: rgba(96,165,250,0.12);  color: #60a5fa; border: 1px solid rgba(96,165,250,0.3); }
.p-low           { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.p-bottom        { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.p-eliminated    { background: rgba(100,100,100,0.2);  color: #888;    border: 1px solid rgba(100,100,100,0.3); }
.p-returned      { background: rgba(255,61,160,0.15);  color: var(--pink); border: 1px solid rgba(255,61,160,0.3); }
.p-finale_winner { background: rgba(255,215,0,0.2);    color: #FFD700; border: 1px solid rgba(255,215,0,0.4); }
.p-runner_up     { background: rgba(192,192,192,0.15); color: #C0C0C0; border: 1px solid rgba(192,192,192,0.3); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  box-shadow: var(--glow-pink);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 24px rgba(255,61,160,0.5); }

.btn-orange {
  background: var(--orange);
  color: #fff;
}
.btn-orange:hover { background: var(--orange-dim); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

.btn-danger {
  background: rgba(248,113,113,0.15);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.3);
}
.btn-danger:hover { background: rgba(248,113,113,0.25); }

.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(155,93,229,0.15);
}
select.form-control { cursor: pointer; }

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.form-check input[type="checkbox"] { accent-color: var(--pink); width: 16px; height: 16px; }

/* ---- ALERTS ---- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: rgba(74,222,128,0.1);  border: 1px solid rgba(74,222,128,0.3);  color: #4ade80; }
.alert-error   { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: #f87171; }
.alert-info    { background: rgba(155,93,229,0.1);  border: 1px solid rgba(155,93,229,0.3);  color: var(--purple); }

/* ---- GRID ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* ---- LEADERBOARD HERO ---- */
.leaderboard-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.lb-rank { width: 40px; text-align: center; flex-shrink: 0; }
.lb-name { font-weight: 600; font-size: 1rem; }
.lb-score { margin-left: auto; font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 900; }

/* ---- SECTION HEADER ---- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 700;
}

/* ---- DRAG CROWN DIVIDER ---- */
.crown-divider {
  text-align: center;
  font-size: 1.5rem;
  margin: 2rem 0;
  color: var(--text-dim);
  letter-spacing: 1rem;
}

/* ---- ADMIN BADGE ---- */
.admin-badge {
  display: inline-block;
  background: rgba(255,61,160,0.15);
  color: var(--pink);
  border: 1px solid rgba(255,61,160,0.3);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---- TABS ---- */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-link {
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-link:hover { color: var(--text); }
.tab-link.active { color: var(--pink); border-bottom-color: var(--pink); }

/* ---- FOOTER ---- */
.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* ---- RESPONSIVENESS ---- */
@media (max-width: 768px) {
  .site-header { padding: 0 1rem; }
  .site-nav a { padding: 0.4rem 0.5rem; font-size: 0.8rem; }
  .container { padding: 1.25rem 1rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-title { font-size: 1.8rem; }
}

/* ---- ANIMATIONS ---- */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.shimmer-text {
  background: linear-gradient(90deg, var(--orange), var(--pink), var(--purple), var(--pink), var(--orange));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.4s ease forwards; }
