* { box-sizing: border-box; }

@media (hover: none), (pointer: coarse), (any-pointer: coarse) {
  .tooltip {
    display: none !important;
  }
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

html {
  overflow: hidden;
}

#map { position: absolute; top: 1.5em; bottom: 0; width: 100%; }

.mapboxgl-marker {
  cursor: pointer;
}

.mapboxgl-popup-anchor-top > .mapboxgl-popup-tip {
  border-bottom-color: #3fb1ce;
}

.mapboxgl-popup-anchor-bottom > .mapboxgl-popup-tip {
  border-top-color: #3fb1ce;
}

.mapboxgl-popup-content {
  border: 1px solid #3fb1ce;
  border-radius: 10px;
  color: #205070;
  /*width: 35em;*/
  padding: 5px;
}

.popup-content {
  overflow: auto;
  max-height: 20em;
  padding: 0;
  margin-top: 1em;
}

.popup-content span {
  font-weight: bold;
}

.popup-content ol {
  padding-left: 2em;
}

.marker {
  cursor: pointer;
}

a, a:visited {
  color: #3fb1ce;
  text-decoration: none;
}

a:hover {
  color: #c9c6e4;
}

.map-popup-tournament-details-btn {
  all: unset;
  display: inline;
  color: #3fb1ce;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  vertical-align: top;
}

.map-popup-tournament-details-btn:hover {
  color: #c9c6e4;
}

.map-popup-tournament-details-btn:focus-visible {
  outline: 1px dotted #3fb1ce;
  outline-offset: 2px;
}

.form-label {
  font-size: 0.75em;
  font-weight:bold;
  margin-bottom: 0;
}

.header {
  color:white;
  background-color: black;
  font-size: 0.75em;
  font-weight: bold;
  padding-left: 5px;
  padding-right: 5px;
  position: absolute;
  min-height: 1.5em;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 10020;
}

@media (max-width: 600px) {
  :root {
    --mobile-banner-height: 1.125rem;
  }

  .header {
    height: var(--mobile-banner-height);
    min-height: var(--mobile-banner-height);
  }

  .filter-container {
    top: var(--mobile-banner-height);
  }
}

.tennisradar-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-meta {
  color: #cfcfcf;
  font-weight: normal;
}

.fitp {
  white-space: nowrap;
}

.fitp a {
  color: yellow;
}

@media (max-width: 600px) and (orientation: portrait) {
  :root {
    --mobile-banner-height: 2.475rem;
  }

  #map {
    top: var(--mobile-banner-height);
  }

  .header {
    height: var(--mobile-banner-height);
    min-height: var(--mobile-banner-height);
    align-items: flex-start;
    padding-top: 3px;
    padding-bottom: 3px;
    gap: 4px;
  }

  .tennisradar-banner {
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    white-space: normal;
    overflow: visible;
    line-height: 1.25;
  }

  .banner-meta {
    display: block;
    font-size: 0.9em;
    line-height: 1.25;
  }

  .fitp {
    display: block;
    flex: 0 0 auto;
    font-size: 0.85em;
    line-height: 1.2;
    max-width: 8em;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
  }
}

.filter-container {
  margin: 0px 20px 0px 0px;
  z-index: 1;
  position: absolute;
  top: 1.5em;
}

@media (max-width: 600px) and (orientation: portrait) {
  .filter-container {
    top: var(--mobile-banner-height);
  }
}

.filter-icon {
  font-size: 0px;
  padding: 3px;
}

.filter-icon span {
  font-size: 30px;
  color: #555;
  cursor: pointer;
  margin-bottom: 5px;
  user-select: none
}

.filter-icon span:hover {
  color: #fff;
}

.filter-form {
  position: absolute;
  top: 0;
  left: 40px;
  background-color: white;
  padding: 5px;
  border: 1px solid #3fb1ce;
  color: #3fb1ce;
  border-radius: 5px;
  font-size: 10pt;
  display: none;
  width: 11em;
}

.form-group select {
  font-size: 0.8em;
}

.submit {
  margin-top: 10px;
  font-size: 0.9em;
  width: 100%;
}

.competizione-1 {
  color: green;
}

.competizione-2 {
  color: red;
}

.competizione-3 {
  color: blue;
}

.spinner {
  --spinner-size: 80px;
  --spinner-ring-size: 64px;
  --spinner-ring-margin: 8px;
  --spinner-border-width: 6px;
  --spinner-color: #fff;
  position: absolute;
  left: 50%;
  z-index: 1;
  top: 50%;
  visibility: hidden;
}

#message-area {
  position: absolute;
  bottom: 5px;
  right: 5px;
  z-index: 1000;
  overflow: clip;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 20020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 12px;
  color: #163744;
  background: #fff;
  border: 1px solid #c8dbe2;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  font-size: 0.9rem;
  line-height: 1.35;
}

.cookie-banner-text {
  min-width: 0;
}

.cookie-banner .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .cookie-banner {
    align-items: stretch;
    flex-direction: column;
  }
}

/* overrides */

.alert {
  padding: 4px 6px;
  margin-bottom: 4px;
  border-width: 1px;
  border-radius: 5px;
  font-size: 0.9em;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: 90vw;
}

.alert .btn-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 1.4em;
  line-height: 1;
  transition: all 0.2s;
  flex-shrink: 0;
  border-radius: 3px;
}

.alert .btn-close:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.1);
}

.submit.btn {
  padding: 0 0 0 5px;
}


.notification-form {
  position: absolute;
  left: 40px;
  top: 0;
  background-color: white;
  padding: 8px;
  border: 1px solid #3fb1ce;
  color: #3fb1ce;
  border-radius: 5px;
  font-size: 10pt;
  display: none;
  width: min(36em, calc(100vw - 56px));
  max-height: calc(100vh - 2.25em);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
}

@media (max-width: 600px) {
  .filter-form,
  .notification-form {
    position: fixed !important;
    top: var(--mobile-banner-height);
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: calc(100vh - var(--mobile-banner-height));
    height: calc(100dvh - var(--mobile-banner-height));
    max-height: calc(100vh - var(--mobile-banner-height));
    max-height: calc(100dvh - var(--mobile-banner-height));
    padding: 8px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  #notification-form[style*="display: block"] {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
  }

  #notification-form[style*="display: block"] .notification-tab-panel[style*="display: block"] {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  #notification-tabs {
    flex-shrink: 0;
  }

  #tab-notifiche #my-notifications {
    flex: 0 0 auto;
    max-height: min(28vh, 180px);
    min-height: 48px;
  }

  #tab-notifiche #my-watched-tournaments,
  #tab-canali #my-channels {
    flex: 1 1 auto;
    max-height: none;
    min-height: 140px;
  }

  #tab-notifiche .notification-watched-section {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 180px;
    margin-bottom: 0;
  }

  #tab-notifiche > hr,
  #tab-notifiche #ntfy-onboarding {
    flex: 0 0 auto;
  }
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: transparent;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

.auth-pending #map {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.auth-pending #auth-close {
  visibility: hidden;
}

.auth-checking .auth-dialog {
  display: none;
}

.auth-checking #auth-modal {
  display: none !important;
}

.auth-modal:not(.auth-login-scene) {
  pointer-events: none;
}

.auth-modal:not(.auth-login-scene) .auth-dialog {
  pointer-events: auto;
}

.auth-modal.auth-login-scene {
  --login-court-center-y: 58%;
  --login-court-width: min(94vw, 1240px, 138.67vh);
  --login-court-height: min(43.38vw, 560px, 64vh);
  --login-court-half-height: min(21.69vw, 280px, 32vh);
  --login-brand-court-half-height: var(--login-court-half-height);
  --login-brand-gap: clamp(8px, 2vh, 24px);
  --login-court-transform: translate(-50%, -50%);
  --login-net-transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 238, 215, 0.12), transparent 22%),
    radial-gradient(circle at 78% 88%, rgba(246, 202, 162, 0.10), transparent 26%),
    linear-gradient(135deg, #552014, #963f24 48%, #642719);
}

.auth-modal::before,
.auth-modal::after {
  content: none;
}

.auth-background-brand {
  display: none;
}

.auth-modal.auth-login-scene .auth-background-brand {
  display: block;
  position: absolute;
  left: 50%;
  top: calc(var(--login-court-center-y) - var(--login-brand-court-half-height) - var(--login-brand-gap));
  z-index: 1;
  transform: translate(-50%, -100%);
  color: rgba(255, 248, 238, 0.32);
  font-size: max(2.2rem, min(9.5rem, 11.28vw, 148.8px, 16.64vh));
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  text-shadow: 0 8px 24px rgba(35, 12, 7, 0.34), 0 0 1px rgba(255, 255, 255, 0.34);
  white-space: nowrap;
  pointer-events: none;
}

.auth-modal.auth-login-scene::before {
  content: "";
  position: absolute;
  left: 50%;
  top: var(--login-court-center-y);
  width: var(--login-court-width);
  height: var(--login-court-height);
  transform: var(--login-court-transform);
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 78 36' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23b85c31'/%3E%3Cstop offset='.52' stop-color='%239f4728'/%3E%3Cstop offset='1' stop-color='%237d3420'/%3E%3C/linearGradient%3E%3Cfilter id='s'%3E%3CfeDropShadow dx='0' dy='1' stdDeviation='.7' flood-color='%23000000' flood-opacity='.25'/%3E%3C/filter%3E%3C/defs%3E%3Crect x='0' y='0' width='78' height='36' rx='1.2' fill='url(%23g)'/%3E%3Cg stroke='%23fff8ee' stroke-width='.48' fill='none' filter='url(%23s)' vector-effect='non-scaling-stroke'%3E%3Crect x='1.2' y='1.2' width='75.6' height='33.6'/%3E%3Cpath d='M1.2 5.7h75.6M1.2 30.3h75.6'/%3E%3Cpath d='M18.2 5.7v24.6M59.8 5.7v24.6'/%3E%3Cpath d='M18.2 18h41.6'/%3E%3Cpath d='M39 1.2v33.6' stroke-width='.78'/%3E%3C/g%3E%3Cpath d='M39 1.2v33.6' stroke='%23281711' stroke-width='.24' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 999px rgba(36, 14, 9, 0.32), 0 26px 70px rgba(0, 0, 0, 0.30);
  opacity: 0.98;
  pointer-events: none;
}

.auth-modal.auth-login-scene::after {
  content: "";
  position: absolute;
  left: 50%;
  top: var(--login-court-center-y);
  width: min(3vw, 26px);
  height: var(--login-court-height);
  transform: var(--login-net-transform);
  z-index: 1;
  background:
    linear-gradient(90deg, transparent calc(50% - 3px), rgba(20, 27, 34, 0.88) calc(50% - 3px), rgba(20, 27, 34, 0.88) calc(50% + 3px), transparent calc(50% + 3px)),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(246, 249, 252, 0.72) calc(50% - 1px), rgba(246, 249, 252, 0.72) calc(50% + 1px), transparent calc(50% + 1px));
  opacity: 0.78;
  pointer-events: none;
}

.auth-dialog {
  position: relative;
  z-index: 3;
  background-color: rgba(255, 255, 255, 0.96);
  padding: 16px;
  border: 1px solid rgba(63, 177, 206, 0.78);
  color: #205070;
  border-radius: 6px;
  font-size: 10pt;
  width: min(22em, calc(100vw - 32px));
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.44) inset;
}

.auth-title {
  color: #0f718e;
  font-weight: 700;
  font-size: 1.05rem;
}

.auth-error {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.55rem;
}

@media (orientation: portrait) {
  .auth-modal.auth-login-scene {
    --login-court-center-y: 56%;
    --login-court-width: min(60vh, 900px, 156vw);
    --login-court-height: min(27.69vh, 415px, 72vw);
    --login-court-half-height: min(13.85vh, 207px, 36vw);
    --login-brand-court-half-height: min(30vh, 450px, 78vw);
    --login-court-transform: translate(-50%, -50%) rotate(90deg);
    --login-net-transform: translate(-50%, -50%) rotate(90deg);
  }
}

.auth-spinner-overlay {
  position: absolute;
  inset: 0;
  background-color: transparent;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  pointer-events: none;
}

#auth-spinner-overlay .auth-login-spinner {
  --spinner-size: 20px;
  --spinner-ring-size: 16px;
  --spinner-ring-margin: 2px;
  --spinner-border-width: 2px;
  --spinner-color: #0f718e;
}

#auth-icon.auth-logged-in {
  color: #2a9d4e;
}

.compact-form-group {
  margin-bottom: 0.1rem;
}

.compact-check-row {
  margin-bottom: 0;
}

.compact-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.75rem;
}

.compact-competition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.75rem;
}

.notification-help {
  font-size: 16px;
  line-height: 1;
  cursor: help;
  color: #0f718e;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

.channel-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(15, 30, 40, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.channel-qr-content {
  width: min(22em, calc(100vw - 24px));
  background: #fff;
  border: 1px solid #3fb1ce;
  border-radius: 8px;
  padding: 10px;
  color: #205070;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

.channel-qr-image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.channel-qr-image {
  width: 220px;
  max-width: 100%;
  min-height: 220px;
  border: 1px solid #dbeaf0;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.channel-qr-image img,
.channel-qr-image canvas {
  max-width: 100%;
  height: auto;
}

.channel-qr-link-wrap {
  word-break: break-all;
}

.channel-qr-link {
  font-size: 0.82em;
}

.notification-help-enabled {
  top: -1px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.2rem !important;
  border: none !important;
  background: transparent;
  box-shadow: none;
}

.icon-btn .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
}

.icon-loading {
  position: relative;
  pointer-events: none;
}

.material-symbols-outlined.icon-loading {
  color: transparent !important;
}

.icon-loading .material-symbols-outlined {
  visibility: hidden;
}

.icon-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #0f718e;
  border-color: #0f718e transparent #0f718e transparent;
  border-radius: 50%;
  animation: lds-dual-ring 1.2s linear infinite;
}

.icon-btn .material-symbols-outlined.watched {
  color: #e1b400;
  font-variation-settings: 'FILL' 1;
}

.icon-btn.btn {
  border: none !important;
  background: transparent;
  box-shadow: none;
}

.icon-btn.btn:focus,
.icon-btn.btn:hover {
  border: none !important;
  box-shadow: none;
  background-color: rgba(15, 113, 142, 0.1);
}

.compact-province-groups {
  max-height: 150px;
  overflow-y: auto;
  font-size: 0.82em;
  padding: 0.35rem !important;
}

#my-notifications {
  font-size: 1em;
}

#my-watched-tournaments {
  font-size: 1em;
  min-height: 32px;
}

#my-channels {
  font-size: 1em;
  min-height: 32px;
}

/* Compact tabs */
#notification-tabs .nav-link,
#tournaments-list-tabs .nav-link {
  font-size: 0.82em;
  color: #555;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 3px 8px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

#notification-tabs .nav-link.active,
#tournaments-list-tabs .nav-link.active {
  color: #0f718e;
  border-bottom-color: #0f718e;
  font-weight: 600;
}

/* Channel list item */
.channel-list-item {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 5px 7px;
  margin-bottom: 5px;
  font-size: 0.95em;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.channel-list-item .channel-main {
  flex: 1;
  min-width: 0;
}

.channel-list-item .channel-topic {
  font-weight: bold;
  font-size: 1.03em;
  line-height: 1.2;
  margin-bottom: 1px;
  word-break: break-all;
}

.channel-list-item .channel-name {
  color: #555;
  font-size: 0.9em;
}

.channel-list-item .channel-description {
  color: #616161;
  font-size: 0.94em;
  line-height: 1.2;
  margin-bottom: 2px;
}

.channel-list-item .channel-actions {
  display: flex;
  gap: 0;
  margin-top: 0;
  flex-wrap: nowrap;
  margin-left: auto;
}

.channel-action-link,
.channel-action-edit,
.channel-action-delete {
  color: #0f718e;
}

.channel-action-delete {
  color: #c0392b;
}

.channel-action-link:hover,
.channel-action-edit:hover,
.channel-action-delete:hover {
  opacity: 0.9;
}

/* Watched tournament list item */
.watched-tournament-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.88em;
}

.watched-tournament-item-clickable {
  cursor: pointer;
  border-radius: 4px;
  padding: 6px 4px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.watched-tournament-item-clickable:hover,
.watched-tournament-item-clickable:focus-visible {
  background-color: #f6fbfd;
  border-bottom-color: #d8ebf1;
  outline: none;
}

.watched-tournament-item:last-child {
  border-bottom: none;
}

.watched-tournament-item .watched-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 6px;
}

.watched-tournament-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Generic watched items (sub-tournaments, participants) */
.watched-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.88em;
}

.watched-item:last-child {
  border-bottom: none;
}

.watched-item .watched-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 6px;
}

.compact-province-groups .form-check-inline {
  display: inline-flex;
  align-items: center;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
  margin-left: 0;
  padding: 0.1rem 0.32rem;
  border: 1px solid #d9edf3;
  border-radius: 999px;
  background: #f8fcfd;
}

/* Tournament details sub-tournament blocks */
.sub-tournament-block {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

#tournament-details-body,
#tournament-details-content {
  font-size: 1rem;
}

.tournament-details-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  color: #667985;
  font-size: 0.95rem;
}

.tournament-details-spinner {
  --spinner-size: 20px;
  --spinner-ring-size: 16px;
  --spinner-ring-margin: 2px;
  --spinner-border-width: 2px;
  --spinner-color: #0f718e;
  flex: 0 0 20px;
}

#tournament-summary,
#order-of-play-section,
#sub-tournaments-section,
#participants-section {
  font-size: 1rem;
}

.order-of-play-status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin-bottom: 6px;
  color: #666;
  font-size: 0.9em;
}

.order-of-play-spinner {
  --spinner-size: 20px;
  --spinner-ring-size: 16px;
  --spinner-ring-margin: 2px;
  --spinner-border-width: 2px;
  --spinner-color: #0f718e;
  flex: 0 0 20px;
}

#order-of-play-list {
  display: block !important;
}

.order-of-play-calendar-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.order-of-play-calendar {
  width: 212px;
  padding: 8px;
  border: 1px solid #dce7ec;
  border-radius: 6px;
  background: #fff;
}

.order-of-play-calendar-title {
  margin-bottom: 7px;
  color: #163744;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: capitalize;
}

.order-of-play-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.order-of-play-calendar-weekday {
  color: #667985;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.order-of-play-calendar-day {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 24px;
  padding: 0;
  color: #53666f;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  background: #f7fafb;
  border: 1px solid transparent;
  border-radius: 4px;
}

.order-of-play-calendar-day-empty {
  background: transparent;
}

.order-of-play-calendar-day.has-order-of-play {
  color: #fff;
  font-weight: 700;
  background: #0f718e;
  border-color: #0b5f78;
  cursor: pointer;
}

.order-of-play-calendar-day.has-order-of-play:hover {
  background: #0b5f78;
}

.order-of-play-calendar-day.is-today {
  color: #d31220;
  border-color: #d31220;
  background: #fff7f8;
  font-weight: 700;
}

.order-of-play-calendar-day.has-order-of-play.is-today {
  color: #fff;
  background: #d31220;
  border-color: #a90f19;
}

.sub-tournament-header {
  background: #f5f9fb;
  gap: 4px;
  min-height: 40px;
}

.sub-tournament-header:hover {
  background: #eaf5fa;
}

.sub-tournament-header-clickable {
  cursor: pointer;
  user-select: none;
}

.sub-tournament-title {
  flex: 1;
  font-size: 0.98rem;
  line-height: 1.35;
  color: #163744;
}

.sub-tournament-meta {
  color: #667985;
  font-size: 0.92rem;
}

.toggle-pax-btn {
  border: none;
  background: none;
  padding: 0 2px;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.sub-tournament-header-clickable:hover .toggle-pax-icon {
  color: #0f718e !important;
}

.pax-list {
  background: #fff;
  padding: 10px 12px;
}

.sub-details-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.toggle-ranking-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #dce7ec;
  border-radius: 999px;
  background: #f4f9fb;
  color: #36515e;
  font-size: 0.82rem;
  line-height: 1.2;
  padding: 2px 8px;
  cursor: pointer;
}

.toggle-ranking-btn:hover {
  background: #eaf4f8;
  border-color: #c5d9e2;
}

.sub-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #dce7ec;
  background: #f4f9fb;
  color: #36515e;
  font-size: 0.82rem;
  line-height: 1.2;
}

.ranking-table-wrap {
  margin: 2px 0 9px;
  border: 1px solid #dce7ec;
  border-radius: 6px;
  overflow: hidden;
}

.player-stats-wrap {
  margin: 0;
}

.player-stats-block {
  margin-bottom: 12px;
  border: 1px solid #dce7ec;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.player-stats-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 30px;
  padding: 4px 7px;
  background: #f4f9fb;
  color: #22343d;
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
}

.player-stats-toggle:hover {
  background: #eaf4f8;
}

.player-stats-toggle-icon {
  flex: 0 0 auto;
  color: #7c8a92;
  font-size: 16px;
  line-height: 1;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: #36515e;
}

.ranking-table th,
.ranking-table td {
  padding: 3px 8px;
  border-bottom: 1px solid #edf3f6;
  text-align: left;
}

.ranking-table th {
  font-weight: 600;
  background: #f4f9fb;
}

.ranking-table tbody tr:last-child td {
  border-bottom: none;
}

.ranking-total-row td {
  font-weight: 600;
  background: #f4f9fb;
}

.draw-sections {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.draw-section-card {
  border: 1px solid #dce7ec;
  border-radius: 4px;
  background: #fbfdfe;
  overflow: hidden;
}

.draw-section-card-scoreboard {
  overflow: hidden;
}

.draw-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 7px;
  background: #f4f9fb;
  cursor: pointer;
  user-select: none;
}

.draw-section-header:hover {
  background: #eaf4f8;
}

.draw-section-title {
  flex: 1;
  min-width: 0;
  color: #22343d;
  font-weight: 400;
  font-size: 0.84rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draw-section-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  flex: 0 0 auto;
}

.draw-section-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid #cfe0e7;
  color: #48616c;
  background: #fff;
  font-size: 0.7rem;
  line-height: 1.25;
  white-space: nowrap;
}

.draw-section-toggle-icon {
  flex: 0 0 auto;
  color: #7c8a92;
  font-size: 16px;
  line-height: 1;
}

.draw-section-body {
  background: #fff;
}

.draw-section-chip-ok {
  color: #1f6f43;
  border-color: #b9ddc7;
  background: #f4fbf6;
}

.draw-section-chip-muted {
  color: #697b84;
  border-color: #d9e3e7;
  background: #f8fbfc;
}

.draw-section-empty {
  padding: 7px 9px;
  color: #7c8a92;
  font-size: 0.84rem;
}

.draw-scoreboard-wrap {
  position: relative;
  padding: 2px 4px 5px;
  background: #fff;
  border-top: 1px solid #edf3f6;
  overflow-x: auto;
  overflow-y: visible;
}

.scoreboard-json-title {
  margin: 0;
  color: #47d7f1;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.scoreboard-fitp-section {
  min-width: 400px;
}

.scoreboard-fitp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 6px;
}

.scoreboard-fitp-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 0 4px;
}

.scoreboard-fitp-board {
  position: relative;
  min-width: 100%;
  color: #111;
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  font-size: 0.88rem;
  transform: scale(var(--scoreboard-scale, 1));
  transform-origin: 0 0;
}

.scoreboard-fitp-scale {
  position: relative;
  overflow: visible;
}

.scoreboard-fitp-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.scoreboard-fitp-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #0f718e;
  background: #fff;
  border: 1px solid #c8dbe2;
  border-radius: 3px;
  cursor: pointer;
}

.scoreboard-fitp-zoom-btn:hover {
  background: #eef8fb;
}

.scoreboard-fitp-zoom-btn .material-symbols-outlined {
  font-size: 21px;
  line-height: 1;
}

.scoreboard-fitp-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scoreboard-fitp-line {
  position: absolute;
  display: block;
  background: #000;
  pointer-events: none;
}

.scoreboard-fitp-line-h {
  height: 1px;
  transform: translateY(-0.5px);
}

.scoreboard-fitp-line-v {
  width: 1px;
  transform: translateX(-0.5px);
}

.scoreboard-fitp-label {
  position: absolute;
  max-width: 167px;
  overflow: hidden;
  white-space: nowrap;
  color: #000;
  line-height: 1.05;
  text-overflow: ellipsis;
}

.scoreboard-fitp-seed {
  color: #d31220;
}

.scoreboard-fitp-name {
  font-weight: 500;
}

.scoreboard-fitp-score {
  position: absolute;
  color: #000;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-align: center;
  transform: translateX(-50%);
  white-space: nowrap;
}

.draw-match-list {
  display: grid;
  gap: 1px;
  background: #edf3f6;
}

.draw-match-row {
  padding: 6px 9px;
  background: #fff;
}

.draw-match-title {
  color: #22343d;
  font-size: 0.86rem;
  line-height: 1.25;
}

.draw-match-meta {
  margin-top: 2px;
  color: #7c8a92;
  font-size: 0.78rem;
  line-height: 1.25;
}

.pax-list-label {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #5e7681;
  margin-bottom: 8px;
}

.pax-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 12px;
}

.pax-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #e7edf0;
  border-radius: 6px;
  background: #fbfdfe;
}

.pax-card-highlighted {
  border-color: #f0b84a;
  background: #fff9ea;
  box-shadow: inset 0 0 0 1px rgba(240, 184, 74, 0.25);
}

.pax-info-btn {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0 !important;
  color: #8ea5af;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.pax-info-btn:hover,
.pax-info-btn:active {
  opacity: 1;
  color: #0f718e;
}

.pax-name {
  flex: 1;
  min-width: 0;
  font-size: 0.96rem;
  line-height: 1.3;
  color: #22343d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pax-ranking {
  color: #7c8a92;
  font-size: 0.9rem;
  margin-left: 0.35rem;
}

.pax-subdate {
  color: #95a3aa;
  font-size: 0.8rem;
}

.participant-watch-inline {
  flex: 0 0 auto;
  padding: 0 !important;
}

.compact-province-groups .form-check-input {
  position: static;
  margin: 0 0.22rem 0 0;
  transform: scale(0.92);
}

.compact-province-groups .form-check-label {
  cursor: pointer;
  user-select: none;
  line-height: 1.1;
}

.notification-list-item {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 5px 7px;
  margin-bottom: 5px;
  font-size: 0.95em;
}

.notification-list-item .notification-topic {
  font-weight: bold;
  margin-bottom: 2px;
  font-size: 1.03em;
}

.notification-history-content {
  width: min(820px, calc(100vw - 72px));
  max-width: 820px;
  height: min(78vh, 760px);
}

.notification-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-history-header h5 {
  margin-bottom: 0;
}

.notification-history-action-btn {
  font-size: 0.94em;
  line-height: 1.5;
  padding-top: 0;
  padding-bottom: 0;
}

.notification-history-action-btn .material-symbols-outlined {
  font-size: 17px;
  line-height: 1;
}

.notification-history-item {
  align-items: flex-start;
}

.notification-history-item .delete-notification-history {
  flex: 0 0 auto;
  margin-left: auto;
}

.notification-history-item-body {
  min-width: 0;
  width: 100%;
}

.notification-history-message {
  background: #f7f6f2;
  border-left: 3px solid #b7b0a2;
  border-radius: 4px;
  color: #343a40;
  line-height: 1.35;
  margin-top: 8px;
  padding: 7px 9px;
  white-space: pre-line;
  max-height: 10em;
  overflow: auto;
}

.notification-list-item .notification-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.notification-list-item .notification-actions .btn {
  white-space: nowrap;
  font-size: 0.94em;
  line-height: 1.5;
  padding-top: 0;
  padding-bottom: 0;
  min-width: 92px;
  text-align: center;
}

.notification-list-item .notification-actions .submit {
  width: auto;
  margin-top: 0;
}

.notification-list-item .notification-actions .submit.btn {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

#custom-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none !important;
  z-index: 20010;
  justify-content: center;
  align-items: center;
}

#custom-confirm-modal.show {
  display: flex !important;
}

.custom-confirm-content {
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  text-align: center;
}

.custom-confirm-content p {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 0.9em;
}

.custom-confirm-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.custom-confirm-buttons .submit {
  width: auto;
  margin-top: 0;
}

.custom-confirm-buttons .submit.btn {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}

/* Pax info modal */
.pax-info-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 20005;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.pax-info-box {
  background: #fff;
  border-radius: 10px;
  max-width: 360px;
  width: 100%;
  padding: 20px 20px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  position: relative;
}

.pax-info-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 28px;
  margin-bottom: 12px;
}

.pax-info-name {
  font-size: 1rem;
  font-weight: 600;
  color: #0f718e;
  min-width: 0;
}

.pax-info-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  font-size: 0.88rem;
  color: #22343d;
  margin: 0;
}

.pax-info-dl dt {
  font-weight: normal;
  color: #5e7681;
  white-space: nowrap;
}

.pax-info-dl dd {
  margin: 0;
  color: #22343d;
}

.pax-info-storico-section {
  margin-top: 12px;
  display: none;
}

.pax-info-storico-label {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #5e7681;
  margin-bottom: 6px;
}

.pax-info-placeholder {
  font-size: 0.88rem;
  color: #5e7681;
  margin-top: 12px;
}

.tournament-map-center-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  color: rgba(0, 0, 0, 0.6);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  opacity: 0.78;
  transition: opacity 0.2s, color 0.2s;
}

.tournament-map-center-btn:hover {
  opacity: 1;
}

/* Tournaments List/Details Modal */
.tournaments-list-modal {
  position: fixed;
  top: 1.125rem;
  left: 0;
  width: 100%;
  height: calc(100% - 1.125rem);
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 12px 12px 12px 50px;
}

.tournaments-list-modal.show {
  display: flex !important;
}

#tournament-details-modal {
  z-index: 10000;
}

#pdf-viewer-modal {
  z-index: 10001;
  padding: 12px;
}

.pdf-viewer-content {
  width: min(900px, 90vw);
  max-width: 90vw;
  height: min(85vh, 1100px);
  display: flex;
  flex-direction: column;
}

@media (max-width: 600px) {
  #pdf-viewer-modal {
    top: var(--mobile-banner-height);
    height: calc(100% - var(--mobile-banner-height));
  }

  .pdf-viewer-content {
    width: 100vw;
    max-width: 100vw;
    height: calc(100vh - var(--mobile-banner-height));
    height: calc(100dvh - var(--mobile-banner-height));
    max-height: calc(100vh - var(--mobile-banner-height));
    max-height: calc(100dvh - var(--mobile-banner-height));
    border-radius: 0;
  }
  #pdf-viewer-modal {
    padding: 0;
  }
}

.tournaments-list-content {
  background-color: rgba(255, 255, 255, 0.93);
  border: 1px solid #3fb1ce;
  border-radius: 5px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-size: 10pt;
  color: #3fb1ce;
  backdrop-filter: blur(4px);
}

@media (max-width: 600px) {
  #tournaments-list-modal,
  #tournament-details-modal,
  #notification-history-modal {
    top: var(--mobile-banner-height);
    height: calc(100% - var(--mobile-banner-height));
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  #tournaments-list-modal .tournaments-list-content,
  #tournament-details-modal .tournaments-list-content,
  #notification-history-modal .notification-history-content {
    width: 100vw;
    max-width: 100vw;
    height: calc(100vh - var(--mobile-banner-height));
    height: calc(100dvh - var(--mobile-banner-height));
    max-height: calc(100vh - var(--mobile-banner-height));
    max-height: calc(100dvh - var(--mobile-banner-height));
    border: 0;
    border-radius: 0;
  }

  .notification-history-header {
    align-items: flex-start;
  }
}

.tournaments-list-header {
  padding: 8px;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.tournaments-list-header h5 {
  font-size: 10pt;
  font-weight: 600;
  color: #0f718e;
  margin: 0 0 6px 0;
}

.tournaments-list-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 2px 8px;
  font-size: 0.82em;
}

.tournaments-list-view-toggle .material-symbols-outlined {
  font-size: 17px;
  line-height: 1;
}

.tournaments-list-container {
  flex: 1;
  overflow: auto;
  padding: 6px 8px;
}

.tournament-gantt-list {
  min-width: 620px;
  --gantt-day-width: 12.5%;
}

.tournament-gantt-axis,
.tournament-gantt-row {
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) minmax(220px, 1.35fr) 116px;
  column-gap: 16px;
  row-gap: 8px;
  align-items: center;
}

.tournament-gantt-axis {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 3px 8px 7px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.96);
  color: #667985;
  font-size: 0.78em;
  border-bottom: 1px solid #d9edf3;
}

.tournament-gantt-axis-label {
  font-weight: 600;
  color: #0f718e;
}

.tournament-gantt-axis-track {
  position: relative;
  height: 18px;
  border-bottom: 1px solid #d9edf3;
  background-image: linear-gradient(to right, rgba(15, 113, 142, 0.14) 1px, transparent 1px);
  background-size: var(--gantt-day-width) 100%;
}

.tournament-gantt-axis-actions {
  width: 116px;
}

.tournament-gantt-tick {
  position: absolute;
  bottom: -2px;
  transform: none;
  white-space: nowrap;
}

.tournament-list-item {
  padding: 5px 8px;
  margin-bottom: 4px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #f9f9f9;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tournament-list-item.tournament-gantt-row {
  display: grid;
  column-gap: 16px;
  row-gap: 8px;
}

.tournament-list-item:hover {
  background-color: #f0f5f7;
  border-color: #3fb1ce;
}

.tournament-list-item-clickable {
  cursor: pointer;
}

.tournament-main {
  flex: 1;
  min-width: 0;
}

.tournament-gantt-info {
  min-width: 0;
}

.tournament-name {
  font-weight: 600;
  color: #0f718e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tournament-meta {
  font-size: 0.85em;
  color: #888;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1px;
}

.tournament-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
  width: 116px;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
  background: #f9f9f9;
}

.tournament-list-item:hover .tournament-actions {
  background: #f0f5f7;
}

.tournament-gantt-track {
  position: relative;
  height: 22px;
  min-width: 0;
  border-radius: 4px;
  background:
    linear-gradient(to right, rgba(15, 113, 142, 0.08) 1px, transparent 1px),
    #f6fbfd;
  background-size: var(--gantt-day-width) 100%;
  box-shadow: inset 0 0 0 1px #d9edf3;
  overflow: hidden;
}

.tournament-gantt-bar {
  position: absolute;
  top: 4px;
  bottom: 4px;
  min-width: 7px;
  border-radius: 3px;
  background: linear-gradient(90deg, #0f718e, #3fb1ce);
  box-shadow: 0 1px 2px rgba(15, 113, 142, 0.25);
}

@media (max-width: 700px) {
  .tournament-gantt-list {
    min-width: 0;
  }

  .tournament-gantt-axis {
    display: none;
  }

  .tournament-gantt-row {
    grid-template-columns: 1fr auto;
  }

  .tournament-actions {
    width: auto;
    background: transparent;
  }

  .tournament-gantt-track {
    grid-column: 1 / -1;
    order: 3;
  }
}

.tournament-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tournament-summary-open-link,
.tournament-map-center-btn,
.tournament-favorite-btn {
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.6);
  text-decoration: none;
}

.tournament-summary-open-link .material-symbols-outlined,
.tournament-favorite-btn .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
}

.tournament-open-icon,
.tournament-map-center-btn,
.tournament-watch-icon {
  font-size: 20px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.6);
}

.tournament-favorite-btn .material-symbols-outlined.watched,
.tournament-watch-icon.watched {
  color: #d92332;
  font-variation-settings: 'FILL' 1;
}

.notification-form .form-control[readonly] {
  background-color: #e9ecef;
  border-color: #ced4da;
  color: #6c757d;
  cursor: not-allowed;
}

#add-notification-btn:disabled,
#add-notification-btn.btn-outline-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: #999 !important;
  border-color: #d3d3d3 !important;
  background-color: #f3f3f3 !important;
  box-shadow: none;
}

#add-channel-btn:disabled,
#add-channel-btn.btn-outline-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: #999 !important;
  border-color: #d3d3d3 !important;
  background-color: #f3f3f3 !important;
  box-shadow: none;
}

.form-check-label[for="pref-fit"],
.form-check-label[for="pref-tpra"],
.compact-type-grid .form-check-label {
  font-size: 0.9em;
}