/* ================================================================
   IQ TEST  —  style.css
   Age-Adaptive Intelligence Assessment
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=Noto+Sans+JP:wght@400;600;700&display=swap');

/* ── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #02020c;
  color: #f0f0f0;
  font-family: 'Noto Sans JP', sans-serif;
  min-height: 100vh;
  background: radial-gradient(ellipse 90% 55% at 50% 0%, #0a062a 0%, #02020c 65%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px 60px;
}

button { outline: none; cursor: pointer; }

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.hidden { display: none !important; }

/* ── LAYOUT ──────────────────────────────────────────────── */
#header {
  width: 100%;
  max-width: 460px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#header-title {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 4px;
  color: #12122a;
  text-transform: uppercase;
}

#header-logo {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: middle;
  opacity: 0.5;
}

#header-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #60a5fa12;
  color: #60a5fa;
  border: 1px solid #60a5fa25;
  display: none;
}

#card {
  width: 100%;
  max-width: 460px;
  background: #05050f99;
  border: 1px solid #60a5fa10;
  border-radius: 22px;
  backdrop-filter: blur(20px);
  padding: 16px 14px;
  box-shadow: 0 24px 60px #00000099, inset 0 0 0 1px #60a5fa06;
}

#footer {
  margin-top: 12px;
  color: #0c0c1c;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

#footer-lock {
  width: 12px;
  height: 12px;
  opacity: 0.3;
}

/* ── SCREENS ──────────────────────────────────────────────── */
.screen { display: none; text-align: center; }
.screen.active { display: block; }

/* ── BRAIN ICON ───────────────────────────────────────────── */
.brain-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 6px;
  display: block;
}

/* ── LANGUAGE PICKER ──────────────────────────────────────── */
#lang-picker {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.lang-btn {
  padding: 5px 12px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid #2a2a40;
  color: #666;
  font-size: 12px;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.lang-btn .flag-img {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
}

.lang-btn.active {
  background: #fff;
  color: #000;
  border-color: #fff;
  font-weight: 700;
}

/* ── AGE SCREEN ───────────────────────────────────────────── */
#age-inner { max-width: 310px; margin: 0 auto; text-align: left; }

.app-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(24px, 7vw, 42px);
  font-weight: 900;
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 4px;
  letter-spacing: 3px;
  display: block;
}

.app-sub {
  color: #3a3a55;
  font-size: 11px;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.age-label {
  display: block;
  font-size: 13px;
  color: #777;
  margin-bottom: 8px;
}

.age-wrap { position: relative; margin-bottom: 8px; }

#age-input {
  width: 100%;
  padding: 13px 48px 13px 20px;
  background: #07071a;
  color: #f0f0f0;
  border: 2px solid #1a1a30;
  border-radius: 14px;
  font-size: 26px;
  font-weight: 700;
  font-family: 'Cinzel', serif;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

#age-input:focus { border-color: #60a5fa; }

.age-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #3a3a55;
  font-size: 13px;
}

#age-error { color: #ef4444; font-size: 12px; margin-bottom: 8px; display: none; }

#age-preview {
  background: #22c55e12;
  border: 1px solid #22c55e30;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: none;
  align-items: center;
  gap: 10px;
}

#age-preview-emoji { font-size: 24px; }
#age-preview-label { font-weight: 700; font-size: 13px; }
#age-preview-desc  { color: #444; font-size: 11px; }

.group-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 18px;
}

.group-card {
  background: #07071a;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 9px 6px;
  font-family: 'Noto Sans JP', sans-serif;
  transition: border-color 0.2s;
  text-align: center;
}

.group-card-emoji { font-size: 18px; }
.group-card-label { font-size: 11px; font-weight: 600; margin-top: 2px; }
.group-card-desc  { font-size: 10px; color: #2a2a40; }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 13px;
  font-size: 14px;
  font-weight: 800;
  font-family: 'Noto Sans JP', sans-serif;
  box-shadow: 0 8px 24px #3b82f630;
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 1px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px #3b82f650;
}

/* ── START SCREEN ─────────────────────────────────────────── */
.start-age-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; margin-bottom: 4px; }
.overview-title  { font-family: 'Cinzel', serif; font-size: 20px; color: #f0f0f0; margin: 0 0 16px; }

.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }

.cat-card { border-radius: 12px; padding: 12px 8px; }
.cat-icon { font-size: 18px; }
.cat-name { font-size: 11px; font-weight: 600; }
.cat-count{ font-size: 10px; color: #333; }

.overview-table {
  background: #07071a;
  border: 1px solid #1a1a30;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.overview-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #0d0d1a;
}

.overview-key { color: #555; font-size: 12px; }
.overview-val { color: #ccc; font-size: 12px; }

.btn-start {
  width: 100%;
  border: none;
  border-radius: 50px;
  padding: 13px;
  font-size: 14px;
  font-weight: 900;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 1px;
  color: #000;
  transition: opacity 0.2s;
}

.btn-start:hover { opacity: 0.85; }

/* ── QUIZ SCREEN ──────────────────────────────────────────── */
.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cat-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.progress-wrap { margin-bottom: 10px; }

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #555;
  margin-bottom: 3px;
}

.progress-bg { height: 4px; background: #0a0a1a; border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 2px; transition: width 0.4s cubic-bezier(0.4,0,0.2,1); }

.q-box {
  background: #04040e;
  border-radius: 14px;
  padding: 16px 14px;
  margin-bottom: 14px;
  min-height: 80px;
}

.q-text {
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 600;
  color: #eee;
  line-height: 1.8;
  white-space: pre-line;
}

.q-desc {
  margin-top: 10px;
  padding: 8px 12px;
  background: #0a0a1e;
  border-radius: 8px;
  font-family: monospace;
  font-size: 14px;
  letter-spacing: 2px;
}

.opts { display: grid; gap: 7px; }

.opt-btn {
  border: 1px solid #1a1a30;
  border-radius: 10px;
  padding: 10px 13px;
  color: #aaa;
  text-align: left;
  font-size: 13px;
  background: #04040e;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.opt-btn:hover:not(.revealed) {
  border-color: #60a5fa;
  color: #60a5fa;
  background: #60a5fa12;
}

.opt-label {
  width: 23px;
  height: 23px;
  border-radius: 6px;
  border: 1px solid #1a1a30;
  background: #1a1a3010;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Timer SVG */
#timer-svg { display: block; }

/* ── PAYMENT SCREEN ───────────────────────────────────────── */
.pay-icon { width: 48px; height: 48px; margin: 0 auto 6px; display: block; }
.pay-title-static {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: #f0f0f0;
  margin: 0 0 6px;
}
.pay-sub-static { color: #555; font-size: 12px; margin-bottom: 18px; }

.pay-methods { max-width: 320px; margin: 0 auto; }
.pay-method-label { font-size: 12px; color: #555; margin-bottom: 12px; }

.btn-paypal {
  width: 100%;
  background: #003087;
  border: none;
  border-radius: 14px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.btn-paypal:hover { opacity: 0.82; }
.paypal-text { font-family: Arial, sans-serif; font-weight: bold; font-size: 18px; }

.btn-stripe {
  width: 100%;
  background: linear-gradient(135deg, #635bff, #4b44cc);
  border: none;
  border-radius: 14px;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 1px;
  transition: opacity 0.2s;
}

.btn-stripe:hover { opacity: 0.82; }
.stripe-card-img { width: 20px; height: 14px; }
.pay-secure { color: #1a1a2e; font-size: 10px; margin-top: 12px; }

#paypal-container { min-height: 50px; }

#stripe-card-wrap {
  background: #04040e;
  border: 1px solid #1a1a30;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  text-align: left;
}

#stripe-card-label { font-size: 11px; color: #444; margin-bottom: 8px; }

#stripe-card-element {
  background: #07071a;
  border: 1px solid #252535;
  border-radius: 8px;
  padding: 11px;
  min-height: 36px;
}

#stripe-loading-hint { color: #2a2a40; font-size: 10px; margin-top: 5px; }

#stripe-error {
  background: #ef444412;
  border: 1px solid #ef4444;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  color: #ef4444;
  font-size: 12px;
  display: none;
}

#paypal-error { color: #ef4444; font-size: 12px; margin-top: 8px; display: none; }

.btn-pay {
  width: 100%;
  background: linear-gradient(135deg, #635bff, #4b44cc);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
  font-family: 'Noto Sans JP', sans-serif;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.btn-pay:disabled { background: #111; cursor: not-allowed; }

.btn-back {
  width: 100%;
  background: none;
  border: 1px solid #1a1a30;
  color: #444;
  border-radius: 50px;
  padding: 9px;
  font-size: 12px;
  font-family: 'Noto Sans JP', sans-serif;
}

.btn-back-small {
  background: none;
  border: 1px solid #1a1a30;
  color: #444;
  border-radius: 50px;
  padding: 7px 22px;
  font-size: 12px;
  font-family: 'Noto Sans JP', sans-serif;
  margin-top: 12px;
}

.pay-test-card { color: #151525; font-size: 10px; margin-top: 8px; }

/* ── RESULT SCREEN ────────────────────────────────────────── */
.result-sub-label { font-size: 11px; color: #333; margin-bottom: 4px; }
.result-title { font-family: 'Cinzel', serif; font-size: 22px; color: #f0f0f0; margin: 0 0 16px; }

.iq-box {
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 20px;
  padding: 24px 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #040410, #08081a);
}

.iq-glow {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  pointer-events: none;
}

#iq-number {
  font-family: 'Cinzel', serif;
  font-size: clamp(62px, 15vw, 92px);
  font-weight: 900;
  line-height: 1;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#iq-label { font-size: 15px; font-weight: 800; margin-top: 4px; }
#iq-desc  { font-size: 11px; color: #444; margin-top: 3px; }

.iq-bar-wrap { margin-top: 14px; }
.iq-bar-bg   { height: 4px; background: #0a0a1e; border-radius: 2px; overflow: hidden; }
.iq-bar      { height: 100%; border-radius: 2px; transition: width 1.2s cubic-bezier(0.4,0,0.2,1); }
.iq-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #1e1e30;
  margin-top: 3px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  margin-bottom: 16px;
}

.stat-card {
  background: #04040e;
  border-radius: 12px;
  padding: 11px 4px;
  border: 1px solid rgba(0,0,0,0.1);
}

.stat-val   { font-size: 17px; font-weight: 900; font-family: 'Cinzel', serif; }
.stat-label { font-size: 9px; color: #444; margin-top: 2px; }

.cat-results {
  background: #04040e;
  border: 1px solid #1a1a30;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  text-align: left;
}

.cat-result-title { font-size: 11px; color: #444; margin-bottom: 12px; }
.cat-row          { margin-bottom: 10px; }
.cat-row-top      { display: flex; justify-content: space-between; margin-bottom: 3px; }
.cat-row-name     { font-size: 11px; color: #bbb; }
.cat-row-pct      { font-family: 'Cinzel', serif; font-size: 11px; }
.cat-bar-bg       { height: 4px; background: #0a0a1e; border-radius: 2px; overflow: hidden; }
.cat-bar          { height: 100%; border-radius: 2px; transition: width 1s cubic-bezier(0.4,0,0.2,1); }

.btn-retry {
  background: none;
  border-radius: 50px;
  padding: 10px 30px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.2s;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 400px) {
  #card { padding: 12px 10px; }
  .group-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
  .stats-grid { gap: 5px; }
}
