:root {
  --navy: #002a5c;
  --navy-mid: #003570;
  --navy-light: #004080;
  --pool: #0099d6;
  --aqua: #00AEEF;
  --foam: #80d8f8;
  --white: #ffffff;
  --text: #d0ecfa;
  --muted: #7ab8d8;
  --green: #1db954;
  --yellow: #f1c40f;
  --orange: #e67e22;
  --red: #e74c3c;
  --card-bg: rgba(0, 42, 92, 0.85);
  --border: rgba(0, 180, 216, 0.18);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--navy);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(0,153,214,0.2) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(0,174,239,0.14) 0%, transparent 60%),
    linear-gradient(170deg, #001e4d 0%, #002a6a 50%, #001e4d 100%);
  z-index: 0;
}
body::after {
  content: '';
  position: fixed; bottom: 0; left: 0; right: 0; height: 220px;
  background: repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(0,180,216,0.04) 60px, rgba(0,180,216,0.04) 120px);
  animation: lanes 8s linear infinite;
  z-index: 0; opacity: 0.5;
}
@keyframes lanes { from { transform: translateX(0); } to { transform: translateX(120px); } }

.container { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 32px 24px 60px; }

/* HEADER */
header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 36px; gap: 16px; flex-wrap: wrap; }
.logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
h1 { font-family: 'Bebas Neue', sans-serif; font-size: 2.8rem; letter-spacing: 3px; color: var(--white); line-height: 1; text-shadow: 0 0 30px rgba(0,180,216,0.4); }
h1 span { color: var(--aqua); }
.subtitle { font-size: 0.78rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); padding-left: 48px; }

/* NAV */
.page-nav { display: flex; gap: 8px; margin-top: 10px; padding-left: 48px; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-decoration: none; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); transition: color 0.2s, border-color 0.2s, background 0.2s; }
.nav-link svg { width: 13px; height: 13px; stroke: currentColor; flex-shrink: 0; }
.nav-link:hover { color: var(--aqua); border-color: var(--aqua); background: rgba(0,174,239,0.08); }
.nav-link.active { color: var(--aqua); border-color: var(--aqua); background: rgba(0,174,239,0.12); font-weight: 600; }

/* SELECT WIDGET */
.onn-select {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 36px 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: .92rem;
  color: var(--white);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237ab8d8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .2s;
}
.onn-select:focus { border-color: var(--aqua); }

/* SECTION LABEL */
.section-label { font-family: 'Bebas Neue', sans-serif; font-size: 1.3rem; letter-spacing: 3px; color: var(--aqua); margin-bottom: 14px; margin-top: 32px; display: flex; align-items: center; gap: 10px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.section-label .year-count { font-family: 'DM Sans', sans-serif; font-size: 0.72rem; letter-spacing: 1px; color: var(--muted); font-weight: 400; background: rgba(0,174,239,0.1); border: 1px solid var(--border); border-radius: 10px; padding: 2px 10px; }

/* TABLE */
.table-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; backdrop-filter: blur(12px); margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead tr { background: rgba(0,180,216,0.08); }
th { padding: 11px 16px; text-align: left; font-size: 0.68rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); }
td { padding: 13px 16px; border-bottom: 1px solid rgba(0,180,216,0.07); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(0,180,216,0.04); }

/* DIFF BADGES */
.diff-badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-weight: 600; font-size: 0.82rem; min-width: 68px; text-align: center; }
.diff-green  { background: rgba(29,185,84,0.15);  color: #1db954; border: 1px solid rgba(29,185,84,0.3); }
.diff-yellow { background: rgba(241,196,15,0.15); color: #f1c40f; border: 1px solid rgba(241,196,15,0.3); }
.diff-orange { background: rgba(230,126,34,0.15); color: #e67e22; border: 1px solid rgba(230,126,34,0.3); }
.diff-red    { background: rgba(231,76,60,0.15);  color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); }

/* TIME VALUE */
.time-val { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; letter-spacing: 1px; color: var(--white); }

/* RANK NUMBERS */
.rank-num { font-family: 'Bebas Neue', sans-serif; font-size: 1rem; color: var(--muted); width: 28px; display: inline-block; text-align: center; }
.rank-num.top1 { color: #ffd700; }
.rank-num.top2 { color: #c0c0c0; }
.rank-num.top3 { color: #cd7f32; }

/* ATHLETE NAME LINK */
.athlete-name { font-weight: 500; color: var(--white); }
a.athlete-name { color: var(--white); text-decoration: none; cursor: pointer; transition: color .15s; }
a.athlete-name:hover { color: var(--aqua); }

/* STATS PILLS */
.stats-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-pill { background: rgba(0,174,239,0.1); border: 1px solid rgba(0,174,239,0.2); border-radius: 20px; padding: 6px 16px; font-size: 0.78rem; color: var(--foam); }
.stat-pill strong { color: var(--aqua); font-size: 1rem; margin-right: 4px; }

/* PILL */
.pill { background: rgba(0,180,216,0.1); border: 1px solid rgba(0,180,216,0.22); border-radius: 20px; padding: 4px 12px; font-size: 0.75rem; color: var(--foam); letter-spacing: 0.5px; }
.pill strong { color: var(--aqua); }

/* FILTERS CARD (rankings) */
.filters-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; backdrop-filter: blur(12px); margin-bottom: 28px; display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.filter-group label { font-size: 0.68rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.filter-group select { background: rgba(0,42,92,0.9); border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 12px; font-family: 'DM Sans', sans-serif; font-size: 0.88rem; color: var(--white); outline: none; cursor: pointer; transition: border-color 0.2s; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237ab8d8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.filter-group select:focus { border-color: var(--aqua); }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty-state svg { width: 56px; height: 56px; stroke: var(--border); margin-bottom: 16px; }
.empty-state p { font-size: 0.9rem; }

/* ANIMATION */
.dashboard { display: none; animation: fadeUp 0.4s ease; }
.dashboard.visible { display: block; }
@keyframes fadeUp { from { opacity:0; transform: translateY(18px); } to { opacity:1; transform: translateY(0); } }

@media (max-width: 600px) {
  h1 { font-size: 2rem; }
  th, td { padding: 9px 10px; font-size: 0.8rem; }
  .filters-card { gap: 12px; }
}
