/* =========================================================================
   SITE.CSS — public site foundation (tokens, header, drawer, footer, UI kit)
   Loaded by core/public_base.html after Bootstrap.
   ========================================================================= */

:root {
  /* Surfaces */
  --bg:            #09090b;
  --surface:       #111113;
  --surface-2:     #18181b;
  --surface-3:     #212126;
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text:   #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;

  /* Brand */
  --accent:        #ef4444;
  --accent-strong: #dc2626;
  --accent-soft:   rgba(239, 68, 68, 0.12);
  --accent-ring:   rgba(239, 68, 68, 0.35);
  --gold:          #fbbf24;

  /* Status */
  --ok:    #22c55e;
  --info:  #60a5fa;
  --warn:  #f59e0b;

  /* Shape & motion */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --navbar-height: 64px;
  --content-max: 1200px;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Legacy aliases — pages not yet migrated read these names */
  --bg-primary:     var(--bg);
  --bg-secondary:   var(--surface);
  --bg-elevated:    var(--surface-2);
  --text-primary:   var(--text);
  --text-secondary: var(--text-2);
  --text-muted:     var(--text-3);
  --border-subtle:  var(--border);
  --border-medium:  var(--border-strong);
  --accent-red:       var(--accent-strong);
  --accent-red-hover: #b91c1c;
  --accent-gold:      var(--gold);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}

body {
  padding-top: var(--navbar-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.app-layout { flex: 1 0 auto; width: 100%; }
.app-content { width: 100%; }

::selection { background: var(--accent-ring); color: #fff; }

/* Components set display:flex/grid; keep the hidden attribute authoritative */
[hidden] { display: none !important; }

/* Overrides the orange link color from components.css with the brand red */
a { color: #f87171; }
a:hover { color: #fca5a5; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.s-container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* =========================================================================
   HEADER
   ========================================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--navbar-height);
  z-index: 1050;
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.site-header.scrolled {
  background: rgba(9, 9, 11, 0.9);
  border-bottom-color: var(--border-strong);
}

.site-header-inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.site-brand img {
  height: 44px;
  width: auto;
  display: block;
  filter: invert(1);
}

/* Primary nav */
.site-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.site-nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.site-nav-link.active { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.site-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons (shared) */
.s-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 38px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
}

.s-btn:active { transform: translateY(1px); }

.s-btn-primary {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 8px 24px -8px rgba(220, 38, 38, 0.6);
}
.s-btn-primary:hover { background: var(--accent); color: #fff; }

.s-btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.s-btn-ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

.s-btn-quiet { background: transparent; color: var(--text-2); }
.s-btn-quiet:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.s-btn-lg { height: 46px; padding: 0 1.4rem; font-size: 0.95rem; }
.s-btn-icon { width: 38px; padding: 0; }

/* Dropdowns */
.s-dropdown { position: relative; }

.s-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.14s var(--ease), transform 0.14s var(--ease);
}

.s-dropdown-menu.open { opacity: 1; transform: none; pointer-events: auto; }

.s-dropdown-label {
  padding: 0.5rem 0.65rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.s-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.s-dropdown-item i { width: 1rem; text-align: center; opacity: 0.8; }
.s-dropdown-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.s-dropdown-item.is-active { color: var(--text); }
.s-dropdown-item.is-active::after { content: '\2713'; margin-left: auto; color: var(--accent); }
.s-dropdown-item.is-danger { color: #f87171; }
.s-dropdown-item.is-danger:hover { background: var(--accent-soft); color: #fca5a5; }
.s-dropdown-sep { height: 1px; margin: 6px 4px; background: var(--border); }

.s-user-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.65rem 0.7rem;
}
.s-user-head strong { display: block; font-size: 0.875rem; color: var(--text); line-height: 1.2; }
.s-user-head small { display: block; font-size: 0.75rem; color: var(--text-3); }

.s-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #b91c1c, #f97316);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
.s-avatar-lg { width: 38px; height: 38px; font-size: 0.95rem; }

.s-user-btn { padding: 0 0.6rem 0 0.25rem; gap: 0.5rem; }

/* Burger (mobile) */
.site-burger { display: inline-flex; }

/* Desktop */
@media (min-width: 992px) {
  .site-nav { display: flex; }
  .site-burger { display: none; }
  .site-only-mobile { display: none !important; }
}
@media (max-width: 991.98px) {
  .site-only-desktop { display: none !important; }
}

/* =========================================================================
   MOBILE DRAWER (keeps the #coreSidebar id for compatibility)
   ========================================================================= */
.site-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 88vw);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateX(105%);
  transition: transform 0.25s var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.core-sidebar-open .site-drawer { transform: none; }

.site-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  padding: 0 1rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.site-drawer-body { padding: 1rem; display: flex; flex-direction: column; gap: 1.25rem; flex: 1; }

.site-drawer-section-label {
  padding: 0 0.75rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.site-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
.site-drawer-link i { width: 1.1rem; text-align: center; }
.site-drawer-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.site-drawer-link.active { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.site-drawer-link.active i { color: var(--accent); }

.site-drawer-langs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; padding: 0 0.25rem; }
.site-drawer-langs button {
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
}
.site-drawer-langs button.is-active { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

.site-drawer-foot {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.5rem;
}

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1055;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
body.core-sidebar-open .site-backdrop { opacity: 1; pointer-events: auto; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer {
  flex-shrink: 0;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-3);
  font-size: 0.875rem;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.site-footer-brand { display: flex; align-items: center; gap: 0.75rem; }
.site-footer-brand img { height: 28px; filter: invert(1); opacity: 0.8; }

.site-footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer-links a { color: var(--text-2); text-decoration: none; }
.site-footer-links a:hover { color: var(--text); }

/* =========================================================================
   UI KIT — reusable across public pages
   ========================================================================= */
.s-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.s-h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
}

.s-h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

.s-lead { color: var(--text-2); font-size: 1rem; line-height: 1.6; margin: 0; }

.s-section { padding: 3.5rem 0 0; }

.s-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.s-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.s-link-arrow:hover { color: var(--text); }
.s-link-arrow i { transition: transform 0.15s var(--ease); }
.s-link-arrow:hover i { transform: translateX(3px); }

/* Pills / status */
.s-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 24px;
  padding: 0 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  white-space: nowrap;
}
.s-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.s-pill-live      { color: #4ade80; background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.3); }
.s-pill-live::before { animation: s-pulse 1.6s ease-in-out infinite; }
.s-pill-active    { color: #4ade80; background: rgba(34, 197, 94, 0.1);  border-color: rgba(34, 197, 94, 0.25); }
.s-pill-upcoming  { color: #fca5a5; background: var(--accent-soft);       border-color: var(--accent-ring); }
.s-pill-completed { color: #93c5fd; background: rgba(96, 165, 250, 0.1);  border-color: rgba(96, 165, 250, 0.25); }
.s-pill-archived  { color: #d4d4d8; }
.s-pill-results   { color: #fcd34d; background: rgba(251, 191, 36, 0.1);  border-color: rgba(251, 191, 36, 0.25); }

@keyframes s-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
  50%      { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0); }
}

/* Inputs */
.s-input-wrap { position: relative; }
.s-input-wrap > i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.s-input {
  width: 100%;
  height: 42px;
  padding: 0 2.5rem 0 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.s-input::placeholder { color: var(--text-3); }
.s-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.s-input-clear {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  text-decoration: none;
}
.s-input-clear:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* Segmented control */
.s-segmented {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}
.s-segmented a {
  padding: 0 0.95rem;
  height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.s-segmented a:hover { color: var(--text); }
.s-segmented a.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

/* Empty state */
.s-empty {
  grid-column: 1 / -1;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-2);
}
.s-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-size: 1.25rem;
  color: var(--text-2);
}
.s-empty h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0 0 0.35rem; }
.s-empty p { font-size: 0.9rem; margin: 0 auto; max-width: 360px; }

/* =========================================================================
   TOURNAMENT CARD (core/_tournament_card.html)
   ========================================================================= */
.t-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
  gap: 1rem;
}

.t-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.t-card:hover {
  color: inherit;
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.t-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(239, 68, 68, 0.22), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(251, 191, 36, 0.07), transparent 60%),
    var(--surface-2);
}
.t-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.t-card:hover .t-card-media img { transform: scale(1.04); }

/* Placeholder: big typographic date instead of a dim icon */
.t-card-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  isolation: isolate;
}
.t-card-art::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.t-card-art > * { position: relative; }
.t-card-art-day {
  font-size: 4.25rem;
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.92);
}
.t-card-art-month {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.t-card-art-icon { font-size: 2.25rem; color: rgba(239, 68, 68, 0.45); }

.t-card-status { position: absolute; top: 0.8rem; left: 0.8rem; z-index: 1; }
.t-card-status .s-pill { backdrop-filter: blur(8px); background-color: rgba(9, 9, 11, 0.6); }

.t-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  padding: 1rem 1.1rem 1.1rem;
}

.t-card-date {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.t-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.t-card-meta {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-2);
}
.t-card-meta span { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.t-card-meta .t-card-loc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-card-meta i { color: var(--text-3); }
.t-card-go {
  margin-left: auto;
  color: var(--text-3);
  transition: color 0.15s, transform 0.2s var(--ease);
}
.t-card:hover .t-card-go { color: var(--accent); transform: translateX(3px); }
.t-card-meta .t-card-mine {
  flex-shrink: 0;
  height: 22px;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #86efac;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.t-card-meta .t-card-mine i { color: inherit; }

/* =========================================================================
   TOURNAMENT HEADER + TABS (core/tournament_topbar.html)
   ========================================================================= */
.tx-head {
  padding: 1.75rem 0 1.5rem;
  background:
    radial-gradient(60% 140% at 100% 0%, rgba(239, 68, 68, 0.14), transparent 60%),
    var(--bg);
}

.tx-crumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
  font-size: 0.8rem;
  color: var(--text-3);
  min-width: 0;
}
.tx-crumbs a { color: var(--text-2); text-decoration: none; }
.tx-crumbs a:hover { color: var(--text); }
.tx-crumbs i { font-size: 0.65rem; }
.tx-crumbs span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tx-head-main { display: flex; align-items: center; gap: 1.1rem; }
.tx-head-text { flex: 1; min-width: 0; }

.tx-date-tile {
  flex-shrink: 0;
  width: 64px;
  height: 68px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  overflow: hidden;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.8);
}
.tx-date-tile span {
  width: 100%;
  padding: 3px 0;
  text-align: center;
  background: var(--accent-strong);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tx-date-tile strong {
  flex: 1;
  display: flex;
  align-items: center;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.tx-title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.tx-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.1rem;
  font-size: 0.875rem;
  color: var(--text-2);
}
.tx-meta > span:not(.s-pill) { display: inline-flex; align-items: center; gap: 0.4rem; }
.tx-meta i { color: var(--text-3); }

.tx-tabs {
  position: sticky;
  top: var(--navbar-height);
  z-index: 1000;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tx-tabs-inner {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tx-tabs-inner::-webkit-scrollbar { display: none; }

.tx-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 50px;
  padding: 0 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
}
.tx-tab i { font-size: 0.95rem; color: var(--text-3); }
.tx-tab:hover { color: var(--text); }
.tx-tab.active { color: var(--text); }
.tx-tab.active i { color: var(--accent); }
.tx-tab.active::after {
  content: '';
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

@media (max-width: 575.98px) {
  .tx-head { padding: 1.25rem 0 1.1rem; }
  .tx-date-tile { width: 52px; height: 56px; border-radius: 13px; }
  .tx-date-tile strong { font-size: 1.3rem; }
  .tx-head-main { align-items: flex-start; flex-wrap: wrap; }
  .tx-head-cta { width: 100%; }
  .tx-tab { padding: 0 0.7rem; }
}

/* The page body that follows the tabs */
.tx-body { padding-top: 1.75rem; }

/* =========================================================================
   PANELS, STATS, TABLES, FORM CONTROLS
   ========================================================================= */
.s-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.s-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.s-card-title { margin: 0; font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
.s-card-body { padding: 1.25rem; }

.s-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.s-stat { padding: 1rem 1.25rem; background: var(--surface); }
.s-stat-label { font-size: 0.75rem; font-weight: 500; color: var(--text-3); }
.s-stat-value {
  margin-top: 0.2rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.s-stat-value small { font-size: 0.9rem; font-weight: 500; color: var(--text-3); }
.s-progress { height: 4px; margin-top: 0.6rem; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.s-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), #fb923c); }

.s-dl { margin: 0; display: grid; gap: 0; }
.s-dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.s-dl > div:first-child { padding-top: 0; }
.s-dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.s-dl dt { font-weight: 400; color: var(--text-3); }
.s-dl dd { margin: 0; text-align: right; color: var(--text); font-weight: 500; }

.s-select {
  height: 42px;
  padding: 0 2.25rem 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23a1a1aa' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.9rem center;
  color: var(--text);
  font-size: 0.875rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  max-width: 100%;
}
.s-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.s-select option { background: var(--surface-2); color: var(--text); }

.s-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.s-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.s-table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.s-table tbody tr:last-child td { border-bottom: 0; }
.s-table tbody tr { transition: background 0.12s; }
.s-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.s-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-2);
  text-decoration: none;
}
a.s-tag:hover { color: var(--text); border-color: var(--border-strong); }
.s-tag-red    { background: var(--accent-soft); border-color: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.s-tag-gold   { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.3); color: #fcd34d; }
.s-tag-violet { background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.3); color: #c4b5fd; }
.s-tag-blue   { background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.3); color: #93c5fd; }
.s-tag-teal   { background: rgba(45, 212, 191, 0.1); border-color: rgba(45, 212, 191, 0.3); color: #5eead4; }
.s-tag-green  { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.3); color: #86efac; }

/* Medal markers (1st / 2nd / 3rd) */
.s-medal {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #18181b;
}
.s-medal-1 { background: linear-gradient(135deg, #fde68a, #f59e0b); }
.s-medal-2 { background: linear-gradient(135deg, #f4f4f5, #a1a1aa); }
.s-medal-3 { background: linear-gradient(135deg, #fdba74, #c2410c); }

/* Skeleton loader */
.s-skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: s-shimmer 1.4s ease-in-out infinite;
}
@keyframes s-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.s-pill-draft { color: var(--text-2); }

/* Reveal on scroll */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
