:root {
  --wiki-bg: #ffffff;
  --wiki-text: #202122;
  --wiki-link: #0645ad;
  --wiki-border: #a2a9b1;
  --wiki-header-bg: #eaecf0;
  --wiki-row-hover: #f8f9fa;
  --wiki-font: sans-serif;
}

body {
  margin: 0;
  font-family: var(--wiki-font);
  background-color: #f6f6f6;
  color: var(--wiki-text);
  line-height: 1.6;
  padding: 1rem;
  /* Reduced padding for mobile */
}

#app {
  width: 100%;
  max-width: 900px;
  background: var(--wiki-bg);
  padding: 1rem;
  /* Reduced padding for mobile */
  border: 1px solid var(--wiki-border);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  margin: 0 auto;
  /* Center on larger screens */
  box-sizing: border-box;
}

.game-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--wiki-border);
  padding-bottom: 0.5rem;
}

.brand-container {
  display: flex;
  align-items: center;
}

.logo-placeholder {
  width: 32px;
  height: 32px;
  background-color: #ccc;
  border-radius: 50%;
  margin-right: 12px;
}

h1 {
  font-family: 'Linux Libertine', 'Georgia', serif;
  font-weight: normal;
  margin: 0;
  font-size: 1.8rem;
}

.autocomplete-container {
  position: relative;
  flex-grow: 1;
}

.autocomplete-items {
  position: absolute;
  border: 1px solid var(--wiki-border);
  border-top: none;
  z-index: 99;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background-color: #fff;
  margin: 0;
  padding: 0;
  list-style: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  display: none;
}

.autocomplete-items li {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.autocomplete-items li:hover {
  background-color: var(--wiki-row-hover);
}

/* Wikipedia Career Table Style */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  /* Enable horizontal scrolling on small screens */
}

.career-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 90%;
  /* min-width: 400px; */
  /* Ensure table doesn't squish too much */
}

.career-table th {
  background-color: var(--wiki-header-bg);
  border: 1px solid var(--wiki-border);
  padding: 0.4rem;
  text-align: left;
}

.career-table td {
  border: 1px solid var(--wiki-border);
  padding: 0.4rem;
}

.career-table tr:hover {
  background-color: var(--wiki-row-hover);
}

.guess-section {
  clear: both;
  background: #f8f9fa;
  padding: 1rem;
  border: 1px solid var(--wiki-border);
  border-radius: 2px;
}

.guess-form {
  display: flex;
  flex-direction: column;
  /* Stack vertically on mobile */
  gap: 0.5rem;
  margin-top: 1rem;
}



input {
  padding: 0.6rem;
  /* Slightly larger touch target */
  border: 1px solid var(--wiki-border);
  width: 100%;
  box-sizing: border-box;
}

button {
  background-color: #eaecf0;
  border: 1px solid var(--wiki-border);
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: bold;
}

button:hover {
  background-color: #fff;
}

.message {
  margin-top: 1rem;
  padding: 0.8rem;
  border-left: 5px solid #ccc;
}

.message.win {
  border-color: #10b981;
  background: #e6fffa;
}

.message.error {
  border-color: #ef4444;
  background: #fff5f5;
}

.attempts-text {
  font-size: 0.9rem;
  color: #54595d;
}

.play-again-btn {
  margin-top: 0.5rem;
  color: var(--wiki-link);
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  font-weight: normal;
  display: block;
}

/* Header & Action Buttons */
.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.icon-btn:hover {
  background-color: var(--wiki-header-bg);
}

/* Running Tally / Stats Bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.75rem;
  background-color: #f8f9fa;
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--wiki-text);
}

.stat-label {
  font-size: 0.75rem;
  color: #54595d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Overlay & Modals */
.overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: var(--wiki-bg);
  border: 1px solid var(--wiki-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  padding: 1.5rem;
  position: relative;
  box-sizing: border-box;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #54595d;
}

.close-btn:hover {
  color: var(--wiki-text);
}

/* Instruction Steps inside Help Modal */
.instruction-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 1rem;
}

.instruction-step p {
  margin: 0;
  font-size: 0.95rem;
}

.step-badge {
  background-color: #3664ad;
  color: white;
  font-weight: bold;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.primary-btn {
  display: block;
  width: 100%;
  background-color: #3664ad;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 1.5rem;
  text-align: center;
  transition: background-color 0.2s;
}

.primary-btn:hover {
  background-color: #2a4f8a;
}

/* Statistics Grid in Modal */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 1.5rem 0;
  text-align: center;
}

.stat-box {
  background-color: #f8f9fa;
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  padding: 10px;
}

.stat-num {
  font-size: 1.8rem;
  font-weight: bold;
  color: #3664ad;
}

.stat-desc {
  font-size: 0.75rem;
  color: #54595d;
  text-transform: uppercase;
}

/* Button layout inside input area */
.button-group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.button-group button {
  flex: 1;
}

.skip-btn {
  background-color: #f8f9fa;
  border: 1px solid var(--wiki-border);
  color: #54595d;
  font-weight: bold;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
}

.skip-btn:hover {
  background-color: #eaecf0;
  color: var(--wiki-text);
}

/* Cell/Row Illuminate Animation on Reveal */
@keyframes illuminateHighlight {
  0% {
    background-color: rgba(250, 204, 21, 0.6); /* Soft bright gold/yellow color */
    box-shadow: inset 0 0 12px rgba(250, 204, 21, 0.8);
  }
  30% {
    background-color: rgba(250, 204, 21, 0.4);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

.highlight-reveal td {
  animation: illuminateHighlight 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Secondary Button (Outline Style) */
.secondary-btn {
  display: block;
  width: 100%;
  background-color: transparent;
  color: #3664ad;
  border: 2px solid #3664ad;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 0.75rem;
  text-align: center;
  box-sizing: border-box;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background-color: rgba(54, 100, 173, 0.08);
}

/* Game Over Modal Styling */
.solved-player-name {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  color: #202122;
  margin: 1rem 0;
  letter-spacing: -0.5px;
}

.game-over-modal h2 {
  text-align: center;
  margin-top: 0;
}

.game-over-modal p {
  text-align: center;
}

.game-over-actions {
  margin-top: 1.5rem;
}