/* FutQuiz - Football Theme */
:root {
  --primary-color: #00a651;
  --primary-hover: #00803e;
  --success-color: #00d900;
  --warning-color: #ffb800;
  --error-color: #e10600;
  --bg-color: #15151e;
  --card-bg: #1f1f2e;
  --text-color: #ffffff;
  --text-muted: #9ca3af;
  --border-color: #2d2d3d;
  --border-focus: #00a651;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --match-bg: #064e3b;
  --match-color: #10b981;
  --higher-bg: #78350f;
  --higher-color: #fbbf24;
  --lower-bg: #78350f;
  --lower-color: #fbbf24;
  --different-bg: #7f1d1d;
  --different-color: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg-color);
  background-image: 
    radial-gradient(ellipse at top, #0d2818 0%, transparent 50%),
    radial-gradient(ellipse at bottom, #16213e 0%, transparent 50%);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
}

header {
  text-align: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, var(--card-bg) 0%, transparent 100%);
  width: 100%;
  border-bottom: 2px solid var(--primary-color);
}

header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary-color), #4ade80);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header p {
  margin: 0 0 0.5rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

header a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  font-size: 0.9rem;
}

header a:hover {
  color: var(--primary-color);
}

main {
  flex: 1;
  width: 100%;
  max-width: 800px;
  padding: 2rem 1rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

/* Game Info */
.game-info {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  width: 100%;
}

.data-update-info {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.data-update-info small {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.game-info p {
  margin: 0 0 1rem 0;
  color: var(--text-muted);
}

.game-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#game-status {
  color: var(--success-color);
  font-weight: 600;
}

#game-status.solved {
  color: var(--success-color);
}

#game-status.game-over {
  color: var(--error-color);
}

/* Answer Reveal */
.answer-reveal {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  border: 2px solid var(--error-color);
}

.answer-reveal-header {
  color: #fff !important;
}

.answer-reveal-feedback {
  color: #fff !important;
  background: rgba(0, 0, 0, 0.2) !important;
}

/* Guess Section */
.guess-section {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.guess-section label {
  font-weight: 600;
  color: var(--text-color);
}

.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

#player-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-color);
  color: var(--text-color);
  transition: border-color 0.2s ease;
}

#player-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

#player-input::placeholder {
  color: var(--text-muted);
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
}

.autocomplete-item {
  padding: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: rgba(0, 166, 81, 0.2);
}

.submit-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: var(--primary-color);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.submit-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.submit-btn.secondary {
  background: #52525b;
}

.submit-btn.secondary:hover {
  background: #3f3f46;
}

.button-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.button-group .submit-btn {
  flex: 1;
}

.share-section {
  margin-top: 1rem;
  text-align: center;
  width: 100%;
}

.share-section .submit-btn {
  width: 100%;
  max-width: 300px;
}

/* Guesses Container */
.guesses-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.guess-card {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.guess-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.guess-animal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  min-width: 160px;
  flex-shrink: 0;
}

.animal-emoji-inline {
  font-size: 1.5rem;
  line-height: 1;
}

.animal-name-inline {
  font-size: 1rem;
  color: var(--text-color);
}

.guess-animal-header.correct .animal-name-inline {
  color: var(--success-color);
}

.correct-badge {
  color: var(--success-color);
  font-size: 1.2rem;
}

.wrong-badge {
  color: var(--text-muted);
  font-size: 1.2rem;
  opacity: 0.7;
}

.property-feedback {
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  white-space: normal;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

/* Feedback Styles */
.feedback-match {
  background: var(--match-bg);
  color: var(--match-color);
  border: 1px solid var(--match-color);
}

.feedback-higher {
  background: var(--higher-bg);
  color: var(--higher-color);
  border: 1px solid var(--higher-color);
}

.feedback-lower {
  background: var(--lower-bg);
  color: var(--lower-color);
  border: 1px solid var(--lower-color);
}

.feedback-different {
  background: var(--different-bg);
  color: var(--different-color);
  border: 1px solid var(--different-color);
}

.feedback-partial-match {
  background: #78350f;
  color: #fbbf24;
  border: 1px solid #fbbf24;
}

/* Multi-value highlighting */
.property-feedback .value-match {
  color: var(--success-color);
  font-weight: 600;
  background: rgba(0, 217, 0, 0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin: 0 0.1rem;
}

.property-feedback .value-nomatch {
  color: var(--error-color);
  font-weight: 500;
  background: rgba(225, 6, 0, 0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin: 0 0.1rem;
  text-decoration: line-through;
  opacity: 0.7;
}

/* How to Play */
.how-to-play {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  width: 100%;
}

.how-to-play h3 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: var(--text-color);
}

.how-to-play ul {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.how-to-play li {
  margin-bottom: 0.5rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Ad Containers */
.ad-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  min-height: 50px;
}

.ad-header {
  display: none;
  margin-top: 0;
}

.ad-in-content {
  min-height: 100px;
  max-width: 336px;
  margin: 1rem auto;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  main {
    padding: 1rem;
    gap: 1rem;
  }
  
  header {
    padding: 1rem 0.75rem;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  .game-info,
  .guess-section,
  .how-to-play {
    padding: 1rem;
  }
  
  .game-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .guess-line {
    gap: 0.5rem;
    font-size: 0.85rem;
  }
  
  .guess-animal-header {
    min-width: 100%;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
  }
  
  .property-feedback {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .ad-in-content {
    max-width: 320px;
    min-height: 50px;
  }
}

/* Desktop-specific */
@media (min-width: 769px) {
  .ad-header {
    display: flex;
    min-height: 90px;
  }
}
