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

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

header h1 {
  font-size: 1.3rem;
  letter-spacing: 1px;
}

header span {
  font-size: 1.6rem;
}

.container {
  max-width: 860px;
  width: 100%;
  padding: 40px 20px;
  flex: 1;
}

/* INDEX */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 14px;
  color: #1a1a2e;
}

.hero p {
  font-size: 1.05rem;
  color: #555;
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.btn {
  display: inline-block;
  background: #e63946;
  color: #fff;
  padding: 14px 36px;
  border-radius: 8px;
  font-size: 1.1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: #c1121f;
}

.info-cards {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 48px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  width: 200px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.card .icon { font-size: 2rem; margin-bottom: 10px; }
.card h3 { font-size: 1rem; color: #1a1a2e; margin-bottom: 6px; }
.card p  { font-size: 0.85rem; color: #666; line-height: 1.4; }

/* TEST */
.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.test-header .progress {
  font-size: 0.95rem;
  color: #555;
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #ddd;
  border-radius: 4px;
  margin-bottom: 28px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #e63946;
  border-radius: 4px;
  transition: width 0.4s;
}

.matrix-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  grid-template-rows: repeat(3, 120px);
  gap: 6px;
  background: #ccc;
  border: 3px solid #1a1a2e;
  border-radius: 6px;
  padding: 6px;
}

.matrix-cell {
  background: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.matrix-cell.missing {
  background: #f0f2f5;
  border: 2px dashed #aaa;
  font-size: 2rem;
  color: #bbb;
}

.choices-label {
  text-align: center;
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 14px;
}

.choices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.choice-btn {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, transform 0.1s;
  aspect-ratio: 1;
}

.choice-btn:hover {
  border-color: #e63946;
  transform: scale(1.04);
}

.choice-btn.correct {
  border-color: #2a9d8f;
  background: #eafaf8;
}

.choice-btn.wrong {
  border-color: #e63946;
  background: #fdecea;
}

.timer {
  font-size: 1.1rem;
  font-weight: bold;
  color: #1a1a2e;
}

.timer.warn { color: #e63946; }

/* RESULTS */
.results-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin-top: 20px;
}

.results-box h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: #1a1a2e;
}

.score-big {
  font-size: 4rem;
  font-weight: bold;
  color: #e63946;
  margin: 20px 0 4px;
}

.iq-label {
  font-size: 1rem;
  color: #777;
  margin-bottom: 24px;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.stat { text-align: center; }
.stat .val { font-size: 1.8rem; font-weight: bold; color: #1a1a2e; }
.stat .lbl { font-size: 0.82rem; color: #888; margin-top: 2px; }

.percentile-bar-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 28px;
  background: #eee;
  border-radius: 8px;
  height: 18px;
  overflow: hidden;
}

.percentile-bar {
  height: 100%;
  background: linear-gradient(90deg, #e63946, #f4a261);
  border-radius: 8px;
  transition: width 1s ease;
}

.percentile-label {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 28px;
}

.btn-secondary {
  background: #1a1a2e;
  color: #fff;
  margin-left: 12px;
}

.btn-secondary:hover { background: #16213e; }
