/* =========================================================
   FöretagsPadeln — visuell identitet
   Bas: djup padelgrön natt-ton, som banans matta i strålkastarljus.
   Accent: koral (matchintensitet) + gulgrön (padelbollens färg),
   sparsamt använd som signalfärg.
   Typsnitt: Bebas Neue (rubriker/siffror, arena-scoreboard-känsla)
   + Manrope (brödtext, luftig och läsbar).
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0f3324;
  --bg-deep: #081f16;
  --panel: #16412d;
  --panel-alt: #1c4d37;
  --panel-glass: rgba(22, 65, 45, 0.55);
  --panel-glass-alt: rgba(28, 77, 55, 0.6);
  --line: rgba(237, 239, 239, 0.09);
  --line-strong: rgba(237, 239, 239, 0.16);
  --text: #f4f1ea;
  --text-dim: #a9ccb8;
  --text-faint: #6d9782;
  --accent: #ff6b4a;
  --accent-soft: rgba(255, 107, 74, 0.16);
  --lime: #e3f24a;
  --lime-soft: rgba(227, 242, 74, 0.14);
  --gold: #f2c85c;
  --silver: #d3dbe1;
  --bronze: #d98a53;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px rgba(3, 15, 10, 0.45);
  --container: 1180px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* --- Fast bakgrund: assets/bg.png med mörk grön vinjett ovanpå --- */
.bg-fixed {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(8, 31, 22, 0.55) 0%, rgba(8, 31, 22, 0.72) 55%, rgba(8, 31, 22, 0.88) 100%),
    url('bg.png') center center / cover no-repeat fixed;
}

/* --- Studsande padelbollar, ritas i JS (assets/balls.js) --- */
#ball-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* gemensam glödande färgpuls för leaderboardens rutor */
@keyframes glow-cycle {
  0%   { box-shadow: 0 0 0 1px rgba(227, 242, 74, 0.22), 0 0 26px -4px rgba(227, 242, 74, 0.55); }
  33%  { box-shadow: 0 0 0 1px rgba(255, 107, 74, 0.22), 0 0 26px -4px rgba(255, 107, 74, 0.55); }
  66%  { box-shadow: 0 0 0 1px rgba(242, 200, 92, 0.22), 0 0 26px -4px rgba(242, 200, 92, 0.55); }
  100% { box-shadow: 0 0 0 1px rgba(227, 242, 74, 0.22), 0 0 26px -4px rgba(227, 242, 74, 0.55); }
}

/* samma puls, men med djupskuggan bevarad (används på hero-korten) */
@keyframes glow-cycle-card {
  0%   { box-shadow: var(--shadow), 0 0 0 1px rgba(227, 242, 74, 0.25), 0 0 30px -3px rgba(227, 242, 74, 0.6); }
  33%  { box-shadow: var(--shadow), 0 0 0 1px rgba(255, 107, 74, 0.25), 0 0 30px -3px rgba(255, 107, 74, 0.6); }
  66%  { box-shadow: var(--shadow), 0 0 0 1px rgba(242, 200, 92, 0.25), 0 0 30px -3px rgba(242, 200, 92, 0.6); }
  100% { box-shadow: var(--shadow), 0 0 0 1px rgba(227, 242, 74, 0.25), 0 0 30px -3px rgba(227, 242, 74, 0.6); }
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Topbar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  max-width: var(--container);
  margin: 0 auto;
}

.brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 0.5px;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
}

.brand span { color: var(--lime); }

.admin-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.admin-link:hover {
  border-color: var(--lime);
  color: var(--lime);
}

/* --- Hero: Herren på täppan --- */
.hero {
  max-width: var(--container);
  margin: 8px auto 56px;
  padding: 0 24px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 15px;
  color: var(--text-dim);
  margin: 0 0 6px;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.98;
  margin: 0 0 28px;
  letter-spacing: 0.5px;
}

.hero-title .hl { color: var(--lime); }

.leader-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
}

.leader-card {
  position: relative;
  background: linear-gradient(160deg, var(--panel-glass-alt), var(--panel-glass));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 30px 38px;
  min-width: 260px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: glow-cycle-card 9s ease-in-out infinite;
}

.leader-row .leader-card:nth-child(2n) {
  animation-delay: -4.5s;
}

.leader-card::before {
  content: '';
  position: absolute;
  inset: -40% -40% auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(227, 242, 74, 0.22), transparent 65%);
  pointer-events: none;
}

.leader-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  letter-spacing: 0.4px;
  margin: 4px 0 2px;
}

.leader-company {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 18px;
}

.leader-wins {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 64px;
  color: var(--lime);
  line-height: 1;
}

.leader-wins-label {
  font-size: 13px;
  color: var(--text-faint);
  text-transform: none;
  margin-top: 4px;
}

.leader-mobile {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-faint);
}

.empty-hero {
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 48px 32px;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto;
}

.empty-hero a { color: var(--lime); font-weight: 700; text-decoration: none; }

/* --- Statistiksektioner --- */
.stat-block { margin: 0 auto 40px; max-width: var(--container); padding: 0 24px; }

.stat-block h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 0.3px;
  margin: 0 0 4px;
}

.stat-block .sub {
  color: var(--text-faint);
  font-size: 14px;
  margin: 0 0 18px;
}

.panel-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 720px) {
  .panel-pair { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 8px;
  transition: filter 0.2s ease;
  animation: glow-cycle 8.5s ease-in-out infinite;
}

.panel-pair .panel:nth-child(2) {
  animation-delay: -4.2s;
}

.panel:hover {
  filter: brightness(1.08);
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
}

.panel ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.panel li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.panel li:first-child { border-top: none; }

.rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 19px;
  color: var(--text-faint);
  width: 20px;
  flex-shrink: 0;
}

.panel li:nth-child(1) .rank,
.panel li:nth-child(1) .entry-value { color: var(--gold); }
.panel li:nth-child(2) .rank,
.panel li:nth-child(2) .entry-value { color: var(--silver); }
.panel li:nth-child(3) .rank,
.panel li:nth-child(3) .entry-value { color: var(--bronze); }

.entry-name { flex: 1; min-width: 0; }
.entry-name .n { font-weight: 700; display: block; }
.entry-name .c { color: var(--text-faint); font-size: 12.5px; }

.entry-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--text);
}

.panel .empty-row {
  padding: 14px 0;
  color: var(--text-faint);
  font-size: 13.5px;
}

/* --- Scoreboard --- */
.scoreboard-section {
  max-width: var(--container);
  margin: 0 auto 70px;
  padding: 0 24px;
}

.scoreboard-section h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  margin: 0 0 4px;
}

.scoreboard-section .sub { color: var(--text-faint); font-size: 14px; margin: 0 0 18px; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

table.scoreboard {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  font-size: 14px;
}

table.scoreboard thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

table.scoreboard tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.scoreboard tbody tr:last-child td { border-bottom: none; }
table.scoreboard tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

tr.is-herre td:first-child {
  box-shadow: inset 3px 0 0 var(--lime);
}

.place {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  color: var(--text-dim);
}

.place.rank-1 { color: var(--gold); }
.place.rank-2 { color: var(--silver); }
.place.rank-3 { color: var(--bronze); }

tr.is-herre .place:not(.rank-1):not(.rank-2):not(.rank-3) { color: var(--lime); }

.badge-herre {
  display: inline-block;
  margin-left: 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--bg-deep);
  background: var(--lime);
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
}

.substat {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.substat .main {
  font-weight: 700;
  color: var(--text);
}

.substat .meta {
  font-size: 11.5px;
  color: var(--text-faint);
}

.mobile-col { color: var(--text-dim); white-space: nowrap; }
.ratio-col { font-family: 'Bebas Neue', sans-serif; font-size: 17px; color: var(--accent); }
.win-col { font-weight: 800; }

footer.site-footer {
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  padding: 30px 24px 60px;
}
