/* Playoff Bracket Tile (Old Bracket) */
.bracket-tile {
  width: 16rem; /* increased width for all */
  min-height: 2.2rem; /* reduced height */
  padding: 0.5rem 0.5rem; /* less vertical padding */
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
}

/* Maintenance Page Styles */
body.maintenance {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #f3f4f6;
  margin: 0;
}
.msg-maintenance {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 2px 8px #0001;
  padding: 2.5rem 2rem;
  font-size: 1.3rem;
  color: #333;
  text-align: center;
}
/* Playoff Bracket Table Styles */
.bracket-table th, .bracket-table td {
  padding: 0.5rem 0.25rem;
  vertical-align: middle;
}
.bracket-tile {
  width: 14rem;
  min-height: 2.2rem;
  padding: 0.5rem 0.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 1rem;
}
/*
Participant status circles:
  .bg-green-500: participant has submitted prediction
  .bg-gray-300: participant has not submitted
  .w-3.h-3.rounded-full.border: used for the circle
*/
/* Fade animation for Tournament tab switching */
.fade-in {
  animation: fadeIn 0.2s;
  opacity: 1;
}
.fade-out {
  animation: fadeOut 0.2s;
  opacity: 0;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
/* Slide down animation for points table */
.points-table-collapsed {
  max-height: 0 !important;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.2s linear;
}
.points-table {
  max-height: 1000px;
  opacity: 1;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.2s linear;
}
/* Smooth fading animation for LIVE tag */
.live-flash {
  animation: liveFade 2s ease-in-out infinite;
}
@keyframes liveFade {
  0%, 100% {
    color: #dc2626; /* Tailwind red-600 */
    text-shadow: 0 0 8px #f87171, 0 0 2px #fff;
    opacity: 1;
  }
  50% {
    color: #991b1b; /* Tailwind red-800 */
    text-shadow: 0 0 2px #991b1b;
    opacity: 0.5;
  }
}
/* Thin scrollbar */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db #f3f4f6;
}

/* Webkit browsers (Chrome, Safari) */
.scrollbar-thin::-webkit-scrollbar {
  height: 6px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.brand-title {
  -webkit-text-stroke: 0;
  text-shadow:
    1px 1px 0 rgba(0, 0, 0, 0.95),
    2px 2px 0 rgba(0, 0, 0, 0.85),
    3px 3px 0 rgba(0, 0, 0, 0.7),
    0 4px 10px rgba(0, 0, 0, 0.75);
}

.main-nav-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  height: 12px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.28), #f3f4f600);
}

.subtab-btn {
  flex: 1;
  padding: 0.45rem 1rem;
  font-weight: 600;
  color: #000000;
  background: transparent;
  min-height: 1.95rem;
}

.subtab-bar .subtab-btn:only-child {
  max-width: 18rem;
}

.subtab-btn-active {
  background: #2563eb;
  color: #ffffff;
}

.page-tabs .subtab-btn {
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding: 0.5rem 1.25rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: #374151;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25rem;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.page-tabs .subtab-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.page-tabs .subtab-btn.subtab-btn-active {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

.bracket-phase-arrow {
  position: fixed;
  top: 50vh;
  transform: translateY(-50%);
  z-index: 40;
  width: 2.5rem;
  height: 11rem;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image:
    linear-gradient(transparent, transparent),
    linear-gradient(180deg, #1e3a8a 0%, #60a5fa 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  user-select: none;
}

.bracket-phase-arrow-left {
  left: 0.5rem;
}

.bracket-phase-arrow-right {
  right: 0.5rem;
}

.match-card-split {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.match-card-split::before,
.match-card-split::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  display: none;
  background-repeat: no-repeat;
  background-size: cover, cover;
  filter: saturate(0.9);
}

.match-card-split::before {
  background-image:
    linear-gradient(120deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.02)),
    var(--home-team-bg-image, none);
  background-position: center, 22% 50%;
  clip-path: polygon(0 0, 57% 0, 48% 100%, 0 100%);
  opacity: 0.09;
}

.match-card-split::after {
  background-image:
    linear-gradient(240deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.02)),
    var(--away-team-bg-image, none);
  background-position: center, 78% 50%;
  clip-path: polygon(52% 0, 100% 0, 100% 100%, 43% 100%);
  opacity: 0.09;
}

.match-card-split-slash {
  position: absolute;
  display: none;
  top: -18%;
  bottom: -18%;
  left: 50%;
  width: 4px;
  transform: rotate(18deg);
  background: #1e40af;
  box-shadow:
    -3px 0 10px rgba(30, 64, 175, 0.28),
    3px 0 10px rgba(30, 64, 175, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.7);
  pointer-events: none;
  z-index: 3;
}

.match-card-split > * {
  position: relative;
  z-index: 2;
}

.match-card-split > .match-card-split-slash {
  z-index: 3;
}

.match-card-team-flag {
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 0.25rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
  object-fit: contain;
}

.prediction-tile-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 220ms ease;
}

.prediction-tile.is-open .prediction-tile-details {
  max-height: 18rem;
}

.prediction-tile.is-open .prediction-tile-arrow {
  transform: rotate(180deg);
}

.prediction-tile.is-open .prediction-tile-summary {
  display: none;
}

.prediction-tile.is-open .prediction-tile-name {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.team-easteregg {
  display: block;
  max-width: 9rem;
  color: #047857;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

.dashed-underline {
  border-bottom: 1px dashed currentColor;
}

.scorer-menu-panel {
  top: 100%;
  max-height: 180px;
  display: none;
}

.header-tournament-change-btn {
  background: linear-gradient(45deg, #166534, #22c55e);
}

.header-tournament-dropdown-btn {
  background: linear-gradient(45deg, #166534, #22c55e);
  max-width: min(34rem, 92vw);
}

.header-tournament-dropdown-label {
  min-width: 0;
}

.header-tournament-list {
  width: min(24rem, 92vw);
  border-radius: 8px;
}

.header-tournament-option {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.65rem 0.9rem;
  text-align: left;
  transition: background-color 120ms ease, color 120ms ease;
  width: 100%;
}

.header-tournament-option-muted {
  color: #4b5563;
}

.header-tournament-option-muted:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.header-tournament-option-current {
  background: linear-gradient(45deg, #dcfce7, #bbf7d0);
  color: #14532d;
  font-weight: 700;
}

.header-tournament-option-current:hover {
  background: linear-gradient(45deg, #bbf7d0, #86efac);
}

.main-nav-wrapper {
  margin-top: 0;
  padding-top: 0;
}

.match-date-nav-wrap {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.match-live-heading-hidden {
  display: none;
}

.initially-hidden {
  display: none;
}

.standings-expand-btn {
  min-height: 20px;
  height: 32px;
}

.points-total-pill {
  min-width: 120px;
}

.maintenance-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #f3f4f6;
  margin: 0;
}

.maintenance-message {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 2px 8px #0001;
  padding: 2.5rem 2rem;
  font-size: 1.3rem;
  color: #333;
  text-align: center;
}

.maintenance-subtitle {
  font-size: 1.1em;
  color: #888;
}

.add-password-container {
  max-width: 400px;
  margin: 2em auto;
}

.add-password-title {
  margin-bottom: 2rem;
  font-size: 1.5em;
  font-weight: bold;
}

.add-password-field {
  margin-bottom: 1.5rem;
}

.add-password-field-spacious {
  margin-bottom: 2rem;
}

.add-password-label {
  font-weight: bold;
}

.add-password-submit {
  width: 60%;
  min-width: 120px;
  max-width: 200px;
  padding: 0.4em 0;
  font-size: 1em;
  font-weight: 600;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: background 0.2s;
  display: block;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .match-card-split::before,
  .match-card-split::after {
    opacity: 0.09;
    background-size: cover, cover;
  }

  .match-card-split-slash {
    transform: rotate(16deg);
    opacity: 1;
  }
}
