/* Copyright (c) 2026, Lenny Karpel.  All rights reserved. */

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text: #f1f1f1;
  --muted: #aaa;
  --accent: #ff4444;
}
* { box-sizing: border-box; }
html {
  height: 100%;
}
body {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Arial Rounded MT Bold", "Arial Rounded MT", arial, verdana, sans-serif;
  line-height: 1.45;
}
.page-header {
  flex-shrink: 0;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0.5rem;
}
.page-header-inner {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.back-link:hover {
  color: var(--text);
  text-decoration: underline;
}
.page-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.page-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 42rem;
}
.page-sub a {
  color: var(--text);
}
.page-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 0;
  overflow: hidden;
}
.status {
  flex-shrink: 0;
  color: var(--muted);
  padding: 1.5rem 0;
}
.error {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  color: var(--text);
  font-size: 0.95rem;
}
.error a {
  color: #ff8888;
}
.year-controls {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.year-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}
.who-played-search {
  display: block;
}
.who-played-search-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font: inherit;
  font-size: 0.88rem;
  outline: none;
}
.who-played-search-input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
.who-played-search-input:focus {
  border-color: #888;
}
.year-controls.search-active .year-jump {
  opacity: 0.45;
  pointer-events: none;
}
.content.search-active .search-hidden {
  display: none !important;
}
.who-played-search-empty {
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
}
.year-controls[hidden] {
  display: none;
}
.content {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #555 var(--surface);
  padding-bottom: 3rem;
  -webkit-overflow-scrolling: touch;
}
.content::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.content::-webkit-scrollbar-track {
  background: var(--surface);
}
.content::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 5px;
  border: 2px solid var(--surface);
}
.content::-webkit-scrollbar-thumb:hover {
  background: #666;
}
.content[hidden] {
  display: none;
}
.year-control-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.year-control-btn {
  margin: 0;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}
.year-control-btn:hover {
  color: var(--text);
  border-color: #444;
}
.year-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.year-jump-btn {
  margin: 0;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.2;
  cursor: pointer;
}
.year-jump-btn:hover {
  color: var(--text);
  border-color: #555;
  background: var(--surface);
}
.year-section {
  margin: 0 0 2rem;
}
.year-toggle {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.year-toggle:hover {
  color: #fff;
}
.year-chevron {
  display: inline-block;
  width: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  transform: rotate(0deg);
  transition: transform 0.12s ease;
}
.year-section.expanded .year-chevron {
  transform: rotate(90deg);
}
.year-body {
  display: none;
}
.year-section.expanded .year-body {
  display: block;
}
.year-section.expanded .perf-table thead th {
  position: sticky;
  top: var(--year-sticky-offset, 2.75rem);
  z-index: 2;
  background: var(--bg);
  box-shadow: 0 1px 0 var(--border);
}
.perf-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  table-layout: fixed;
}
.perf-table th {
  text-align: left;
  color: #00dddd;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.6rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.perf-table td {
  vertical-align: top;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid rgba(42, 42, 42, 0.85);
  white-space: normal;
  overflow-wrap: break-word;
}
.perf-table tr:hover td {
  background: rgba(45, 45, 45, 0.45);
}
.perf-table .col-player {
  width: 3.25rem;
  text-align: center;
  padding-right: 0.35rem;
  white-space: nowrap;
}
.perf-table th.col-player {
  padding-right: 0.35rem;
}
.perf-table .col-date {
  width: 7.5rem;
  white-space: nowrap;
}
.perf-table td.col-date {
  color: var(--muted);
}
.perf-table .col-perf {
  width: 34%;
}
.perf-table td.col-perf {
  color: var(--text);
  font-weight: 500;
}
.perf-table .col-venue {
  width: 18%;
}
.perf-table td.col-venue {
  color: var(--muted);
}
.perf-table td.col-notes {
  color: var(--muted);
  font-size: 0.85rem;
}
.perf-table .player-link,
.perf-table .player-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
}
.perf-table .player-link {
  opacity: 0.9;
}
.perf-table .player-link:hover {
  opacity: 1;
}
.perf-table .player-icon-disabled {
  opacity: 0.22;
  filter: grayscale(1);
  cursor: default;
}
.perf-table .player-link img,
.perf-table .player-icon img {
  display: block;
  width: 18px;
  height: 18px;
}
.perf-table a.performer-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(170, 170, 170, 0.55);
  text-underline-offset: 0.15em;
}
.perf-table a.performer-link:hover {
  text-decoration-color: var(--text);
}
@media (max-width: 700px) {
  .year-section.expanded .perf-table thead th {
    position: static;
    box-shadow: none;
  }
  .perf-table, .perf-table thead, .perf-table tbody, .perf-table th, .perf-table td, .perf-table tr {
    display: block;
  }
  .perf-table thead { display: none; }
  .perf-table tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }
  .perf-table td {
    border: none;
    padding: 0.15rem 0;
    width: auto;
    white-space: normal;
    overflow-wrap: break-word;
  }
  .perf-table .col-player,
  .perf-table .col-date,
  .perf-table .col-perf,
  .perf-table .col-venue,
  .perf-table .col-notes {
    width: auto;
    max-width: none;
  }
  .perf-table .col-date,
  .perf-table .col-player {
    white-space: nowrap;
  }
  .perf-table .col-player {
    text-align: left;
    padding: 0.15rem 0;
  }
  .perf-table .col-date {
    color: var(--muted);
    font-size: 0.8rem;
  }
  .perf-table .col-perf {
    font-size: 1rem;
    margin: 0.15rem 0;
  }
}

html.is-embedded .page-header a[target="amazingrace-player"] {
  display: none;
}
