.player-card {
  border: 1px solid #ccc;
  padding: 16px;
  margin: 16px 0;
  max-width: 420px;
}

.player-card p {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  margin: 4px 0;
}

.rank-green {
  background-color: #c8f7c5;
}

.rank-yellow {
  background-color: #fff3b0;
}

.rank-orange {
  background-color: #ffd59e;
}

.rank-red {
  background-color: #ffb3b3;
}

#dashboardRink,
#playerShotMapRink,
.player-card-rink {
  position: relative;
  border: 3px solid #333;
  border-radius: 80px;
  background: #f8f8f8;
  overflow: hidden;
}

#dashboardRink,
#playerShotMapRink {
  width: 800px;
  height: 340px;
}

.player-card-rink {
  width: 380px;
  height: 160px;
}

.goal-line,
.blue-line,
.center-line {
  position: absolute;
  top: 0;
  height: 100%;
  width: 3px;
}

.goal-line,
.center-line {
  background: red;
}

.blue-line {
  background: blue;
}

.left-goal-line {
  left: 5.5%;
}

.right-goal-line {
  left: 94.5%;
}

.left-blue-line {
  left: 37.5%;
}

.right-blue-line {
  left: 62.5%;
}

.center-line {
  left: 50%;
}

.faceoff-circle,
.center-circle {
  position: absolute;
  width: 15%;
  aspect-ratio: 1 / 1;
  border: 3px solid red;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.left-zone {
  left: 17.25%;
}

.right-zone {
  left: 82.75%;
}

.top {
  top: 24%;
}

.bottom {
  top: 76%;
}

.center-circle {
  left: 50%;
  top: 50%;
}

.faceoff-dot,
.neutral-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: red;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.left-top-dot {
  left: 17%;
  top: 24%;
}

.left-bottom-dot {
  left: 17%;
  top: 76%;
}

.right-top-dot {
  left: 83%;
  top: 24%;
}

.right-bottom-dot {
  left: 83%;
  top: 76%;
}

.left-top-neutral {
  left: 42.5%;
  top: 24%;
}

.left-bottom-neutral {
  left: 42.5%;
  top: 76%;
}

.right-top-neutral {
  left: 57.5%;
  top: 24%;
}

.right-bottom-neutral {
  left: 57.5%;
  top: 76%;
}

.crease {
  position: absolute;
  top: 50%;
  width: 4%;
  height: 14%;
  border: 3px solid blue;
  transform: translateY(-50%);
}

.left-crease {
  left: 5.5%;
  border-left: none;
  border-radius: 0 40px 40px 0;
}

.right-crease {
  right: 5.5%;
  border-right: none;
  border-radius: 40px 0 0 40px;
}

.shot-dots-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.goal-line,
.blue-line,
.center-line,
.faceoff-circle,
.center-circle,
.faceoff-dot,
.neutral-dot,
.crease {
  pointer-events: none;
}

.shot-dot {
  position: absolute;
  z-index: 20;
}

.player-card-dots {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.player-card-shot-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.shot-dots-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.shot-dot {
  position: absolute;
  z-index: 20;
}

.dashboard-panel {
  display: none;
}

.dashboard-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.dashboard-tabs {
  display: flex;
  gap: 8px;
  margin: 15px 0;
}

.dashboard-tabs button {
  padding: 8px 16px;
  border: 1px solid #ccc;
  background: #f4f4f4;
  cursor: pointer;
}

.dashboard-tabs button.active {
  background: #2c3e50;
  color: white;
}

.tab-dropdown {
  position: relative;
  display: inline-block;
}

.tab-dropdown-menu {
  display: none;
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  min-width: 150px;
  z-index: 100;
}

.tab-dropdown:hover .tab-dropdown-menu {
  display: block;
}

.tab-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 8px;
  text-align: left;
  border: none;
  background: white;
  cursor: pointer;
}

.tab-dropdown-menu button:hover {
  background: #eee;
}

.dashboard-tabs {
  display: flex;
  gap: 8px;
  margin: 15px 0;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: white;
  min-width: 160px;
  border: 1px solid #ccc;
  z-index: 1000;
}

.dropdown-content a {
  display: block;
  padding: 8px;
  text-decoration: none;
  color: black;
}

.dropdown-content a:hover {
  background: #eee;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.shot-dots-layer {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.shot-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: black;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  pointer-events: auto;
}

.goal-dot {
  width: 14px;
  height: 14px;
  background: rgb(0, 255, 64);
}

.shot-map-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.shot-map-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-layout {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.home-record,
.home-top-players {
  min-width: 280px;
}

.home-record p,
.home-top-players p {
  margin: 4px 0;
}

.home-record button,
.home-top-players button {
  margin: 12px 0 8px 0;
}

.playlist-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

#playlistCounter {
  font-weight: bold;
}

.clickable-stat {
  cursor: pointer;
  text-decoration: underline dotted;
}

.clickable-stat:hover {
  background-color: #eef4ff;
}

p.clickable-stat {
  cursor: pointer;
}

p.clickable-stat:hover strong {
  text-decoration: underline dotted;
}

.single-player-layout {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 16px;
  align-items: flex-start;
}

.single-player-main {
  flex: 2;
  min-width: 500px;
}

.single-player-main table {
  margin-bottom: 24px;
  table-layout: fixed;
  width: 100%;
  font-size: 0.8rem;
}

.single-player-main table th,
.single-player-main table td {
  padding: 6px 7px;
}

.single-player-main table th:first-child,
.single-player-main table td:first-child {
  width: 14%;
}

.single-player-main table th:last-child,
.single-player-main table td:last-child {
  width: 10%;
}

.single-player-card {
  flex: 1;
  min-width: 280px;
}

.clickable-player {
  cursor: pointer;
  text-decoration: underline dotted;
}

.clickable-player:hover {
  color: #1a4d8f;
}

.player-shot-map-section {
  margin-top: 32px;
  clear: both;
}

.player-shot-map-section .shot-map-controls {
  margin-bottom: 16px;
}

#videoOverlay {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  background: white;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  width: 660px;
}

#videoOverlayHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2c3e50;
  color: white;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  cursor: move;
  user-select: none;
}

#videoOverlayTitle {
  font-weight: bold;
}

#videoOverlayCloseBtn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2em;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

#videoOverlayCloseBtn:hover {
  color: #ff8080;
}

#videoOverlayBody {
  padding: 12px;
}

#shotVideoFrame {
  display: block;
  max-width: 100%;
}

#playlistPlayerContainer {
  max-width: 100%;
}

.goalie-tag-row {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.goalie-tag-row label {
  display: inline-block;
  margin-right: 16px;
  margin-bottom: 8px;
}

.goalie-flags {
  margin: 8px 0;
}

.goalie-flags label {
  margin-right: 12px;
  font-weight: normal;
}

.goalie-subtabs {
  margin-bottom: 16px;
}

.goalie-subtabs button {
  margin-right: 8px;
}

.goalie-net-grid {
  display: inline-block;
  border: 2px solid #333;
  margin-bottom: 16px;
}

.goalie-net-row {
  display: flex;
}

.goalie-net-cell {
  width: 120px;
  height: 80px;
  border: 1px solid #999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.9em;
}

.goalie-net-cell.clickable-stat {
  cursor: pointer;
}

.goalie-net-cell.clickable-stat:hover {
  background-color: #eef4ff;
}

#goalieIceZoneRink {
  position: relative;
  width: 800px;
  height: 340px;
  border: 3px solid #333;
  border-radius: 80px;
  background: #f8f8f8;
  overflow: hidden;
  margin-bottom: 16px;
}

.ice-zone-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  max-width: 600px;
  font-size: 0.9em;
}

/* ============================================================
   Design pass -- Home tab (proof of concept before extending
   further). Palette, type, and the section-header signature (a red
   line over a blue line, echoing the rink's own lines) are all
   deliberate choices for a hockey analytics tool used by coaches who
   need to scan it fast, not be impressed by it.
   ============================================================ */

:root {
  --ink: #0b1220;
  --ice: #f5f8fb;
  --rink-blue: #1b3a6b;
  --rink-blue-light: #2e5490;
  --goal-red: #c8102e;
  --win-green: #1e8a5f;
  --steel: #5b6472;
  --card-white: #ffffff;
  --hairline: #dce3ea;

  --font-display: "Barlow Condensed", sans-serif;
  --font-body: "Inter", sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--ice);
  color: var(--ink);
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.01em;
  color: var(--rink-blue);
  margin-bottom: 2px;
}

.dashboard-tabs {
  display: flex;
  gap: 2px;
  margin: 20px 0 28px;
  border-bottom: 2px solid var(--hairline);
}

.dashboard-tabs button {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--steel);
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.dashboard-tabs button:hover {
  color: var(--rink-blue);
  border-bottom-color: var(--hairline);
}

.section-header {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 36px 0 14px;
  padding-bottom: 10px;
  background-image: linear-gradient(var(--goal-red), var(--goal-red)),
    linear-gradient(var(--rink-blue), var(--rink-blue));
  background-size: 56px 2px, 56px 2px;
  background-position: left bottom, left calc(100% - 6px);
  background-repeat: no-repeat;
}

/* Scoreboard strip */
.home-scoreboard {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.scoreboard-block {
  background: var(--card-white);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 18px 28px;
  min-width: 220px;
  flex: 1;
}

.scoreboard-eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--steel);
  display: block;
  margin-bottom: 6px;
}

.scoreboard-record,
.scoreboard-diff {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1;
}

.wl-number.win { color: var(--win-green); }
.wl-number.loss { color: var(--goal-red); }
.wl-number.otl { color: var(--steel); }
.wl-sep { color: var(--hairline); margin: 0 2px; }

.scoreboard-diff { color: var(--ink); }
.scoreboard-diff.positive { color: var(--win-green); }
.scoreboard-diff.negative { color: var(--goal-red); }

.scoreboard-caption {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--steel);
}

/* Stat tile grid */
.stat-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.stat-tile {
  background: var(--card-white);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1.15;
  color: var(--ink);
}

.stat-value.positive { color: var(--win-green); }
.stat-value.negative { color: var(--goal-red); }

.stat-label {
  font-size: 0.75rem;
  color: var(--steel);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
}

/* Leaderboard cards */
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.leaderboard-card {
  background: var(--card-white);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 16px 8px;
}

.leaderboard-card h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--rink-blue);
  margin: 0 0 8px;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--hairline);
  font-size: 0.9rem;
}

.leaderboard-list li:first-child { border-top: none; }

.leaderboard-list .rank {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--steel);
  width: 16px;
  flex-shrink: 0;
}

.leaderboard-list .clickable-player {
  flex: 1;
  color: var(--rink-blue);
  font-weight: 500;
  text-decoration: none;
}

.leaderboard-list .clickable-player:hover {
  color: var(--goal-red);
}

.leaderboard-value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}

.leaderboard-empty {
  color: var(--steel);
  font-style: italic;
  font-size: 0.85rem;
  padding: 6px 0;
}

/* ============================================================
   Design pass, extended to the rest of the app. Generic element
   styling (tables, buttons, form controls, headings) applies the same
   tokens/signature everywhere at once, since nearly every panel
   shares these same building blocks -- no markup changes needed for
   most of this to take effect.
   ============================================================ */

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.01em;
  color: var(--rink-blue);
  margin: 0 0 20px;
}

h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 28px 0 12px;
  padding-bottom: 8px;
  background-image: linear-gradient(var(--goal-red), var(--goal-red)),
    linear-gradient(var(--rink-blue), var(--rink-blue));
  background-size: 44px 2px, 44px 2px;
  background-position: left bottom, left calc(100% - 5px);
  background-repeat: no-repeat;
}

button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--rink-blue);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 15px;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:hover {
  background: var(--rink-blue-light);
}

button:active {
  transform: translateY(1px);
}

select,
input[type="text"],
input[type="number"],
input[type="date"] {
  font-family: var(--font-body);
  font-size: 0.88rem;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--card-white);
  color: var(--ink);
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--rink-blue);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.15);
}

label {
  font-size: 0.85rem;
  color: var(--steel);
  font-weight: 500;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0 20px;
  background: var(--card-white);
  border: 1px solid var(--hairline);
  font-size: 0.88rem;
}

thead {
  background: var(--rink-blue);
}

thead th {
  color: white;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.75rem;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
}

tbody td {
  padding: 7px 12px;
  border-top: 1px solid var(--hairline);
  color: var(--ink);
}

tbody tr:hover {
  background: var(--ice);
}

/* Card-style treatment for existing control/content containers */
.shot-map-controls,
.player-card-shot-controls,
.goalie-net-grid,
#goalieGameAssignment,
.single-player-card {
  background: var(--card-white);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 16px 20px;
}

.goalie-tag-row {
  background: var(--card-white);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}

.clickable-stat {
  color: var(--rink-blue);
}

.clickable-stat:hover {
  color: var(--goal-red);
  background-color: rgba(27, 58, 107, 0.06);
}

.clickable-player {
  color: var(--rink-blue);
}

.clickable-player:hover {
  color: var(--goal-red);
}

/* Video overlay */
#videoOverlay {
  border-color: var(--hairline);
  font-family: var(--font-body);
}

#videoOverlayHeader {
  background: var(--rink-blue);
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.playlist-controls button {
  background: var(--rink-blue);
}


/* Fullscreen layout for the playlist section -- video fills the
   available space, Previous/Next/Fullscreen stay visible along the
   bottom instead of disappearing the way they would if only the
   YouTube iframe itself went fullscreen. */
#playlistSection:fullscreen {
  background: black;
  width: 100vw;
  height: 100vh;
  position: relative;
}

#playlistSection:-webkit-full-screen {
  background: black;
  width: 100vw;
  height: 100vh;
  position: relative;
}

#playlistSection:fullscreen #playlistPlayerContainer,
#playlistSection:-webkit-full-screen #playlistPlayerContainer {
  width: 100%;
  height: 100%;
}

#playlistSection:fullscreen .playlist-controls,
#playlistSection:-webkit-full-screen .playlist-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  padding: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  z-index: 10;
}

#playlistSection:fullscreen #playlistDescription,
#playlistSection:fullscreen #playlistStatus,
#playlistSection:-webkit-full-screen #playlistDescription,
#playlistSection:-webkit-full-screen #playlistStatus {
  display: none;
}

#playlistSection:fullscreen #playlistCounter,
#playlistSection:-webkit-full-screen #playlistCounter {
  color: white;
}

.login-gate {
  max-width: 400px;
  margin: 60px auto;
  background: var(--card-white);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 32px;
}

/* ============================================================
   Player Totals: frozen header row and frozen player column.

   position:sticky needs a scrolling ancestor, so the table is wrapped
   in .totals-scroll rather than letting the page scroll -- otherwise
   there is nothing for the cells to stick to.

   border-collapse must be separate here: with collapse, borders belong
   to the table rather than the cells, and sticky cells leave their
   borders behind when they move. Cell backgrounds are set explicitly
   for the same reason -- a sticky cell that inherits its background
   from thead or table paints as transparent and the rows scroll
   visibly underneath it.
   ============================================================ */

.totals-scroll {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  margin: 10px 0 20px;
}

.totals-scroll table {
  margin: 0;
  border: none;
  border-collapse: separate;
  border-spacing: 0;
  /* Let the 36 columns take the width they need instead of being
     crushed to fit, while still filling the panel when there are few. */
  width: max-content;
  min-width: 100%;
}

.totals-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--rink-blue);
  white-space: nowrap;
}

/* The top-left cell has to outrank both, since it stays fixed
   vertically and horizontally at the same time. */
.totals-scroll thead th:first-child {
  left: 0;
  z-index: 3;
}

.totals-scroll tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card-white);
  border-right: 1px solid var(--hairline);
  white-space: nowrap;
}

/* Without this the frozen name cell keeps its own background and the
   row-hover highlight stops dead at the second column. */
.totals-scroll tbody tr:hover td:first-child {
  background: var(--ice);
}

/* ============================================================
   Stat description tooltips (Player Totals headers).

   Sized deliberately large and high-contrast -- these are read by
   coaches, sometimes on a laptop across a room, and the default
   browser tooltip was too small to be useful. It lives in <body>
   rather than inside the header cell so the scroll container can't
   clip it; JS sets left/top.
   ============================================================ */

.stat-info {
  display: inline-block;
  margin-left: 4px;
  font-size: 1.05rem;
  line-height: 1;
  cursor: help;
  opacity: 0.9;
}

.stat-info:hover {
  opacity: 1;
}

#statTooltip {
  position: fixed;
  display: none;
  z-index: 9999;
  max-width: 460px;
  padding: 16px 20px;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.01em;
  text-transform: none;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  /* The tooltip must never sit under the cursor, or moving onto it
     fires mouseout on the marker and it flickers. */
  pointer-events: none;
}

#statTooltip.visible {
  display: block;
}
