/* ===== CSS Variables ===== */
:root {
  --primary: #6C63FF;
  --bg: #F8F9FF;
  --card: #fff;
  --text: #2D3748;
  --muted: #718096;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  background: linear-gradient(135deg, #F8F9FF, #EEF1FF);
  min-height: 100vh;
  color: var(--text);
}

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

/* ===== Quiz Header ===== */
.qz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.back-btn {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}

.genre-badge {
  background: white;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* ===== Progress Bar ===== */
.progress-bar {
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #FF6B9D);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.progress-txt {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ===== Question Card ===== */
.q-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.q-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

/* ===== Choices Grid ===== */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.choice-btn {
  background: white;
  border: 2px solid #E2E8F0;
  border-radius: var(--radius);
  padding: 16px 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow);
  color: var(--text);
  line-height: 1.4;
  width: 100%;
}

.choice-btn:active {
  transform: scale(0.97);
}

.choice-btn.correct {
  background: #C6F6D5;
  border-color: #38A169;
  color: #276749;
}

.choice-btn.incorrect {
  background: #FED7D7;
  border-color: #E53E3E;
  color: #9B2C2C;
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ===== Action Buttons ===== */
.action-btns {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.hint-btn,
.speak-btn {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.hint-btn {
  background: #FFF3CD;
  color: #856404;
}

.speak-btn {
  background: #CCE5FF;
  color: #004085;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: white;
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary);
}

.modal-txt {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.modal-close {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* ===== Answer Card ===== */
.ans-card {
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.ans-card.ans-correct {
  background: linear-gradient(135deg, #C6F6D5, #9AE6B4);
}

.ans-card.ans-incorrect {
  background: linear-gradient(135deg, #FED7D7, #FEB2B2);
}

.ans-badge {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}

.ans-label {
  font-size: 13px;
  color: #4A5568;
  margin-bottom: 4px;
}

.ans-text {
  font-size: 22px;
  font-weight: 800;
}

/* ===== Explanation Card ===== */
.exp-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  flex: 1;
}

.exp-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.exp-text {
  font-size: 15px;
  line-height: 1.8;
}

/* ===== Next Button ===== */
.next-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--primary), #FF6B9D);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.35);
}

/* ===== Result Screen ===== */
.result-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 85vh;
  gap: 16px;
  text-align: center;
  padding: 20px;
}

.result-brand {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 6px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-num {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
}

.score-den {
  font-size: 16px;
  color: var(--muted);
}

.result-msg {
  font-size: 24px;
  font-weight: 800;
}

.result-pct {
  font-size: 16px;
  color: var(--muted);
}

.retry-btn {
  width: 100%;
  max-width: 320px;
  padding: 18px;
  background: linear-gradient(135deg, var(--primary), #FF6B9D);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.35);
}

.home-link {
  display: block;
  max-width: 320px;
  width: 100%;
  padding: 16px;
  background: white;
  color: var(--primary);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  border: 2px solid var(--primary);
  text-align: center;
}

/* ===== Confetti Animation ===== */
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===== Top Page Styles ===== */
.site-header {
  text-align: center;
  padding: 28px 20px 20px;
}

.site-logo {
  max-width: 220px;
  margin-bottom: 8px;
}

.site-tagline {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.genre-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 24px;
  max-width: 480px;
  margin: 0 auto;
}

.genre-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  display: block;
  transition: transform 0.15s;
}

.genre-card:active {
  transform: scale(0.96);
}

.genre-icon {
  font-size: 38px;
  margin-bottom: 8px;
}

.genre-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.genre-desc {
  font-size: 11px;
  color: var(--muted);
}

.site-footer {
  text-align: center;
  padding: 20px 16px 32px;
  font-size: 12px;
  color: var(--muted);
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

/* ===== Static Page Styles (about / privacy) ===== */
.static-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.static-wrap .back-btn {
  display: inline-block;
  margin-bottom: 20px;
}

.static-wrap h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
}

.static-wrap h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #EEF1FF;
}

.static-wrap p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 12px;
}

.static-wrap ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.static-wrap ul li {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 4px;
}

.static-wrap .info-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.static-wrap .enacted-date {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  margin-top: 24px;
}
