/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* LinkRival corners: 4px buttons/inputs, full pills. Kendall's lr-* components set their own. */
a[class*="bg-"]:not([class*="lr-"]),
button:not([class*="lr-"]),
input[type="submit"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
textarea,
select,
.btn {
  border-radius: var(--lr-radius-4, 4px) !important;
}

.rounded-full {
  border-radius: 9999px !important;
}

/* Hide scrollbar for mobile carousel */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Sticky offset for document-scrolled headers: clears the iOS status bar in
   standalone (home-screen) mode; env() is 0 in regular browsers. Only for
   elements whose scrollport is the document — keep top-0 inside overflow
   containers. */
.top-safe { top: env(safe-area-inset-top); }

.live-total-context {
  min-height: 2.375rem;
  padding: .5rem .75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--color-surface-container-low);
  color: var(--color-on-surface-variant);
  font-size: .625rem;
}

.live-total-context strong {
  flex: none;
  color: var(--color-primary-dark);
  font-size: .5625rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-total-context-divider { width: 1px; height: 1rem; background: var(--color-outline-variant); }
.live-total-context-copy { line-height: 1.35; }
.live-total-footnote { min-height: 1.75rem; margin: .6875rem .25rem 0; color: var(--color-secondary-muted); font-size: .5625rem; }
.live-total-desktop-overflow { width: 100%; max-width: 100%; overflow-x: auto; }
.live-total-desktop-table { border-collapse: collapse; }
.live-total-desktop-table th:first-child { width: 3.625rem; }
.live-total-desktop-table th:nth-child(2) { min-width: 12.5rem; }
.live-total-desktop-table th:not(:nth-child(2)) { min-width: 4rem; }
.live-total-desktop-table tbody tr { height: 3.625rem; }

.live-total-sort-button {
  width: 100%;
  min-height: 2.75rem;
  padding: 0 .25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  touch-action: manipulation;
}

.live-total-sort-button:focus-visible { outline: 2px solid var(--color-gold); outline-offset: -3px; }
.live-total-current-round { background: color-mix(in srgb, var(--color-tertiary-fixed) 16%, transparent); }
.live-total-desktop-table thead .live-total-current-round,
.live-total-mobile-head .live-total-current-round { background: color-mix(in srgb, var(--color-primary-container) 88%, var(--color-tertiary-fixed)); }

.live-total-mobile-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 3rem minmax(12.5rem, 1fr) repeat(var(--live-total-score-columns), 4rem) 3.625rem;
  align-items: stretch;
}

.live-total-mobile-head {
  min-height: 2.875rem;
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 10;
  background: var(--color-primary-dark);
  color: #fff;
  font-size: .5625rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.live-total-mobile-head > div { min-width: 0; display: grid; place-items: center; overflow: hidden; }
.live-total-mobile-head .live-total-player-heading { justify-items: start; padding-left: .5rem; }
.live-total-mobile-row { min-height: 3.6875rem; }
.live-total-mobile-cell { min-width: 0; padding: .5rem .2rem; display: grid; place-items: center; font-size: .75rem; }
.live-total-mobile-player { min-width: 0; padding: .5rem .35rem; position: relative; display: flex; align-items: center; gap: .35rem; overflow: hidden; }
.live-total-player { padding-bottom: .65rem; }
.live-total-player-sub { position: absolute; bottom: .38rem; left: 2.85rem; color: var(--color-secondary-muted); font-size: .5rem; white-space: nowrap; }

@media (max-width: 768px) {
  .live-total-context { align-items: flex-start; flex-wrap: wrap; gap: .3rem .625rem; line-height: 1.35; }
  .live-total-context-divider { display: none; }
  .live-total-context-copy { width: 100%; }
  .live-total-mobile-grid { grid-template-columns: 1.75rem minmax(5.8125rem, 1fr) repeat(var(--live-total-score-columns), minmax(0, 1fr)) 2.5625rem; }
  .live-total-mobile-head { font-size: .5rem; letter-spacing: .035em; }
  .live-total-sort-button { gap: .1rem; padding: 0; font-size: .5rem; letter-spacing: .035em; }
  .live-total-sort-button .sort-indicator { font-size: .5rem; }
  .live-total-mobile-cell { padding-left: .1rem; padding-right: .1rem; font-size: .6875rem; }
  .live-total-mobile-player { padding-left: .4rem; }
  .live-total-player { padding-bottom: 0; }
  .live-total-player > :first-child, .live-total-player-sub { display: none; }
  .live-total-player a, .live-total-player span { font-size: .6875rem; line-height: 1.15; }
}

@media (max-width: 359px) {
  .live-total-mobile-grid { grid-template-columns: 1.625rem minmax(5.125rem, 1fr) repeat(var(--live-total-score-columns), minmax(0, 1fr)) 2.375rem; }
  .live-total-mobile-head, .live-total-sort-button { font-size: .375rem; letter-spacing: 0; }
  .live-total-sort-button .sort-indicator { font-size: .375rem; }
  .live-total-mobile-cell, .live-total-player a, .live-total-player span { font-size: .625rem; }
  .live-total-context, .live-total-footnote { margin-left: .5rem; margin-right: .5rem; }
}

.pairing-page [data-controller~="score-entry"] button {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pairing-page [data-controller~="score-entry"] button:not(:disabled):active {
  background-color: var(--color-primary-dark) !important;
  color: white !important;
  transform: scale(0.96);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-tertiary-fixed) 48%, transparent);
}

@media print {
  .public-navigation, body > footer { display: none !important; }
}
