/* Janney fridge dashboard — light theme, kiosk-tuned. */

html,
body {
  height: 100%;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1100px 540px at 80% -10%, rgba(0, 0, 0, 0.025), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(0, 0, 0, 0.03), transparent 60%),
    #f4f4f5;
}

#dashboard {
  box-sizing: border-box;
}

/* No selection / tap highlight on a kiosk display. */
* {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- morphing time digits ---------- */

#time {
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
}

/* Each character — digit or colon — sits in a fixed-width, overflow-clipped slot
   so we can stack the outgoing + incoming glyphs and morph between them. */
.slot {
  position: relative;
  display: inline-block;
  vertical-align: top;
  overflow: visible;
}
.slot[data-char='0'],
.slot[data-char='1'],
.slot[data-char='2'],
.slot[data-char='3'],
.slot[data-char='4'],
.slot[data-char='5'],
.slot[data-char='6'],
.slot[data-char='7'],
.slot[data-char='8'],
.slot[data-char='9'] {
  width: 0.62em; /* tabular-ish width for proportional digits */
  text-align: center;
}
.slot[data-char=':'] {
  width: 0.32em;
  text-align: center;
}

/* The glyph itself — the .cur copy is the one currently showing. */
.glyph {
  display: inline-block;
  will-change: transform, opacity, filter;
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}
.glyph.stack {
  position: absolute;
  inset: 0;
}

/* Incoming glyph: starts blurred + below, lands sharp at center. */
.glyph.enter {
  opacity: 0;
  filter: blur(18px);
  transform: translateY(0.18em) scale(0.92);
}
.glyph.enter-active {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

/* Outgoing glyph: dissolves up and blurs out. */
.glyph.exit {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}
.glyph.exit-active {
  opacity: 0;
  filter: blur(18px);
  transform: translateY(-0.18em) scale(1.06);
}

/* ---------- weather glyph sizing ---------- */
#weather-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- game card affordance ---------- */
#game-card {
  cursor: pointer;
}
#game-card:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.2);
  outline-offset: 4px;
}

/* ---------- recent results chips ---------- */
.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
  color: #3f3f46;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.recent-chip:hover {
  background: rgba(0, 0, 0, 0.07);
}
.recent-chip:active {
  transform: scale(0.97);
}
.recent-chip .rc-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0;
}
.recent-chip .rc-result.w {
  background: #16a34a;
}
.recent-chip .rc-result.l {
  background: #dc2626;
}
.recent-chip .rc-score {
  font-variant-numeric: tabular-nums;
  color: #0f0f10;
  font-weight: 600;
}
.recent-chip .rc-dash {
  margin: 0 2px;
  color: #a1a1aa;
}
.recent-chip .rc-opp {
  color: #71717a;
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ---------- stats overlay ---------- */
#overlay {
  opacity: 0;
  transition: opacity 200ms ease-out;
}
#overlay.is-open {
  opacity: 1;
}
#overlay-card {
  transform: translateY(8px) scale(0.985);
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease-out;
  opacity: 0;
}
#overlay.is-open #overlay-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Card sizing — leave room for everything but allow scroll if dense. */
#overlay-card {
  max-height: 552px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}
#overlay-card::-webkit-scrollbar {
  width: 6px;
}
#overlay-card::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
}

/* Status pill (LIVE / FINAL / Sun, Apr 26 …) */
#overlay-content .status-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #71717a;
  font-weight: 600;
}
#overlay-content .status-line svg {
  width: 10px;
  height: 10px;
}
#overlay-content .status-line.live {
  color: #dc2626;
}
#overlay-content .status-line.live svg {
  color: #dc2626;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}

/* Matchup row: logo · name · score · name · logo */
#overlay-content .matchup {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
#overlay-content .team-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
#overlay-content .matchup > .team-cell:last-child {
  flex-direction: row-reverse;
  text-align: right;
}
#overlay-content .matchup > .team-cell:last-child .team-name-wrap {
  align-items: flex-end;
}
#overlay-content .team-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
#overlay-content .team-name-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#overlay-content .team-name {
  font-weight: 600;
  font-size: 18px;
  color: #0f0f10;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#overlay-content .team-record {
  font-size: 12px;
  color: #a1a1aa;
  margin-top: 2px;
}
#overlay-content .score-block {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#overlay-content .score-block .score {
  font-size: 32px;
  font-weight: 700;
  color: #0f0f10;
  letter-spacing: -0.02em;
}
#overlay-content .score-block .sep {
  color: #d4d4d8;
  font-size: 28px;
}
#overlay-content .score-block .vs {
  color: #a1a1aa;
  font-size: 18px;
  font-weight: 500;
}

/* Linescore */
#overlay-content .linescore {
  margin-top: 22px;
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
#overlay-content .linescore th,
#overlay-content .linescore td {
  padding: 8px 6px;
  text-align: center;
  font-size: 15px;
}
#overlay-content .linescore th {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #a1a1aa;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
#overlay-content .linescore td.abbr {
  text-align: left;
  font-weight: 600;
  color: #3f3f46;
}
#overlay-content .linescore td.total {
  font-weight: 700;
  color: #0f0f10;
}
#overlay-content .linescore tbody tr + tr td {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* Section labels w/ icon */
#overlay-content .section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #a1a1aa;
  font-weight: 600;
  margin-bottom: 10px;
}
#overlay-content .section-label svg {
  width: 12px;
  height: 12px;
}

/* Top performers — three rows of [name | line | label | line | name] */
#overlay-content .perf-block {
  margin-top: 22px;
}
#overlay-content .perf-row {
  display: grid;
  grid-template-columns: 1fr 56px 1fr;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
#overlay-content .perf-row:last-child {
  border-bottom: 0;
}
#overlay-content .perf-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#overlay-content .perf-side.right {
  align-items: flex-end;
  text-align: right;
}
#overlay-content .perf-side .who {
  font-weight: 600;
  font-size: 14px;
  color: #0f0f10;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
#overlay-content .perf-side .line {
  font-size: 12px;
  color: #71717a;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
#overlay-content .perf-cat {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #a1a1aa;
  font-weight: 700;
  text-align: center;
}

/* Team stats — 2-column grid of comparison rows */
#overlay-content .ts-block {
  margin-top: 22px;
}
#overlay-content .ts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  row-gap: 4px;
}
#overlay-content .ts-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  font-size: 14px;
}
#overlay-content .ts-row .val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0f0f10;
}
#overlay-content .ts-row .val.right {
  text-align: right;
}
#overlay-content .ts-row .lbl {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #a1a1aa;
  font-weight: 700;
  padding: 0 14px;
}

/* Venue line */
#overlay-content .venue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 12px;
  color: #71717a;
}
#overlay-content .venue svg {
  width: 12px;
  height: 12px;
}
