/* Black/white, no gradients, no shadows, no hover UI. Mobile-first, no-scroll layout. */

:root {
  --bg: #EFEBCE; /* Beige - main background */
  --fg: #000000; /* Black - main text */
  --muted: #000000; /* Black - muted text */
  --border: #A3A380; /* Sage - borders */
  --accent: #A3A380; /* Sage - accents */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Oswald', sans-serif;
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.app-header, .app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-switcher {
  position: relative;
}

.category-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #D6CE93; /* Vanilla - team box background */
  border: 1px solid var(--fg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.category-toggle:hover {
  background: #C4BC7A;
}

.category-toggle:focus {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.category-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #D6CE93;
  border: 1px solid var(--fg);
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 140px;
  margin-top: 4px;
}

.category-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background 0.2s ease;
}

.category-option:hover:not(.disabled) {
  background: #C4BC7A;
}

.category-option.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.category-option.selected {
  background: var(--fg);
  color: var(--bg);
}

.coming-soon {
  font-size: 10px;
  opacity: 0.7;
  margin-left: auto;
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.category-toggle.open .dropdown-arrow {
  transform: rotate(180deg);
}

.app-footer {
  border-top: 1px solid var(--border);
  border-bottom: none;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.legal-links {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.legal-link {
  cursor: pointer;
  text-decoration: underline;
  color: var(--muted);
}

.legal-link:hover {
  color: var(--fg);
}

.legal-separator {
  color: var(--muted);
}

.brand { 
  font-weight: 700; 
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stats { display: flex; gap: 6px; }

.chip {
  border: 1px solid var(--border);
  padding: 4px 6px;
  font-size: 12px;
}

.strikes-display { 
  display: flex; 
  gap: 4px; 
  justify-content: center;
  align-items: center;
  margin-bottom: 1px;
}

.strikes-label {
  color: var(--muted);
  font-size: 16px;
  margin-right: 4px;
}
.strike {
  width: 20px; 
  height: 20px; 
  border: 2px solid var(--fg);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.strike.filled { 
  background: var(--fg);
  color: #FF0000; /* Red X */
}

.strike.filled::after {
  content: '✕';
}

.strike.empty { 
  background: transparent; 
}

.game-over-text {
  text-align: center;
  color: #F44336; /* Red */
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.app-main {
  display: grid;
  place-items: center;
  padding: 8px 12px;
}

.card {
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--border);
  padding: 12px;
}

.subtitle {
  text-align: center;
  font-size: 20px;
  color: var(--muted);
  margin-bottom: 8px;
}

.matchup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-container:first-child {
  margin-bottom: 8px;
}

.team-container:last-child {
  margin-top: 8px;
}

.team-btn {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: #D6CE93; /* Vanilla - team box background */
  color: var(--fg);
  border: 1px solid var(--fg);
  cursor: pointer;
  min-height: 80px;
}

.team-btn:focus,
.next-btn:focus,
.linklike:focus {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.team-logo {
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  background: #EFEBCE; /* Beige - logo background */
}

.team-name { 
  font-size: 30px;
  letter-spacing: 0.5px;
}

.score-box {
  width: 60px;
  height: 40px;
  background: #000;
  border: 2px solid #333;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  font-size: 24px;
  font-weight: bold;
  color: #00ff00;
  text-shadow: 0 0 8px currentColor;
  box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.3);
  position: relative;
}

.score-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    rgba(0, 255, 0, 0.1) 1px,
    transparent 2px
  );
  pointer-events: none;
}

.score-box.winner {
  color: #00ff00;
  text-shadow: 0 0 8px #00ff00;
  box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.3);
}

.score-box.loser {
  color: #ff0000;
  text-shadow: 0 0 8px #ff0000;
  box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.3);
}

.score-box.winner::before {
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    rgba(0, 255, 0, 0.1) 1px,
    transparent 2px
  );
}

.score-box.loser::before {
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    rgba(255, 0, 0, 0.1) 1px,
    transparent 2px
  );
}

.vs { 
  text-align: center; 
  color: var(--muted);
  font-size: 22px;
  padding: 4px 0;
}

.result-row {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 64px; /* Large, prominent symbol */
  text-align: center;
  min-height: 80px; /* Reserve space for large symbol to prevent layout shift */
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  line-height: 1;
}

.result-row[hidden] {
  display: flex !important; /* Override hidden attribute's display: none */
  visibility: hidden; /* Hide but maintain space */
}

.result-row.correct { 
  color: #4CAF50; /* Green */
}

.result-row.wrong { 
  color: #F44336; /* Red */
}

.actions {
  display: grid;
  place-items: center;
  margin-top: 10px;
  min-height: 50px; /* Reserve space for Next button to prevent layout shift */
}

.next-btn {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--fg);
  padding: 10px 16px;
  cursor: pointer;
}

.next-btn[hidden] {
  display: block !important; /* Override hidden attribute's display: none */
  visibility: hidden; /* Hide but maintain space */
}

.footnote {
  text-align: left;
  color: var(--muted);
  font-size: 15px;
  margin: 1px 0;
  font-style: italic;
}

.ad-banner {
  height: 80px; /* fixed height to avoid layout shift */
  width: 100%;
  max-width: 460px;
  border-top: 1px solid var(--border);
  display: grid;
  place-items: center;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 12px;
}

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: grid;
  place-items: center;
}

.modal[hidden] {
  display: none;
}

.modal-content {
  background: #D6CE93; /* Vanilla - modal background */
  border: 1px solid var(--border);
  width: calc(100vw - 32px);
  max-width: 420px;
  padding: 16px;
  text-align: center;
}

.category-section {
  margin: 20px 0;
}

.category-section h4 {
  text-align: center;
  margin-bottom: 15px;
  color: var(--fg);
  font-size: 18px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 15px;
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 10px;
  background: #EFEBCE; /* Beige - logo background */
  border: 2px solid var(--fg);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 80px;
}

.category-btn:hover:not(.disabled) {
  background: #D6CE93;
  transform: translateY(-2px);
}

.category-btn.selected {
  background: var(--fg);
  color: var(--bg);
}

.category-btn.disabled {
  background: #f0f0f0;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.category-icon {
  font-size: 24px;
  margin-bottom: 5px;
}

.category-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.category-desc {
  font-size: 12px;
  opacity: 0.8;
}

.linklike {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 6px 8px;
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
}

/* Keep everything within the viewport without scrolling on typical phones */
@media (max-height: 720px) {
  .ad-banner { height: 60px; }
}

/* ============================================================================
   GAME OVER MODAL
   ============================================================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg);
  border-radius: 12px;
  padding: 0;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  transition: opacity 0.2s ease;
  z-index: 10;
}

.modal-close:hover {
  opacity: 0.6;
}

.modal-close:focus {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
  border-radius: 4px;
}

.modal-header {
  padding: 24px 24px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
}

.modal-body {
  padding: 24px;
}

.final-score {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.score-label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.score-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.score-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

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

.detail-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.detail-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}

.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.share-btn {
  background: var(--surface);
  color: var(--fg);
  border: 2px solid #1DA1F2;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: #1DA1F2;
  color: white;
  transform: translateY(-1px);
}

.share-btn:active {
  transform: translateY(0);
}

.share-btn-sms {
  border-color: #25D366;
}

.share-btn-sms:hover {
  background: #25D366;
  color: white;
}

.share-icon {
  font-size: 16px;
}

.twitter-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.play-again-btn {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.play-again-btn:hover {
  background: var(--hover);
  transform: translateY(-1px);
}

.play-again-btn:active {
  transform: translateY(0);
}

/* Mobile responsiveness for game over modal */
@media (max-width: 480px) {
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-header h2 {
    font-size: 20px;
  }
  
  .score-value {
    font-size: 40px;
  }
  
  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }
  
  .share-btn,
  .play-again-btn {
    width: 100%;
    justify-content: center;
  }
}
