*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

header {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

h1 { font-size: 1.8rem; letter-spacing: 0.05em; }

#controls { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

select, button {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

select { background: #2d2d50; color: #eee; }
button { background: #4a4aaa; color: #fff; }
button:hover { background: #6060cc; }

#question-box {
  background: #2d2d50;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  max-width: 600px;
  width: 100%;
}

#board {
  display: grid;
  grid-template-columns: repeat(6, 80px);
  grid-template-rows: repeat(6, 80px);
  gap: 8px;
}

.tile {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s, box-shadow 0.2s;
  padding: 4px;
  line-height: 1.2;
  word-break: break-word;
  overflow: hidden;
}

.tile:hover:not(.blocked):not(.correct-true):not(.correct-false):not(.wrong) {
  transform: scale(1.05);
}

.tile.hidden    { background: #3a3a6a; color: transparent; }
.tile.revealed  { background: #555588; color: #fff; }
.tile.correct-true  { background: #2ecc71; color: #fff; }
.tile.correct-false { background: #e67e22; color: #fff; }
.tile.wrong     { background: #3498db; color: #fff; }
.tile.blocked   { background: #c0392b; color: transparent; cursor: default; }

#score-box {
  margin-top: 1rem;
  font-size: 1.4rem;
  font-weight: bold;
}

.hidden { display: none !important; }

/* Popup */
#popup, #settings-dialog, #about-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#popup-content, #settings-content {
  background: #2d2d50;
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 320px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

#settings-content { align-items: flex-start; text-align: left; }
#settings-content label { display: flex; gap: 0.5rem; align-items: center; }

#about-content {
  background: #2d2d50;
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 420px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: left;
}

#about-content h2 { text-align: center; margin-bottom: 0.5rem; }
#about-content h3 { margin-top: 0.25rem; color: #aab; }

#about-text ul {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#about-text li { font-size: 0.9rem; line-height: 1.4; }
#about-text p { font-size: 0.9rem; line-height: 1.5; }