/* --- Original live-styles.css --- */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f2f2f7; /* Changed to match tournament bg */
  overflow: hidden;
}

#content-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 60px; /* Space for bottom menu */
  background: #f2f2f7;
  overflow-y: auto; /* Enable scrolling for the tournament content */
  -webkit-overflow-scrolling: touch;
  padding: env(safe-area-inset-top) 16px 16px 16px; /* Padding moved here */
  box-sizing: border-box;
}

#welcome {
  position: relative;
  padding: 20px;
  text-align: center;
  font-size: 18px;
  color: #333;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

#welcome::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('jsabackground.jpg') no-repeat center center;
  background-size: contain;
  opacity: 0.2;
  z-index: 0;
}

#welcome > * {
  position: relative;
  z-index: 1;
}

.bottom-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-menu select {
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  width: 90%;
  max-width: 500px;
  background-color: #fff;
  color: #1c1c1e;
  /* Reset specific styles from tournament-styles that might conflict if applied globally */
  margin-top: 0; 
}

.bottom-menu select:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.25);
}

/* --- Merged tournament-styles.css --- */

h1 { 
  display: block; 
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #007aff;
}
.status {
  text-align: center;
  font-size: 0.9rem;
  color: #3a3a3c;
  margin-bottom: 0.75rem;
}
.results, form {
  max-width: 480px;
  margin: 0 auto;
}
.results { margin-bottom: 1rem; }
label {
  display: block;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #1c1c1e;
}
/* Scoped inputs to avoiding messing up the bottom selector too much, though general style is fine */
#controls select, 
#controls input[type="date"], 
#controls input[type="text"], 
#controls button {
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  padding: 12px;
  margin-top: 4px;
  border: 1px solid #d1d1d6;
  border-radius: 12px;
  background: #fff;
  color: #1c1c1e;
  transition: opacity 0.2s;
}
select:disabled, input:disabled, button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button { font-weight: 600; }

/* Increased specificity with #controls ID to override the generic white background above */
#controls #goBtn, #controls #updateBtn {
  background-color: #007aff;
  color: #fff;
  border: none;
  margin-top: 1.5rem;
}
#controls #goBtn:active:not(:disabled), #controls #updateBtn:active:not(:disabled) {
  background-color: #0051a8;
}

#controls #liveBtn {
  background-color: #34c759;
  color: #fff;
  border: none;
  margin-top: 0.5rem;
}
#controls #liveBtn.stop { background-color: #ff3b30; }
#controls #liveBtn.stop:active { opacity: 0.8; }

#controls #goSourceBtn {
  background-color: #7F00FF;
  color: #fff;
  border: none;
  margin-top: 0.5rem;
}

#controls #goDashBoardBtn {
  background-color: #F89E2C;
  color: #fff;
  border: none;
  margin-top: 0.5rem;
}
#controls #clearCacheBtn {
    background-color: #8e8e93;
    color: #fff;
    border: none;
    margin-top: 0.5rem;
}

.autocomplete { position: relative; }
.autocomplete-wrapper { position: relative; }
#clearPlayer {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #999;
  cursor: pointer;
  user-select: none;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
  pointer-events: none;
}
.autocomplete-wrapper input {
  /* This rule was being overridden by #controls input[type="text"] */
  /* We don't remove it to keep fallback, but see below for fix */
  padding-left: 44px;
}

/* Fix specificity for Live page inputs */
#controls .autocomplete-wrapper input {
  padding-left: 44px;
  padding-right: 32px; /* Prevent text overlap with Clear button */
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #d1d1d6;
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  color: #1c1c1e;
}
.autocomplete-item {
  padding: 12px;
  font-size: 1rem;
  cursor: pointer;
}
.autocomplete-item:hover {
  background: #f0f0f5;
}
.match {
  background: #fff;
  border-radius: 12px;
  margin: 0.75rem 0;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-size: 1.15rem;
  color: #1c1c1e;
}
.match strong {
  color: #000;
  font-size: 1.25rem;
}
.score {
  font-size: 1.1rem;
  color: #3a3a3c;
  margin-top: 0.25rem;
}
.loading, .no-results {
  text-align: center;
  color: #6e6e73;
  margin-top: 1.5rem;
  font-size: 1rem;
}
.live-indicator {
  color: #ff3b30;
  font-weight: bold;
  font-size: 1.05rem;
  margin-top: 0.25rem;
}
.match.live {
  border: 2px solid #ff3b30;
  background-color: #ffecec;
}