* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #f4f4f6;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.header h1 {
  font-size: 1.25rem;
  margin: 0;
}

.score {
  font-weight: 600;
  font-size: 1rem;
  background: #1a1a1a;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
}

.title-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}

.title-card-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin-bottom: 6px;
}

.title-card-name {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex: 1;
}

.cell {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  min-height: 96px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.cell:active {
  transform: scale(0.96);
}

.cell.filled {
  cursor: default;
}

.cell.filled:active {
  transform: none;
}

.cell-label {
  font-size: 0.85rem;
}

.cell-answer {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.15;
}

.cell.correct {
  background: #e3f6e8;
  border-color: #4caf50;
  color: #226b2e;
}

.cell.incorrect {
  background: #fdeaea;
  border-color: #e57373;
  color: #8f2b2b;
}

.cell.scored {
  background: #e8f0fe;
  border-color: #6b9bf7;
  color: #1e4b9c;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  max-width: 360px;
  width: 100%;
}

.overlay-content h2 {
  margin: 0 0 8px;
}

.final-score {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 8px 0 20px;
}

#play-again {
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

#play-again:active {
  opacity: 0.8;
}
