/* Public site and archive. Admin components retain their own shared styles. */
:root {
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}
body { padding: 0 32px; }
.container { max-width: 1240px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 10; background: var(--surface); padding: 12px; }
.skip-link:focus { top: 12px; }
.page-intro { padding: 42px 0 34px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; color: var(--primary); margin-bottom: 10px; }
.page-intro h1 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -1.3px; line-height: 1.25; }
.page-intro > p:last-child { color: var(--text-muted); margin-top: 12px; font-size: 16px; }
.leaderboard-layout { display: block; }
.leaderboard-layout.full-width { grid-template-columns: minmax(0, 1fr); }
nav.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: 10px; margin-bottom: 24px; background: transparent; border: 1px solid var(--border); }
.tab-btn { font-size: 14px; text-align: left; border-radius: 7px; padding: 12px 14px; min-height: 44px; text-decoration: none; }
.tab-btn:hover { background: var(--primary-soft); }
.tab-btn.active { background: var(--primary); color: var(--on-primary); }
main { min-width: 0; }
main:focus { outline: none; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 18px; }
.section-heading h2 { font-size: 20px; letter-spacing: -.5px; }
#summary { font-size: 13px; color: var(--text-muted); }
.leaderboard-actions { margin-bottom: 18px; gap: 12px; }
.search-field { display: flex; align-items: center; width: 100%; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding-left: 14px; color: var(--text-muted); }
.search-field > span { font-size: 24px; }
.search-field .search-input { background: transparent; border: 0; width: 100%; max-width: none; min-width: 0; padding: 12px 12px 12px 0; border-radius: 8px; font-size: 14px; }
.search-field:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.search-field .search-input:focus { outline: none; box-shadow: none; }
.clear-all-filters { flex: 0 0 auto; min-height: 44px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }
.clear-all-filters:hover, .clear-all-filters:focus-visible { background: var(--surface-muted); outline: 2px solid var(--primary); outline-offset: 2px; }
.clear-all-filters[hidden] { display: none; }
.public-tag-filter { flex-basis: 100%; }
#categorySections > .card { padding: 0; overflow: hidden; box-shadow: var(--shadow-md); border-radius: 10px; }
#categorySections > .card:has(form), #categorySections > .card:has(.list-container) { padding: 24px; }
.leaderboard-table { border: 0; border-radius: 0; }
.leaderboard-table th { background: var(--surface-muted); color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; padding: 15px 18px; }
.leaderboard-table td { padding: 14px 18px; border-bottom: 1px solid var(--row-border); }
.leaderboard-table tr:last-child td { border-bottom: 0; }
.leaderboard-table td:nth-child(2) { font-weight: 600; }
.leaderboard-table td:nth-child(2) a { text-decoration-color: var(--control-border); text-underline-offset: 4px; }
.leaderboard-table td:last-child { font-family: var(--font-mono); font-weight: 600; color: var(--primary); }
.leaderboard-table tbody tr:hover td { background: var(--bg); }
.rank-badge { border-radius: 7px; min-width: 30px; font-family: var(--font-mono); font-size: 12px; }
.tournament-card { border-left: 3px solid var(--primary); border-radius: 6px; }
.tournament-card.featured { border-color: var(--accent-gold); }
.tournament-card-meta { font-family: var(--font-mono); font-size: 12px; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 24px 0; margin-top: 48px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
/* About page (/hakkinda/). */
.about { max-width: 820px; }
.about section { margin-bottom: 40px; }
.about h2 { font-size: 20px; letter-spacing: -.5px; margin-bottom: 14px; }
.about h3 { font-size: 16px; margin-bottom: 8px; }
.about p, .about li { line-height: 1.65; }
.about p + p, .about p + ul, .about ul + p { margin-top: 12px; }
.about ul, .about ol { padding-left: 22px; display: grid; gap: 8px; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.about-grid .card { padding: 20px; border-left: 3px solid var(--primary); }
.about-grid .card p { color: var(--text-muted); font-size: 14px; }
/* Archive shells use the same brand and navigation vocabulary. */
.site-header > h1 { margin: 0; font-size: 16px; text-transform: none; letter-spacing: 0; }
body:has(.archive-nav) .site-header { margin-bottom: 28px; }
.archive-nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.archive-nav a { text-decoration: none; }
.archive-periods { margin-bottom: 18px; color: var(--text-muted); font-size: 14px; }
.archive-back { margin-top: 8px; font-size: 14px; }
.table-empty { text-align: center; padding: 24px; color: var(--text-muted); }
@media (max-width: 700px) {
  body { padding: 0 16px; }
  .page-intro { padding: 28px 0; }
  .page-intro > p:last-child { font-size: 14px; max-width: 36ch; }
  .section-heading { margin-bottom: 14px; }
  .site-footer { margin-top: 28px; }
}
@media (max-width: 640px) {
  #categorySections > .card { background: transparent; border: 0; overflow: visible; box-shadow: none; }
  #categorySections > .card:has(form), #categorySections > .card:has(.list-container) { background: var(--surface); padding: 18px; border: 1px solid var(--border); }
  .leaderboard-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px; }
  .leaderboard-table td { padding: 0; text-align: left; min-width: 0; border: 0; font-size: 14px; }
  .leaderboard-table td[data-label]::before { position: static; display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
  .leaderboard-table td:first-child { grid-column: 1; }
  .leaderboard-table td:nth-child(2) { grid-column: 2 / 4; align-self: center; }
  .leaderboard-table td:first-child::before, .leaderboard-table td:nth-child(2)::before { display: none; }
  .leaderboard-table td:last-child { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 8px; display: flex; justify-content: space-between; }
  .leaderboard-table td[colspan] { grid-column: 1 / -1; }
}
#categorySections { view-transition-name: sections; }
::view-transition-group(root), ::view-transition-new(sections) { animation: none; }
::view-transition-old(sections) { animation: section-fade .12s ease-in forwards; }
@keyframes section-fade { to { opacity: 0; } }

.leaderboard-actions .public-tag-filter {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 8px;
}
.public-tag-filter .tag-filter-label { font-weight: 600; margin-right: 6px; color: var(--text); }
.tag-filter-empty { color: var(--text-muted); font-size: 13px; }
.public-tag-filter .tag-chip-toggle { min-height: 36px; padding: 6px 12px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.category-toolbar { min-width: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.category-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
  overscroll-behavior-x: contain;
}
.category-tabs::-webkit-scrollbar { height: 5px; }
.category-tabs::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; }
.category-tabs .tab-btn { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; border: 1px solid var(--border); background: var(--surface); padding: 10px 20px; text-align: center; }
.category-tabs .tab-btn:hover { background: var(--primary-soft); }
.category-tabs .tab-btn.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.leaderboard-actions .search-field { flex: 0 1 320px; }
.leaderboard-actions .public-tag-filter { flex: 1 1 360px; order: 0; min-height: 48px; }
@media (max-width: 700px) {
  .category-toolbar { margin-bottom: 20px; }
  .category-tabs .tab-btn { padding: 10px 16px; }
  .leaderboard-actions .search-field, .leaderboard-actions .public-tag-filter { flex-basis: 100%; }
}


/* Signed-out home page: only this card is shown. */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { max-width: 420px; width: 100%; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px 28px; box-shadow: var(--shadow-md); }
.login-card .brand-mark { margin: 0 auto 16px; }
.login-card h1 { margin: 0 0 8px; font-size: 1.5rem; }
.login-card p { margin: 0 0 24px; color: var(--text-muted); }
.login-button { display: inline-block; background: var(--primary); color: var(--on-primary); padding: 12px 22px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.login-button:hover { background: var(--primary-hover); }
