* { box-sizing: border-box; }

body {
  font-family: system-ui, sans-serif;
  background: #f4f6f8;
  margin: 0;
  color: #111827;
}

header {
  background: #1f2933;
  color: #fff;
  padding: 10px 20px;
  text-align: center;
}

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

.subtitle {
  margin-top: 8px;
  font-size: 1rem;
  color: #d1d5db;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
}

.center { text-align: center; padding: 20px; }

/* ABG GRID - aina kolme korttia */
.abg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 0px;
}

.abg-card {
  text-align: center;
  position: relative;
  padding: 10px 10px 6px; /* alareunaa lisätty tooltipille */
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
}

.abg-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap; /* rivitä tarvittaessa */
  gap: 4px;
}

.abg-title {
  flex: 0 0 auto;
  min-width: 60px;
  text-align: center;
}

.abg-ref {
  flex: 0 0 auto;
  min-width: 60px;
  text-align: center;
  opacity: 0.5;
}

.abg-value {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
  word-wrap: break-word;
  margin-bottom: 6px; /* varaa tilaa tooltipille */
}

/* OPTION NAPPIPAINIKKEET */
.option {
  padding: 8px 12px;
  margin: 4px 0;
  border: 2px solid #2563eb;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  text-align: center;
  font-size: 0.9rem;
  transition: none; /* POISTETTU fade/transition */
}

.option:hover { background:#f3f4f6; }
.option.selected { background:#2563eb; color:#fff; font-weight:600; }

#primary-question, #comp-question, #comp-mechanism {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

button {
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  transition: none; /* fade poistettu */
}

button:hover { background: #1d4ed8; }
button:active { transform: translateY(1px); }
button.secondary { background: #4b5563; }
button.secondary:hover { background: #374151; }

.correct { color: #15803d; font-weight: 700; margin-bottom: 8px; }
.wrong { color: #b91c1c; font-weight: 700; margin-bottom: 8px; }
#feedback p { margin: 6px 0 0; font-size: 0.95rem; }

footer {
  text-align: center;
  padding: 24px 16px 32px;
  font-size: 0.8rem;
  color: #6b7280;
}
.disclaimer { margin-bottom: 8px; }

/* INFO-PAINIKE ABG-KORTEISSA */
.info-container {
  position: absolute;
  bottom: 10px;
  right: 10px;
}

.info-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #9ca3af;
  color: #4b5563;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer; /* click mobiilille */
}

/* TOOLTIP */
.tooltip {
  position: absolute;
  top: 28px;
  left: 28px;
  background: #ffffff;
  color: #111827;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.35;
  width: 220px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  border: 1px solid #e5e7eb;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: none; /* fade poistettu */
  z-index: 10;
}

/* Hover desktopilla */
.info-container:hover .tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIIVISET OTSIKOT JA KORTIT */
@media (max-width: 900px) {
  header h1 { font-size: 1.6rem; }
  .subtitle { font-size: 0.9rem; }
  .abg-value { font-size: 1.8rem; }
  .abg-title, .abg-ref { font-size: 0.85rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.1rem; }
}

@media (max-width: 600px) {
  header h1 { font-size: 1.4rem; }
  .subtitle { font-size: 0.85rem; }
  .abg-value { font-size: 1.5rem; }
  .abg-card { padding-bottom: 30px; }
  .abg-card-header { gap: 2px; }
  .abg-title, .abg-ref {
      flex: 1 1 auto;
      text-align: center;
      font-size: 0.75rem;
  }
  .abg-ref {
      opacity: 0.8;
  }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1rem; }
}
