/* Rinklytics — shared stylesheet
   Design system: header/hero/footer, typography, and refined components.
   No JavaScript-facing selectors were removed or renamed. */

:root {
  --bg: #0a0a0a;
  --panel: #161616;
  --panel-border: #262626;
  --text: #ffffff;
  --text-dim: #8a8a8a;
  --accent: #4fd8e8;
  --accent-ink: #04303a;
  --danger-bg: #2a1414;
  --danger-text: #ff6b6b;
  --favorite-bg: #2a2410;
  --favorite-text: #f5c518;
  --accent-tint: rgba(79, 216, 232, 0.12);
  --input-bg: #1a1a1a;
  --input-placeholder: #666;
  --header-bg: rgba(10, 10, 10, 0.92);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 10px;
  --radius-lg: 20px;
  --container: 1120px;
  --font-display: 'Oswald', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Light theme - toggled by site.js, which sets data-theme="light" on
   <html> (persisted to localStorage, applied pre-paint so there's no flash
   of the wrong theme). Every color elsewhere in this file is a var(...)
   reference, so this one block is the only place light mode is defined. */
[data-theme="light"] {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-border: #e3e6ea;
  --text: #14181c;
  --text-dim: #5c6570;
  --accent: #0d8a9c;
  --accent-ink: #ffffff;
  --danger-bg: #fdeceb;
  --danger-text: #c62828;
  --favorite-bg: #fff6d6;
  --favorite-text: #8a6d00;
  --accent-tint: rgba(13, 138, 156, 0.08);
  --input-bg: #f0f2f4;
  --input-placeholder: #98a0a8;
  --header-bg: rgba(246, 247, 249, 0.92);
  --shadow: 0 10px 30px rgba(20, 24, 28, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.narrow {
  background: var(--bg);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--text);
}

p {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0 0 12px;
}

a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
}

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

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

/* Header wordmark: the white-lettered cutout on dark, the black-lettered one
   on light (data-theme is set by site.js). */
.brand-wordmark { height: 26px; width: auto; display: block; }
.brand-wordmark-light { display: none; }
[data-theme="light"] .brand-wordmark-dark { display: none; }
[data-theme="light"] .brand-wordmark-light { display: block; }

/* Team logo next to the wordmark (site.js addHeaderLogo). margin-right:
   auto keeps the nav pushed to the right edge. */
.brand-team-logo {
  height: 32px;
  width: auto;
  max-width: 96px;
  object-fit: contain;
  margin-right: auto;
  padding-left: 16px;
  border-left: 1px solid var(--panel-border);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.main-nav a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  border-bottom: 1px solid var(--panel-border);
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px 24px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.08;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 17px;
  max-width: 46ch;
  margin-bottom: 0;
}

.hero-art {
  display: flex;
  justify-content: center;
}

.hero-art svg {
  width: 100%;
  max-width: 420px;
  height: auto;
}

/* Score Trends header (history.html) and the team chart header
   (manager-profile.html): title left, "show last N" picker right. */
.trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.trend-head h2,
.trend-head h3 {
  margin: 0;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  column-gap: 32px;
  margin-top: 8px;
}

.trend-count {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.trend-count select {
  width: auto;
  margin: 0;
  padding: 4px 8px;
  font-size: 13px;
}

.trend-line {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw-trend 1.1s ease-out 0.3s forwards;
}

@keyframes draw-trend {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trend-line {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* ---------- How it works ---------- */

.how-it-works {
  border-bottom: 1px solid var(--panel-border);
}

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

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.steps li {
  border-left: 2px solid var(--panel-border);
  padding-left: 18px;
}

.step-num {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.steps h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.steps p {
  font-size: 14px;
  margin: 0;
}

/* ---------- Page shell (non-hero pages) ---------- */

.page-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px;
}

.page-title {
  margin-bottom: 28px;
}

.page-title p {
  margin-top: 6px;
}

/* ---------- Dashboard / upload area ---------- */

.dashboard {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

#upload-area {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  background: var(--panel);
}

label {
  display: block;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-top: 16px;
}

input[type="file"] {
  color: var(--text);
  font-size: 14px;
}

/* Styles the browser-native "Choose File" button to match the accent pill
   buttons elsewhere (e.g. "Analyze My Clip"). ::file-selector-button is the
   modern standard property; the -webkit- version covers older WebKit
   builds that only recognize the vendor-prefixed name - both rules target
   the same button, so keep them in sync if this ever changes. */
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 12px;
  transition: opacity 0.15s ease;
}

input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  opacity: 0.85;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 14px 24px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  width: 100%;
  transition: opacity 0.15s ease, transform 0.05s ease;
}

button:hover {
  opacity: 0.85;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  background: var(--panel-border);
  color: var(--text-dim);
  cursor: not-allowed;
}

#status {
  margin-top: 20px;
  font-style: italic;
  color: var(--text-dim);
  font-size: 14px;
}

#feedback {
  margin-top: 20px;
  white-space: pre-wrap;
  line-height: 1.6;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 24px;
  border-radius: var(--radius-lg);
  display: none;
  color: var(--text);
  font-size: 15px;
}

#chat-section {
  margin-top: 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--panel);
}

#chat-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

#chat-messages p {
  color: var(--text);
  font-size: 14px;
}

/* ---------- History page ---------- */

.entry {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.entry-meta {
  font-size: 13px;
  color: var(--text-dim);
}

.entry-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.entry-actions button {
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0;
  width: auto;
  background: var(--input-bg);
  color: var(--text-dim);
}

/* Present (practice plans / drills) - always the last, right-most button
   in its row, in light blue so it's easy to find at the rink. */
button.present-btn,
.entry-actions button.present-btn {
  background: #cdeefc;
  color: #0b4a66;
  border-color: #a8def5;
  margin-left: auto;
}

.favorite-btn {
  background: var(--input-bg);
  color: var(--text-dim);
}

.favorite-btn.is-favorite {
  background: var(--favorite-bg);
  color: var(--favorite-text);
  border-color: var(--favorite-bg);
}

.delete-btn {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-bg);
}

.entry-feedback {
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--text);
  font-size: 14px;
}

/* --- Entry top row: checkbox, title (+ rename), 3-dot menu --- */

.entry-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.entry-checkbox {
  margin-top: 4px;
  accent-color: var(--accent);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.entry-title-wrap {
  flex: 1;
  min-width: 0;
}

.entry-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-favorite-star {
  color: var(--favorite-text);
  font-size: 15px;
  flex-shrink: 0;
}

.entry-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rename-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  margin: 0;
  width: auto;
  font-size: 13px;
  flex-shrink: 0;
}

.rename-btn:hover {
  opacity: 1;
  color: var(--accent);
}

.entry-title-wrap input[type="text"] {
  display: inline-block;
  width: auto;
  min-width: 160px;
  margin: 0 8px 8px 0;
  padding: 6px 10px;
}

/* --- 3-dot dropdown menu (mirrors the header's account menu) --- */

.entry-menu {
  position: relative;
  flex-shrink: 0;
}

.entry-menu-btn {
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.entry-menu-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  opacity: 1;
}

.entry-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  z-index: 15;
}

.entry-menu.is-open .entry-menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.entry-menu-panel button,
.bulk-folder-panel button {
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0;
  width: 100%;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.entry-menu-panel button:hover,
.bulk-folder-panel button:hover {
  background: var(--input-bg);
  opacity: 1;
}

.entry-menu-delete {
  color: var(--danger-text) !important;
}

/* --- Video preview --- */

.entry-video-preview {
  margin: 12px 0;
}

.entry-video-preview video {
  width: 100%;
  max-height: 360px;
  border-radius: var(--radius);
  background: #000;
  display: block;
}

.entry-video-loading,
.entry-video-error {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

/* --- Formatted feedback (headers bolded, tracking hidden, score bars) --- */

.entry-feedback-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
}

.feedback-section {
  margin-bottom: 16px;
}

.feedback-section:last-child {
  margin-bottom: 0;
}

.feedback-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.feedback-section-body {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.5;
}

.score-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-border);
}

.score-row:last-child {
  border-bottom: none;
}

.score-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.score-category {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.score-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

.score-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--input-bg);
  overflow: hidden;
  margin-bottom: 6px;
}

.score-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.score-reason {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

.score-evidence {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

/* --- Bulk selection action bar --- */

#bulk-bar {
  display: none;
  margin-bottom: 16px;
}

.bulk-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--accent-tint);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.bulk-bar-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-right: auto;
}

.bulk-bar-row button {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--input-bg);
  color: var(--text-dim);
  font-weight: 600;
  cursor: pointer;
}

.bulk-bar-row button:hover {
  opacity: 1;
  color: var(--text);
}

.bulk-bar-row .delete-btn {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-bg);
}

.bulk-folder-panel {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bulk-folder-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 4px;
}

.bulk-folder-panel input[type="text"] {
  margin-top: 6px;
}

/* --- Per-entry chat and folders panels --- */

.entry-chat,
.entry-albums {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
}

.entry-chat-messages p {
  color: var(--text);
  font-size: 14px;
}

.entry-chat-hint {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 10px;
}

.entry-chat input[type="text"] {
  margin-bottom: 8px;
}

.album-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}

.album-checkbox-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  margin-top: 0;
}

.album-checkbox-row label input {
  width: auto;
  accent-color: var(--accent);
}

.album-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  margin: 0;
  width: auto;
  font-size: 13px;
}

.album-delete-btn:hover {
  color: var(--danger-text);
  opacity: 1;
}

.entry-albums-hint {
  font-size: 13px;
  color: var(--text-dim);
}

.entry-albums input[type="text"] {
  margin-bottom: 8px;
}

/* ---------- Profile page ---------- */

.row {
  display: flex;
  gap: 10px;
}

.row > div {
  flex: 1;
}

/* --- Avatar / logo upload widget - shared by profile.html (player photo)
   and manager-team.html (team logo) --- */

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--panel-border);
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.avatar-preview-square {
  border-radius: var(--radius);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avatar-upload-controls input[type="file"] {
  font-size: 13px;
}

.avatar-upload-controls button {
  width: auto;
  margin: 0;
  padding: 8px 16px;
  font-size: 13px;
}

.avatar-upload-status {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
}

/* ---------- Auth pages ---------- */

.auth-shell {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.auth-card h1 {
  font-size: 24px;
  margin-bottom: 6px;
}

.auth-card > p:first-of-type {
  margin-bottom: 20px;
}

.auth-card form input {
  margin-bottom: 4px;
}

.auth-card label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  margin-top: 10px;
}

.auth-card label input {
  width: auto;
  margin: 0;
}

.auth-footer {
  margin-top: 16px;
  font-size: 14px;
}

/* reset-password.html's script reveals this once the recovery link is
   verified - it must start hidden or the form flashes before that check
   completes. */
#reset-form {
  display: none;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--panel-border);
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-inner span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}

.footer-inner p {
  margin: 0 0 0 auto;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- Theme transition ---------- */
/* Keeps the light/dark toggle from feeling like a hard flash - only
   color-ish properties transition, never layout ones. */

body,
.site-header,
.site-footer,
#upload-area,
#feedback,
#chat-section,
.entry,
.auth-card,
.about-card,
.about-callout,
.account-menu-panel,
.guest-banner,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea,
button {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* ---------- Header actions (theme toggle + account menu / guest links) ---------- */

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

.guest-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.guest-link {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-dim);
  white-space: nowrap;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
}

.guest-link:hover {
  color: var(--accent);
}

.guest-link-primary {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 16px;
  border-radius: 999px;
}

.guest-link-primary:hover {
  color: var(--accent-ink);
  opacity: 0.85;
}

.account-menu {
  position: relative;
}

.account-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
  margin: 0;
  width: auto;
  cursor: pointer;
  color: var(--text-dim);
}

.account-menu-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  opacity: 1;
}

.account-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chevron {
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.account-menu.is-open .chevron {
  transform: rotate(180deg);
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  z-index: 20;
}

.account-menu.is-open .account-menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.account-menu-email {
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 4px;
  word-break: break-all;
}

.account-menu-panel a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
}

.account-menu-panel a:hover {
  background: var(--input-bg);
  color: var(--accent);
}

.account-menu-divider {
  height: 1px;
  background: var(--panel-border);
  margin: 4px 0;
}

.account-menu-logout {
  color: var(--danger-text) !important;
}

/* ---------- Upload area polish + guest gate banner ---------- */

.upload-area-head {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--panel-border);
}

.upload-area-head h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.upload-area-head p {
  margin: 0;
}

.guest-banner {
  background: var(--accent-tint);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.guest-banner p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.guest-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.guest-banner-btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--accent);
  color: var(--text);
  white-space: nowrap;
}

.guest-banner-btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------- About / "what we look for" section (index.html filler) ---------- */

.about-section {
  border-top: 1px solid var(--panel-border);
}

.about-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.about-intro {
  margin-bottom: 24px;
}

.about-intro h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.about-intro p {
  margin: 0;
  max-width: 52ch;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.about-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
}

.about-card h3 {
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--accent);
}

.about-card p {
  font-size: 13px;
  margin: 0;
}

.profile-types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.profile-type-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--panel);
}

.profile-type-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--accent);
}

.profile-type-card p {
  font-size: 13px;
  margin-bottom: 10px;
}

.profile-type-card ul {
  margin: 0;
  padding-left: 18px;
}

.profile-type-card li {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.profile-type-card li:last-child {
  margin-bottom: 0;
}

.about-callout {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--panel);
}

.about-callout h3 {
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--text);
}

.about-callout p {
  font-size: 14px;
  margin: 0;
}

/* ---------- Reusable panel card (manager team page, future phases) ---------- */

.card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  background: var(--panel);
  margin-bottom: 24px;
}

.card h2 {
  font-size: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h2 {
  margin-bottom: 0;
}

.card-count {
  font-size: 13px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ---------- Roster list (manager team page) ---------- */

.roster-locked-hint {
  margin: 0;
}

.roster-empty-hint {
  margin: 0 0 16px;
}

.roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--panel-border);
  flex-wrap: wrap;
}

.roster-row:last-of-type {
  border-bottom: none;
}

.roster-row-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.roster-jersey-badge {
  flex-shrink: 0;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roster-row-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-position-tag {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--input-bg);
  padding: 3px 9px;
  border-radius: 999px;
}

.roster-row-edit {
  width: 100%;
}

.roster-row-edit-basic {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.roster-row-edit-basic input[type="text"],
.roster-row-edit-basic select {
  margin-top: 0;
  width: auto;
  flex: 1 1 140px;
}

.roster-row-edit-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
}

.roster-row-edit-details .row {
  gap: 8px;
}

.add-player-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
}

.add-player-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.add-player-row input[type="text"],
.add-player-row input[type="number"],
.add-player-row select {
  margin-top: 0;
  width: auto;
  flex: 1 1 140px;
}

.add-player-row button {
  width: auto;
  margin-top: 0;
  flex-shrink: 0;
  padding: 12px 20px;
}

/* ---------- Scan Roster (manager team page) ---------- */

.scan-roster-area {
  margin-top: 10px;
}

.scan-roster-area button {
  width: auto;
  margin: 0;
  padding: 10px 18px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--panel-border);
}

.scan-roster-area button:hover {
  border-color: var(--accent);
  opacity: 1;
}

.scan-roster-status {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

.scan-review-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-tint);
}

.scan-review-panel h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

.scan-review-panel > p {
  font-size: 13px;
  margin-bottom: 14px;
}

.scan-review-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.scan-review-row input[type="text"],
.scan-review-row select {
  margin-top: 0;
  width: auto;
  flex: 1 1 140px;
  background: var(--panel);
}

.scan-review-row .delete-btn {
  flex-shrink: 0;
  padding: 8px 12px;
}

/* ---------- Style of Play notes (manager team page) ---------- */

.style-note {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  background: var(--input-bg);
}

.style-note-title {
  font-weight: 600;
  margin-top: 0;
}

.style-note-content {
  margin-top: 10px;
}

#add-style-note-btn {
  width: auto;
  margin: 4px 0 0;
  padding: 10px 18px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--panel-border);
}

#add-style-note-btn:hover {
  border-color: var(--accent);
  opacity: 1;
}

/* ---------- Systems (manager team page) ---------- */

/* The push-left slide: main and the sidebar are flex siblings, and the
   sidebar animates its own width from 0 to its open width. Main has no
   fixed width of its own, so it naturally reflows/shrinks as the sidebar
   grows - that's the "content slides left" effect, no transform hacks. */
.systems-layout {
  display: flex;
  align-items: flex-start;
}

.systems-layout .page-shell {
  flex: 1;
  min-width: 0;
}

.systems-sidebar {
  width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 68px);
  border-left: 1px solid var(--panel-border);
  background: var(--panel);
  transition: width 0.3s ease;
}

.systems-sidebar.is-open {
  width: 420px;
}

.systems-sidebar-inner {
  width: 420px;
  padding: 24px;
}

.systems-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.systems-sidebar-head h2 {
  font-size: 18px;
  margin-bottom: 0;
}

.systems-sidebar-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  margin: 0;
  width: auto;
}

.systems-sidebar-close:hover {
  color: var(--text);
  opacity: 1;
}

.systems-groups {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.systems-category-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin: 0 0 10px;
}

.systems-subcategory-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 12px 0 8px;
}

.systems-subcategory-heading:first-of-type {
  margin-top: 0;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

.systems-grid-item-add {
  border-style: dashed;
  color: var(--text-dim);
  font-weight: 500;
  justify-content: center;
}

.systems-grid-item-add:hover {
  color: var(--accent);
}

.systems-grid-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  margin: 0;
  width: 100%;
}

.systems-grid-item:hover {
  border-color: var(--accent);
  opacity: 1;
}

.systems-grid-item.is-configured {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.systems-grid-item-check {
  color: var(--accent);
  font-size: 13px;
  flex-shrink: 0;
}

.rink-hint {
  font-size: 12px;
  margin: 0 0 8px;
}

.systems-video-wrap {
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.systems-video-wrap video,
.systems-video-wrap audio {
  display: block;
  border-radius: var(--radius);
  background: var(--input-bg);
}

.systems-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.systems-tool-btn {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  margin: 0;
  width: auto;
}

.systems-tool-btn:hover:not(:disabled) {
  border-color: var(--accent);
  opacity: 1;
}

.systems-tool-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

.systems-tool-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.systems-toolbar-divider {
  width: 1px;
  background: var(--panel-border);
  margin: 2px 4px;
}

.rink-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  margin-bottom: 12px;
  touch-action: none;
  /* Dragging out a shape shouldn't select the zone labels. */
  user-select: none;
  -webkit-user-select: none;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--input-bg);
}

.rink-wrap.drawing-mode {
  cursor: crosshair;
}

.rink-wrap.drawing-mode .rink-marker {
  pointer-events: none;
}

.rink-shape {
  cursor: pointer;
}

.rink-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.rink-marker {
  position: absolute;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.rink-marker:active {
  cursor: grabbing;
}

/* Big rinks (expanded / filled editor, drawing over video) scale markers
   up to stay in proportion to the ice - see --marker-scale in
   rink-diagram.js. */
.rink-wrap .rink-marker {
  scale: var(--marker-scale, 1);
}

/* A stick: drawn in an inner svg that's rotated, so the selection outline
   on the marker itself stays a plain box. */
.rink-marker-stick {
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  background: transparent;
  box-shadow: none;
  border-radius: 6px;
}

.rink-stick-shape {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.rink-marker-puck {
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  background: #161616;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Position-based marker colors, same pattern as icehockeysystems.com's
   diagrams: forwards blue, defense red, goalie near-black. Fixed hex
   values rather than theme variables since these are meant to read the
   same way regardless of light/dark mode. */
.rink-marker-forward {
  background: #2f6fed;
  color: #ffffff;
}

.rink-marker-defense {
  background: #e2483a;
  color: #ffffff;
}

.rink-marker-goalie {
  background: #1a1a1a;
  color: #ffffff;
}

/* Near-black markers get a faint light ring so they don't disappear
   against the dark-theme rink. */
.rink-marker-goalie,
.rink-marker-puck,
.rink-pile-dot {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55), 0 2px 4px rgba(0, 0, 0, 0.4);
}

.rink-marker-opponent {
  background: #ffffff;
  color: #1a1a1a;
  border: 1.5px solid #1a1a1a;
}

.rink-marker-coach {
  background: #8e44ad;
  color: #ffffff;
}

.rink-marker.is-long-label {
  font-size: 8px;
}

.rink-marker.is-selected {
  outline: 2px solid #2ecc71;
  outline-offset: 2px;
}

.rink-wrap:focus {
  outline: none;
}

/* A small cluster of pucks - five dots inside a transparent hit area. */
.rink-marker-puck_pile {
  width: 20px;
  height: 18px;
  margin-left: -10px;
  margin-top: -9px;
  background: transparent;
  box-shadow: none;
  border-radius: 6px;
}

.rink-pile-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #161616;
}

.rink-pile-dot:nth-child(1) { left: 1px; top: 9px; }
.rink-pile-dot:nth-child(2) { left: 12px; top: 9px; }
.rink-pile-dot:nth-child(3) { left: 6px; top: 6px; }
.rink-pile-dot:nth-child(4) { left: 3px; top: 1px; }
.rink-pile-dot:nth-child(5) { left: 10px; top: 1px; }

/* Outer element stays a plain box so the selection outline isn't clipped
   by the triangle's clip-path. */
.rink-marker-cone {
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  background: transparent;
  box-shadow: none;
  border-radius: 4px;
}

.rink-cone-shape {
  width: 14px;
  height: 14px;
  background: #ff7a1a;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.rink-marker-net {
  width: 12px;
  height: 20px;
  margin-left: -6px;
  margin-top: -10px;
  background: rgba(231, 76, 60, 0.12);
  border: 1.5px solid #e74c3c;
  border-radius: 8px;
  box-shadow: none;
}

.rink-palette {
  align-items: center;
}

.rink-color-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  border: 2px solid var(--panel-border);
  cursor: pointer;
  flex: none;
}

.rink-color-swatch.is-active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--accent-tint);
}

/* Black / white swatches would blend into the panel in one theme or the
   other, so their edge is drawn in a stronger color. */
.rink-color-swatch.is-edge-swatch:not(.is-active) {
  border-color: var(--text-dim);
}

/* "Default" player color: forwards blue / defense red. */
.rink-color-swatch-default {
  background: linear-gradient(135deg, #2f6fed 50%, #e2483a 50%);
}

/* Players recolored to black get the same light ring as the goalie so
   they don't disappear on the dark-theme rink. */
.rink-marker.is-dark-fill {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55), 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Light copy drawn under black lines - only needed on the dark rink. */
.rink-contrast-halo {
  pointer-events: none;
}

[data-theme="light"] .rink-contrast-halo {
  display: none;
}

/* Half ice is one zone drawn at roughly the real proportions, and capped
   so it doesn't tower over the page in a wide card. */
.rink-wrap.is-half {
  aspect-ratio: 6 / 5;
  max-width: 520px;
}

.rink-palette-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-right: 2px;
}

@media (max-width: 720px) {
  .systems-sidebar.is-open {
    width: min(320px, 85vw);
  }

  .systems-sidebar-inner {
    width: min(320px, 85vw);
    padding: 18px;
  }

  .systems-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Analysis mode toggle (manager dashboard) ---------- */

.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.mode-toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-dim);
  cursor: pointer;
  margin-top: 0;
  text-align: center;
}

.mode-toggle-option input {
  accent-color: var(--accent);
  margin: 0;
}

.mode-toggle-option.is-selected {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-tint);
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 40px 20px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-art {
    order: -1;
  }

  .hero-art svg {
    max-width: 260px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-wrap: wrap;
  }

  .footer-inner p {
    margin-left: 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .profile-types-grid {
    grid-template-columns: 1fr;
  }

  .guest-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .guest-links {
    gap: 10px;
  }

  .add-player-row button {
    width: 100%;
  }
}

/* ---------- Custom drill editor (manager-practice-plans.html) ---------- */

.drill-editor-toggle {
  margin-top: 16px;
}

.drill-editor {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--input-bg);
}

/* ---------- Practice plan print / export (manager-practice-plans.html) ---------- */
/* #print-area is built dynamically right before window.print() - hidden on
   screen, shown only for print so the printed page is a clean plan sheet
   instead of the live builder with its buttons and selects. */

#print-area {
  display: none;
}

#print-area .print-meta {
  color: #555;
  margin: 4px 0 20px;
}

#print-area ol {
  padding-left: 20px;
}

#print-area li {
  margin-bottom: 10px;
}

#print-area .print-item-notes {
  font-size: 13px;
  color: #555;
  margin-top: 2px;
  white-space: pre-wrap;
}

#print-area .print-item-title {
  font-weight: 700;
}

#print-area .print-diagram {
  max-width: 520px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 8px;
  break-inside: avoid;
}

#print-area .print-diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

#print-area li {
  break-inside: avoid;
}

.plan-item-duration {
  width: 72px;
  padding: 4px 8px;
  margin: 0;
  font-size: 12px;
}

@media print {
  .site-header,
  .site-footer,
  main,
  .systems-sidebar {
    display: none !important;
  }

  #print-area {
    display: block !important;
    color: #000;
  }
}
/* ---------- Toast notices (site.js RinklyticsNotify) ---------- */

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--accent);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.toast-error {
  border-left-color: var(--danger-text);
}

.toast span {
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: auto;
  font-size: 13px;
}

@media print {
  .toast-stack {
    display: none !important;
  }
}

.plan-item-notes {
  margin: -4px 0 10px;
  font-size: 13px;
}

.rink-wrap:not(.drawing-mode) .rink-shape {
  cursor: move;
}

/* ---------- Practice presenter (practice-presenter.js) ---------- */
/* Full-viewport slideshow over the page; also the element that goes
   fullscreen. The rink diagram sits on a white board so it reads the same
   as the printout, whatever the theme. */

body.presenter-open {
  overflow: hidden;
}

.presenter {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.presenter-top,
.presenter-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  flex: none;
}

.presenter-top {
  border-bottom: 1px solid var(--panel-border);
}

.presenter-nav {
  border-top: 1px solid var(--panel-border);
  justify-content: space-between;
}

.presenter-progress {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 48px;
}

.presenter-top-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presenter-top-actions {
  display: flex;
  gap: 8px;
}

.presenter-icon-btn,
.presenter-nav-btn {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.presenter-nav-btn {
  padding: 12px 22px;
  font-size: 16px;
  white-space: nowrap;
}

.presenter-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.presenter-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px clamp(16px, 4vw, 48px);
  display: flex;
  touch-action: pan-y;
}

.presenter-overview,
.presenter-drill {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.presenter-title {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  margin: 0;
}

.presenter-meta {
  font-size: 18px;
  margin: 8px 0 24px;
}

.presenter-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.presenter-overview-list {
  list-style: none;
  counter-reset: drill;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.presenter-overview-list li {
  counter-increment: drill;
}

.presenter-overview-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 14px 18px;
  text-align: left;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: clamp(16px, 2vw, 22px);
}

.presenter-overview-item::before {
  content: counter(drill);
  font-family: var(--font-display);
  color: var(--accent);
  min-width: 24px;
}

.presenter-overview-name {
  flex: 1;
  font-weight: 600;
}

.presenter-overview-time {
  color: var(--text-dim);
  font-size: 0.8em;
  white-space: nowrap;
}

.presenter-drill-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.presenter-minutes {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 30px);
  color: var(--text-dim);
  white-space: nowrap;
}

.presenter-drill-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 24px;
}

.presenter-board {
  flex: 2;
  min-width: 0;
  min-height: 0;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.presenter-board svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: block;
}

/* A slide's video step: black letterbox instead of the white rink board. */
.presenter-board.presenter-media {
  background: #000;
  padding: 0;
  overflow: hidden;
}

.presenter-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.presenter-media audio {
  width: min(560px, 90%);
}

.presenter-notes {
  flex: 1;
  min-width: 0;
  overflow: auto;
  white-space: pre-wrap;
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--text);
}

.presenter-notes.is-large {
  font-size: clamp(20px, 2.4vw, 30px);
}

.presenter-notes.is-empty {
  color: var(--text-dim);
}

.presenter-next {
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-dim);
}

/* Portrait tablets/phones: diagram on top, notes underneath. */
@media (max-width: 900px), (orientation: portrait) {
  .presenter-drill-body {
    flex-direction: column;
  }

  .presenter-board {
    flex: none;
    height: auto;
  }

  .presenter-board svg {
    height: auto;
  }

  .presenter-nav-btn {
    padding: 10px 14px;
  }
}

/* Phones: drop the plan title from the top bar so nothing is cut off. */
@media (max-width: 520px) {
  .presenter-top-title {
    display: none;
  }

  .presenter-top {
    justify-content: space-between;
  }
}

/* Inline checkbox + sentence, e.g. "Also save to my Drill Library" -
   overrides the uppercase field-label style labels get by default. */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

/* ---------- Multiple diagrams per drill ---------- */

.rink-diagram-tabs {
  align-items: center;
}

.rink-diagram-tab {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rink-diagram-title {
  margin: 0 0 10px;
  font-size: 14px;
}

#print-area .print-diagram-caption {
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
}

.presenter-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 12px;
}

.presenter-step {
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text-dim);
  font-weight: 700;
  cursor: pointer;
}

.presenter-step.is-active {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

.presenter-step-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-left: 4px;
}

/* ---------- Your Team page: section tabs, headings, lines ---------- */

/* A bit wider than other page shells so the lines grid (up to five
   dropdowns per row) has room. */
.page-shell.team-page {
  max-width: 920px;
}

.team-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--panel-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.team-tabs::-webkit-scrollbar {
  display: none;
}

.team-tab {
  flex: none;
  width: auto;
  margin: 0 0 -1px;
  padding: 10px 16px;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.team-tab:hover {
  color: var(--text);
  opacity: 1;
}

.team-tab.is-active {
  color: var(--text);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

.team-panel[hidden] {
  display: none;
}

/* Headings in the team panels: bold, full-strength text color, and room
   to breathe between sections. */
.team-page .card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.team-page .card-head {
  margin-bottom: 8px;
}

.team-page .card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.team-page .card-intro {
  margin-bottom: 24px;
}

.team-page .systems-category-heading {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
}

.team-page .systems-subcategory-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 18px 0 8px;
}

.team-page .systems-groups {
  gap: 32px;
}

/* Lines: each group is its own bordered block with a column header row,
   so every line's LW / C / RW (etc.) dropdowns sit in straight columns. */
.lines-group {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 18px 20px 20px;
  margin-bottom: 20px;
}

.team-page .lines-group-title {
  margin: 0 0 12px;
}

.lines-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lines-row {
  display: grid;
  grid-template-columns: 64px repeat(var(--lines-slots), minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.lines-table.no-row-labels .lines-row {
  grid-template-columns: repeat(var(--lines-slots), minmax(0, 1fr));
}

.lines-head {
  padding-bottom: 2px;
}

.lines-col-label,
.lines-slot-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.lines-row-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.lines-slot {
  display: block;
  margin: 0;
  min-width: 0;
  text-transform: none;
  letter-spacing: normal;
}

/* Only shown on phones, where the header row is hidden. */
.lines-slot-label {
  display: none;
}

.lines-slot select {
  margin-top: 0;
  padding: 10px 8px;
  font-size: 14px;
  text-overflow: ellipsis;
}

.lines-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.lines-actions button {
  width: auto;
  margin: 0;
  padding: 12px 24px;
}

.lines-actions .avatar-upload-status {
  margin: 0;
}

/* Phones: one slot per line, its position label to the left. */
@media (max-width: 560px) {
  .team-page .card {
    padding: 20px;
  }

  .lines-group {
    padding: 14px;
  }

  .lines-head {
    display: none;
  }

  .lines-row,
  .lines-table.no-row-labels .lines-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--panel-border);
  }

  .lines-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }

  .lines-slot {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .lines-slot-label {
    display: block;
  }
}

/* ---------- History: clip grid + analysis sidebar (history.html) ---------- */

.page-shell.history-page {
  max-width: 1080px;
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.clip-grid-empty {
  grid-column: 1 / -1;
}

.clip-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: visible;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.clip-card:hover,
.clip-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.clip-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.clip-card.is-selected {
  background: var(--accent-tint);
}

.clip-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clip-card-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.clip-card-thumb-text {
  font-size: 12px;
  color: #aaa;
}

.clip-card-play {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  padding-left: 3px;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.clip-card:hover .clip-card-play {
  opacity: 1;
}

.clip-card-select {
  position: absolute;
  top: 8px;
  left: 8px;
  margin: 0;
  padding: 4px 5px;
  line-height: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.clip-card-select input {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.clip-card-menu {
  position: absolute;
  top: 6px;
  right: 6px;
}

.clip-card-menu .entry-menu-btn {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 6px;
}

.clip-card-body {
  padding: 10px 12px 12px;
  min-width: 0;
}

.clip-card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-card-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-sidebar.is-open,
.clip-sidebar .systems-sidebar-inner {
  width: 480px;
}

.clip-detail-head {
  align-items: flex-start;
  gap: 8px;
}

.clip-detail-head .entry-title-wrap {
  flex: 1;
  min-width: 0;
}

.clip-detail-head h2.entry-title {
  font-size: 18px;
  margin: 0;
}

.clip-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.clip-detail-actions {
  margin: 12px 0 4px;
}

@media (max-width: 720px) {
  .clip-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Phones: the analysis slides over the grid instead of squeezing it. */
  .clip-sidebar {
    position: fixed;
    right: 0;
    top: 68px;
    height: calc(100vh - 68px);
    z-index: 50;
  }

  .clip-sidebar.is-open {
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
  }

  .clip-sidebar.is-open,
  .clip-sidebar .systems-sidebar-inner {
    width: min(420px, 94vw);
  }
}

/* ---------- Video field for presentation slides (media-field.js) ---------- */

.media-field-preview video,
.media-field-preview audio {
  width: 100%;
  display: block;
  margin-bottom: 8px;
}

.media-field-preview video {
  max-height: 240px;
  background: #000;
  border-radius: var(--radius);
}

.gameplan-add-actions {
  margin: 4px 0 8px;
}

.style-note-video {
  margin: 4px 0 8px;
}

/* Inline "Notes & Video" panel under a system/lines item in a plan. */
.plan-item-extra {
  margin: -4px 0 12px;
}

.plan-item-extra .plan-item-notes {
  margin: 0 0 6px;
}

/* "+ Add Custom Drill" and "+ Add Video" side by side in the plan builder. */
.plan-add-buttons {
  display: flex;
  gap: 10px;
}

.plan-add-buttons button {
  flex: 1;
}

/* ---------- "Circle yourself" player marker (player-marker.js) ---------- */

.marker-stage {
  position: relative;
  max-width: 100%;
  line-height: 0;
}

.marker-stage video {
  margin-left: auto;
  margin-right: auto;
}

.marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.marker-layer.is-marking {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.marker-ring {
  position: absolute;
  border: 3px solid #ff2d55;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.player-marker {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--accent-tint);
}

.player-marker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.player-marker .player-marker-btn {
  width: auto;
  margin: 0;
  padding: 8px 16px;
  font-size: 13px;
}

.player-marker .player-marker-btn-quiet {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--panel-border);
}

.player-marker-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- Player's current goal (index.html) ---------- */

.goal-card {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-tint);
}

.goal-card-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.goal-card-text {
  margin: 6px 0 0;
  font-weight: 600;
  white-space: pre-wrap;
}

.goal-card-empty {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-dim);
}

.goal-card textarea {
  margin-top: 8px;
}

.goal-card-actions,
.goal-from-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.goal-card .goal-btn,
.goal-from-feedback .goal-btn {
  width: auto;
  margin: 0;
  padding: 8px 16px;
  font-size: 13px;
}

.goal-card .goal-btn-quiet {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--panel-border);
}

.goal-check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
}

.goal-check-option[hidden] {
  display: none;
}

.goal-check-option input {
  width: auto;
  margin: 0;
}

.goal-from-feedback[hidden] {
  display: none;
}

/* ---------- Patterns across a player's clips (history.html) ---------- */

.pattern-card h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-body);
}

.pattern-summary {
  margin: 8px 0 0;
}

.pattern-section {
  margin-top: 16px;
}

.pattern-section p {
  margin: 0;
  color: var(--text);
}

.pattern-card .pattern-summary {
  color: var(--text);
}

.pattern-focus {
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-tint);
}

.pattern-list {
  margin: 0;
  padding-left: 18px;
}

.pattern-list li {
  margin-bottom: 10px;
}

.pattern-clips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pattern-card .pattern-clip-chip {
  width: auto;
  margin: 0;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--panel-border);
}

.pattern-card .pattern-btn {
  width: auto;
  margin: 12px 0 0;
  padding: 8px 16px;
  font-size: 13px;
}

.pattern-card .pattern-btn-quiet {
  margin: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--panel-border);
}

.pattern-meta {
  font-size: 13px;
  color: var(--text-dim);
}

.pattern-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
}

/* ---------- Drills for weak spots (history.html) ---------- */

.drill-item {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
}

.drill-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drill-name {
  font-weight: 700;
}

.drill-item .pattern-meta {
  margin: 4px 0 0;
}

.drill-steps {
  margin: 8px 0 0;
  padding-left: 20px;
}

.drill-steps li {
  margin-bottom: 4px;
}

.pattern-section .drill-cue {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--accent);
}

/* ---------- Player <-> team link (profile.html, manager-team.html) ---------- */

.team-link .team-link-name {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.team-link-note {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-dim);
}

.team-link-code {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
}

.roster-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.roster-invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text);
}

.roster-linked-tag {
  color: var(--accent);
}

/* ---------- My Players table (manager-profile.html) ---------- */

.compare-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.compare-filters .compare-chip {
  width: auto;
  margin: 0;
  padding: 6px 14px;
  font-size: 13px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--panel-border);
}

.compare-filters .compare-chip.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.compare-table th,
.compare-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--panel-border);
  text-align: center;
  vertical-align: middle;
}

.compare-table tbody th {
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
}

.compare-table tbody th a {
  color: var(--text);
}

.compare-table thead th {
  vertical-align: bottom;
}

.compare-table .compare-sort {
  width: auto;
  margin: 0;
  padding: 0;
  background: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 0;
}

.compare-table thead th:first-child {
  text-align: left;
}

.compare-position {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
}

.compare-pill {
  display: inline-block;
  min-width: 38px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  color: #111;
}

.compare-count {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-dim);
}

.compare-score.is-thin .compare-pill {
  opacity: 0.45;
}

.compare-score.is-empty,
.compare-clips {
  color: var(--text-dim);
}

.compare-table .is-empty-row th {
  color: var(--text-dim);
  font-weight: 400;
}

.compare-average-row th,
.compare-average-row td {
  border-top: 2px solid var(--panel-border);
  border-bottom: none;
}

.player-marker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.player-marker-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  overflow: hidden;
}

.player-marker .player-marker-chip button {
  width: auto;
  margin: 0;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

.player-marker .player-marker-chip button + button {
  padding: 6px 10px 6px 4px;
  color: var(--text-dim);
}

.compare-note {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.compare-divider {
  width: 1px;
  align-self: stretch;
  margin: 0 4px;
  background: var(--panel-border);
}

.compare-table .compare-stat {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Your stats (history.html) ---------- */

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.stat-tile {
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
}

.stat-tile-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-tile-label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- Team performance chart (manager-profile.html) ---------- */
/* Categorical series colors, in fixed order (a category keeps its slot
   whatever the window shows). Dark theme is the default; light has its
   own steps for the light surface. */
.team-trend {
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
}

[data-theme="light"] .team-trend {
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;
}

.team-trend-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin: 6px 0 12px;
}

.team-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 8px;
}

.team-trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  margin: 0;
  padding: 2px 0;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.team-trend-legend-item.is-off {
  color: var(--text-dim);
  text-decoration: line-through;
}

.team-trend-legend-item.is-off .team-trend-swatch {
  opacity: 0.3;
}

.team-trend-swatch {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.team-trend-swatch.is-overall {
  height: 4px;
  background: var(--text);
}

.team-trend-chart {
  position: relative;
}

.team-trend-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.team-trend-grid {
  stroke: var(--panel-border);
  stroke-width: 1;
}

.team-trend-grid.is-standard {
  stroke-dasharray: 4 4;
  stroke: var(--text-dim);
  opacity: 0.5;
}

.team-trend-axis {
  fill: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-body);
}

.team-trend-crosshair {
  stroke: var(--text-dim);
  stroke-width: 1;
  opacity: 0.6;
  pointer-events: none;
}

.team-trend-tooltip {
  position: absolute;
  top: 8px;
  min-width: 180px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 12px;
  pointer-events: none;
  z-index: 2;
}

.team-trend-tooltip-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.team-trend-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
}

.team-trend-tooltip-row strong {
  margin-left: auto;
  padding-left: 12px;
  color: var(--text);
}

.team-trend-tooltip-row.is-overall {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Rink editor: expanded / fill / video overlay ---------- */

.rink-stage {
  display: flex;
  justify-content: center;
}

/* Expanded: the whole editor covers the window, toolbars on top and the
   rink sized (in rink-diagram.js) to the space underneath. */
body.rink-editor-open {
  overflow: hidden;
}

.rink-editor.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: var(--bg);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rink-editor.rink-editor-fill {
  display: flex;
  flex-direction: column;
}

.rink-editor.is-expanded .rink-stage,
.rink-editor.rink-editor-fill .rink-stage {
  flex: 1;
  min-height: 0;
  align-items: center;
}

.rink-editor.is-expanded .rink-wrap,
.rink-editor.rink-editor-fill .rink-wrap {
  aspect-ratio: auto;
  max-width: none;
  margin-bottom: 0;
  flex: none;
}

.rink-editor.is-expanded .rink-hint {
  display: none;
}

.rink-editor.is-expanded .entry-actions,
.rink-editor.rink-editor-fill .entry-actions {
  margin-top: 10px;
}

/* Drawing over a video: the surface sits over the picture, see-through. */
.rink-wrap.is-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
  background: transparent;
}

/* ---------- Board (manager-board.html) ---------- */
/* The editor fills the window under the header, so the rink is as big as
   the screen allows without scrolling. */
.board-page {
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
  box-sizing: border-box;
}

.board-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.board-head h1 {
  font-size: 22px;
  margin: 0;
}

.board-head p {
  margin: 0;
  flex: 1;
  font-size: 14px;
}

.board-head .board-clear-btn {
  width: auto;
  margin: 0;
  padding: 8px 16px;
}

.board-editor {
  flex: 1;
  min-height: 0;
}

.board-editor .rink-hint {
  display: none;
}

/* ---------- Manager home: My Players beside the upload ---------- */
/* My Players on the left, the existing upload column on the right; they
   stack (upload first) on narrower screens. */
.home-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.home-layout .dashboard {
  flex: 1 1 640px;
  max-width: 640px;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.home-layout .my-players {
  flex: 1 1 560px;
  min-width: 0;
  margin: 0;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow: auto;
}

.my-players h2 {
  margin-top: 0;
}

@media (max-width: 1080px) {
  .home-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .home-layout .dashboard {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
  }

  .home-layout .my-players {
    order: 2;
    position: static;
    max-height: none;
  }
}

@media (max-width: 520px) {
  .home-layout {
    padding: 32px 16px 48px;
  }
}

/* ---------- Drawing on video (video-draw.js) ---------- */

.video-draw-host {
  position: relative;
}

/* Sits exactly over the picture (not the letterbox bars). */
.video-draw-layer {
  position: absolute;
  z-index: 2;
}

.video-draw-layer.is-preview {
  pointer-events: none;
}

.video-draw-layer.is-preview svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Full-window editor for a My Clips video: video on the left, tools and
   the list of drawn frames on the right (stacked on narrow screens). */
.video-editor {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.video-editor-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--panel-border);
  flex: none;
}

.video-editor-title {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-editor-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

.video-editor-stage {
  flex: 1;
  min-width: 0;
  background: #000;
  display: flex;
}

.video-editor-frame {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.video-editor-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-editor-side {
  width: 380px;
  flex: none;
  overflow-y: auto;
  padding: 16px;
  border-left: 1px solid var(--panel-border);
  background: var(--panel);
}

.video-editor-intro {
  font-size: 14px;
  margin: 0 0 12px;
}

.video-editor-side .video-editor-primary,
.video-editor-side .video-editor-save {
  width: 100%;
  margin: 0 0 12px;
}

.video-editor-tools .systems-toolbar {
  flex-wrap: wrap;
}

.video-editor-list-head {
  font-size: 14px;
  margin: 16px 0 8px;
}

.video-editor-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 6px;
}

.video-editor-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
}

.video-editor-item.is-active {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.video-editor-empty {
  font-size: 13px;
  color: var(--text-dim);
}

.video-editor-item .video-editor-time,
.video-editor-item .video-editor-remove {
  width: auto;
  margin: 0;
  padding: 4px 10px;
  font-size: 13px;
}

.video-editor-hold {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto 0 0;
  font-size: 12px;
  text-transform: none;
  letter-spacing: normal;
}

.video-editor-hold input {
  width: 56px;
  margin: 0;
  padding: 4px 6px;
}

.video-editor-progress {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--panel-border);
  margin-bottom: 8px;
}

.video-editor-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.video-editor-status {
  font-size: 13px;
}

@media (max-width: 900px) {
  .video-editor-body {
    flex-direction: column;
  }

  .video-editor-stage {
    flex: none;
    height: 45vh;
  }

  .video-editor-side {
    width: auto;
    flex: 1;
    border-left: none;
    border-top: 1px solid var(--panel-border);
  }
}

.clip-draw-row {
  margin-top: 8px;
}

/* ---------- Presenter: full-screen video step ---------- */
/* The video fills the window; the slide's name and notes sit in a bar
   along the bottom with the controls, and the usual top/bottom bars hide. */
.presenter.is-video-step .presenter-top,
.presenter.is-video-step .presenter-nav {
  display: none;
}

.presenter.is-video-step .presenter-stage {
  padding: 0;
  overflow: hidden;
}

.presenter-video-slide {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}

.presenter-video-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.presenter-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.presenter-video-tools {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  max-width: calc(100% - 20px);
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.presenter-video-tools .systems-toolbar {
  flex-wrap: wrap;
  margin: 0 0 6px;
}

.presenter-video-tools .entry-actions {
  margin: 0;
}

.presenter-video-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--panel);
  border-top: 1px solid var(--panel-border);
  color: var(--text);
}

.presenter-video-info {
  flex: 1;
  min-width: 0;
}

.presenter-video-info .presenter-eyebrow {
  margin-bottom: 2px;
}

.presenter-video-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 1.2;
}

.presenter-video-notes {
  margin-top: 4px;
  font-size: clamp(14px, 1.4vw, 17px);
  color: var(--text-dim);
  white-space: pre-wrap;
  max-height: 4.8em;
  overflow-y: auto;
}

.presenter-video-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.presenter-video-controls .presenter-steps {
  margin: 0 8px 0 0;
}

.presenter-video-controls .presenter-nav-btn {
  padding: 8px 16px;
  font-size: 15px;
}

@media (max-width: 720px) {
  .presenter-video-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .presenter-video-controls {
    justify-content: space-between;
  }
}

.rink-editor [hidden],
.video-editor [hidden],
.presenter [hidden] {
  display: none !important;
}

/* ---------- Analysis pipeline (pipeline.html) ---------- */
.pipeline-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.pipeline-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 4px;
}

.pipeline-card h2 {
  margin-top: 0;
}

.pl-muted {
  color: var(--text-dim);
  font-size: 13px;
}

.pl-status-error,
.pl-bad-text {
  color: var(--danger-text);
}

.pl-warn-text {
  color: var(--favorite-text);
}

/* Flags */
.pl-flags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.pl-flag {
  border-left: 4px solid var(--panel-border);
  background: var(--input-bg);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
}

.pl-flag.tone-bad { border-left-color: var(--danger-text); }
.pl-flag.tone-warn { border-left-color: var(--favorite-text); }
.pl-flag.tone-info { border-left-color: var(--accent); }
.pl-flag.tone-good { border-left-color: #27ae60; }

.pl-flag-btn {
  all: unset;
  cursor: pointer;
  display: block;
  width: 100%;
  color: var(--text);
}

.pl-flag-btn:hover {
  text-decoration: underline;
}

/* Clip + "at this moment" */
.pl-clip {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
  margin-bottom: 16px;
}

.pl-video-box {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.pl-video-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pl-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pl-ring {
  fill: none;
  stroke-width: 3;
}

.pl-ring.conf-user_marked { stroke: #e2483a; }
.pl-ring.conf-inferred_high { stroke: #27ae60; }
.pl-ring.conf-inferred_medium { stroke: #f5a623; }
.pl-ring.is-user { stroke: #ffffff; stroke-dasharray: 6 4; }

.pl-now {
  background: var(--input-bg);
  border-radius: var(--radius);
  padding: 12px;
  overflow-y: auto;
  max-height: 360px;
}

.pl-now h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.pl-now-item {
  display: flex;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--panel-border);
}

.pl-now-t {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  flex: none;
}

.pl-now-item.tone-bad { color: var(--danger-text); }
.pl-now-item.tone-dropped { color: var(--text-dim); text-decoration: line-through; }

/* Timeline lanes */
.pl-timeline {
  position: relative;
  cursor: crosshair;
}

.pl-lane {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid var(--panel-border);
}

.pl-lane-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.pl-lane-track {
  position: relative;
  height: 30px;
}

.pl-lane-track.is-staggered {
  height: 46px;
}

.pl-mark {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.pl-mark.is-tick {
  width: 3px;
  height: 18px;
  border-radius: 2px;
}

.conf-user_marked { background: #e2483a; }
.conf-inferred_high { background: #27ae60; }
.conf-inferred_medium { background: #f5a623; }
.conf-lost { background: var(--panel-border); }

.pl-mark.is-circle {
  color: #e2483a;
  font-size: 18px;
}

.pl-mark.is-event,
.pl-legend-swatch.is-event {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 3px 6px;
  border-radius: 999px;
}

.pl-mark.is-event.is-shot {
  background: #f5a623;
  color: #1a1a1a;
}

.pl-mark.is-dropped,
.pl-legend-swatch.is-dropped {
  border: 1.5px dashed var(--danger-text);
  color: var(--danger-text);
  padding: 2px 6px;
  border-radius: 999px;
}

.pl-mark.is-writeup,
.pl-legend-swatch.is-writeup {
  background: var(--panel);
  border: 1.5px solid var(--text-dim);
  color: var(--text);
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.pl-mark.is-writeup.is-unmatched,
.pl-legend-swatch.is-writeup.is-unmatched {
  border-color: var(--danger-text);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.pl-span {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  top: 5px;
  height: 20px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  padding: 0 6px;
  line-height: 20px;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  color: #fff;
  opacity: 0.85;
}

/* Overlapping chunks alternate height so both stay visible. */
.pl-span.series-1 { background: #3987e5; }
.pl-span.series-2 { background: #9085e9; top: 9px; }
.pl-span.series-3 { background: #199e70; }
.pl-span.series-4 { background: #d55181; top: 9px; }
.pl-span.is-error { background: var(--danger-text); }
.pl-span.is-skipped { background: var(--panel-border); color: var(--text-dim); }

.pl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text);
  opacity: 0.6;
  pointer-events: none;
}

.pl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.pl-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pl-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.pl-legend-swatch.is-event,
.pl-legend-swatch.is-dropped,
.pl-legend-swatch.is-writeup {
  padding: 0;
  width: 14px;
  height: 14px;
}

/* Flow graph */
.pl-flow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pl-flow-col {
  flex: 1 1 0;
  min-width: 190px;
  display: grid;
  gap: 8px;
}

.pl-flow-stage {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 4px;
}

.pl-flow-arrow {
  align-self: center;
  color: var(--text-dim);
  font-size: 20px;
  padding-top: 24px;
}

.pl-node {
  all: unset;
  box-sizing: border-box;
  display: block;
  cursor: pointer;
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--panel-border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--input-bg);
}

.pl-node:hover,
.pl-node.is-selected {
  border-color: var(--accent);
}

.pl-node.is-model { border-left-color: #9085e9; }
.pl-node.is-code { border-left-color: #3987e5; }
.pl-node.is-io { border-left-color: var(--text-dim); }
.pl-node.tone-warn { background: var(--favorite-bg); }
.pl-node.tone-bad,
.pl-node.is-error { background: var(--danger-bg); }

.pl-node-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

.pl-node-label {
  font-size: 13px;
  font-weight: 600;
  margin: 2px 0;
}

.pl-node-stat {
  font-size: 12px;
  color: var(--text-dim);
}

/* Step detail */
.pl-detail {
  margin-top: 16px;
  border-top: 1px solid var(--panel-border);
  padding-top: 16px;
}

.pl-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pl-detail-head h3 {
  margin: 0;
}

.pl-detail-close {
  width: auto;
  margin: 0;
  padding: 4px 10px;
}

.pl-detail-section {
  margin-top: 10px;
}

.pl-detail-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.pl-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
  background: var(--input-bg);
  border-radius: 8px;
  padding: 12px;
  max-height: 480px;
  overflow: auto;
}

.pl-stills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pl-stills figure {
  margin: 0;
  width: 220px;
}

.pl-stills img {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.pl-stills figcaption {
  font-size: 12px;
  color: var(--text-dim);
}

.pl-table-wrap {
  overflow-x: auto;
}

.pl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pl-table th,
.pl-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--panel-border);
  vertical-align: top;
}

.pl-seek {
  width: auto;
  margin: 0;
  padding: 2px 8px;
  font-size: 12px;
}

@media (max-width: 860px) {
  .pl-clip {
    grid-template-columns: 1fr;
  }

  .pl-lane {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .pl-flow {
    flex-direction: column;
    align-items: stretch;
  }

  .pl-flow-arrow {
    transform: rotate(90deg);
    padding: 0;
    align-self: center;
  }
}

/* ---------- Live game page (live.html) ---------- */

.live-page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.live-head h1,
.live-topbar h1 {
  margin: 0 0 6px;
}

.live-head p {
  color: var(--text-dim);
  margin: 0 0 24px;
  max-width: 62ch;
}

.live-list {
  display: grid;
  gap: 10px;
}

.live-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
}

.live-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.live-row-meta,
.live-note,
.live-empty,
.live-lag {
  color: var(--text-dim);
  font-size: 13px;
}

.live-note,
.live-empty {
  margin: 10px 0 0;
  line-height: 1.5;
}

.live-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: end;
}

.live-form button {
  margin-top: 0;
}

a.live-btn,
button.live-btn {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

a.live-btn:hover,
button.live-btn:hover {
  border-color: var(--accent);
  opacity: 1;
}

button.live-btn-danger {
  color: var(--danger-text);
}

.live-topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.live-back {
  flex-basis: 100%;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
}

.live-back:hover {
  color: var(--accent);
}

.live-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}

.live-pill-live {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.live-pill-wait {
  color: var(--favorite-text);
  background: var(--favorite-bg);
  border-color: var(--favorite-bg);
}

.live-pill-off {
  color: var(--danger-text);
  background: var(--danger-bg);
  border-color: var(--danger-bg);
}

.live-pill-final {
  color: var(--text);
}

.live-lag {
  margin: 8px 0 20px;
}

.live-cmd {
  margin: 12px 0;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  font-size: 12.5px;
  line-height: 1.6;
}

.live-scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.live-sb-cell {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
}

.live-sb-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-sb-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.live-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

button.live-tab {
  width: auto;
  margin: 0;
  padding: 8px 18px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
}

button.live-tab-on {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--text);
}

.live-teams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.live-team {
  margin-bottom: 0;
  padding: 24px;
}

.live-team h2 {
  margin: 0 0 4px;
}

.live-tile-hint {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-dim);
}

.live-teams + .live-note {
  margin: 12px 0 24px;
}

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

.live-table th,
.live-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
  font-variant-numeric: tabular-nums;
}

.live-table th {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.live-table td:first-child {
  text-transform: capitalize;
}

.live-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.live-feed li {
  display: flex;
  gap: 12px;
}

.live-feed-time {
  flex: 0 0 90px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.live-feed-text {
  text-transform: capitalize;
}

.live-experimental summary {
  cursor: pointer;
  font-weight: 600;
}

.live-honest {
  margin-top: 8px;
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .live-page {
    padding: 20px 12px 48px;
  }

  .live-row {
    flex-wrap: wrap;
  }

  .live-row-info {
    flex-basis: 100%;
  }
}

.live-table td:first-child,
.live-feed-text {
  text-transform: none;
}

.live-steps {
  margin: 12px 0 16px;
  padding-left: 22px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.live-cmdblock {
  margin-top: 16px;
}

.live-cmd-label {
  font-weight: 600;
  font-size: 14px;
}

.live-cmdblock .live-cmd {
  margin: 8px 0;
}

#g-setup .live-tabs {
  margin-top: 4px;
}

.live-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

button.live-btn-main {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.live-control p {
  margin: 0;
  line-height: 1.5;
}

.live-urlrow {
  display: flex;
  gap: 8px;
  margin: 8px 0 4px;
}

.live-urlrow input {
  flex: 1;
  min-width: 0;
}

.live-urlrow button {
  margin-top: 0;
  width: auto;
}

.live-help {
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.5;
}

.live-help summary,
#setup-tech summary {
  cursor: pointer;
  font-weight: 600;
}

#setup-tech {
  margin-top: 16px;
}

#setup-tech[open] summary {
  margin-bottom: 8px;
}

.live-result {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
}

.live-still {
  display: block;
  max-width: 100%;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.live-line {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.5;
}

.live-line-good::before { content: "\2713  "; color: var(--accent); font-weight: 700; }
.live-line-warn { color: var(--favorite-text); }
.live-line-bad,
.live-bad { color: var(--danger-text); }

#cam-start {
  margin-top: 8px;
}

/* ---- Intermission report ---- */
.im-points { margin: 4px 0 16px; gap: 8px; }
.im-points li { display: list-item; list-style: disc; margin-left: 20px; line-height: 1.5; }
.im-rowpick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; font-size: 14px; }
.im-table td.im-num { font-weight: 600; width: 22%; }
.im-table td.im-why { color: var(--text-dim); font-size: 13px; }
.im-table tr.im-group td { padding-top: 16px; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; border-bottom: 1px solid var(--panel-border); }
.im-label { line-height: 1.4; }
.im-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border: 1px solid var(--panel-border); border-radius: 999px; font-size: 11px; color: var(--text-dim); }
button.im-info { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--panel-border); background: transparent; color: var(--text-dim); font: italic 600 12px/1 serif; cursor: pointer; vertical-align: middle; }
button.im-info[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.im-defrow td { padding: 0 10px 12px; }
.im-def { padding: 12px 14px; border: 1px solid var(--panel-border); border-radius: var(--radius); font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.im-def p { margin: 0 0 6px; }
.im-def p:last-child { margin-bottom: 0; }
.im-visuals { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.im-visuals h3 { margin: 0 0 8px; font-size: 14px; }
.im-figs { display: flex; flex-wrap: wrap; gap: 12px; }
.im-fig { margin: 0; flex: 1 1 200px; max-width: 260px; }
.im-fig figcaption { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.im-svg { width: 100%; height: auto; display: block; }
.im-svg-wide { max-width: 420px; }
.im-cell { fill: var(--accent); }
.im-net { fill: none; stroke: var(--text-dim); stroke-width: 1.5; }
.im-axis { font-size: 8px; fill: var(--text-dim); }
.im-shot { stroke-width: 1.5; fill: none; }
.im-shot-us { stroke: var(--text); }
.im-shot-them { stroke: var(--text-dim); }
.im-shot-on { fill: currentColor; }
.im-shot-us.im-shot-on { fill: var(--text); }
.im-shot-them.im-shot-on { fill: var(--text-dim); }
.im-bar-us { fill: var(--accent); }
.im-bar-them { fill: var(--panel-border); }
.im-actions { margin-top: 16px; }
