@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root{
  /* Gemini Advanced Inspired Colors */
  --bg-deep: #0e1117;
  --bg-sub: #161b22;
  
  --card-bg: rgba(22, 27, 34, 0.6);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-border-hover: rgba(255, 255, 255, 0.2);

  --text-main: #ffffff;
  --text-muted: #8b949e;
  
  /* Gemini Gradients */
  --accent-primary: #4e9af1;
  --accent-secondary: #8f53d8;
  --gradient-gemini: linear-gradient(135deg, #4e9af1 0%, #8f53d8 100%);
  --gradient-glow: radial-gradient(circle at 50% -20%, rgba(78, 154, 241, 0.15), transparent 70%);

  --radius: 12px;
  --font-base: 'Inter', 'Noto Sans JP', sans-serif;
}

*, *::before, *::after{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: var(--font-base);
  background-color: var(--bg-deep);
  /* 背景にうっすらとしたオーロラのような光を入れる */
  background-image: 
    radial-gradient(circle at 0% 0%, rgba(78, 154, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(143, 83, 216, 0.08) 0%, transparent 50%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  /* スクロールバーのデザイン */
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) var(--bg-deep);
}

/* --- レイアウト修正（重要） --- */
/* 無理な中央揃えをやめ、自然な配置にする */
.topbar{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 17, 23, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand__title{
  font-size: 18px;
  font-weight: 800;
  background: var(--gradient-gemini);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.05em;
}
.brand__sub{ font-size: 11px; color: var(--text-muted); }

/* メインコンテナ：幅を持たせて中央に配置 */
.container{
  width: 100%;
  max-width: 840px; /* カードの幅を確保 */
  margin: 40px auto 80px; /* 上下に余白 */
  padding: 0 20px;
}

/* --- カードデザイン --- */
.card{
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  /* グラスモーフィズム */
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* 上部にうっすら光を当てる演出 */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

/* --- タイポグラフィ --- */
.h1{ font-size: 28px; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.02em; }
.h2{ font-size: 20px; font-weight: 700; margin-bottom: 12px; color: var(--text-main); }
.muted{ color: var(--text-muted); font-size: 14px; }
.mono{ font-family: monospace; color: var(--accent-primary); font-size: 13px; }

/* --- ステータス表示（Grid） --- */
.grid2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.mini{
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.mini__label{ font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.mini__value{ font-size: 24px; font-weight: 800; color: var(--text-main); }

/* --- ボタン --- */
.row.gap{ display: flex; gap: 12px; flex-wrap: wrap; }

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  border-radius: 99px; /* 丸みのあるボタン */
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

/* プライマリボタン：グラデーション */
.btn-primary{
  background: var(--gradient-gemini);
  color: white;
  box-shadow: 0 4px 12px rgba(78, 154, 241, 0.3);
}
.btn-primary:hover{
  box-shadow: 0 6px 16px rgba(143, 83, 216, 0.4);
  transform: translateY(-1px);
}

/* ゴーストボタン */
.btn-ghost, .btn:not(.btn-primary){
  background: rgba(255,255,255,0.05);
  border-color: var(--card-border);
  color: var(--text-main);
}
.btn-ghost:hover, .btn:not(.btn-primary):hover{
  background: rgba(255,255,255,0.1);
  border-color: var(--text-muted);
}

/* --- クイズ画面 --- */
.quiz-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.progress{
  width: 120px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.progress__bar{
  height: 100%;
  background: var(--gradient-gemini);
  transition: width 0.3s ease;
}

/* 問題文：大きく、見やすく */
.prompt{
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 32px;
  /* 質問文だけ少し背景をつける */
  padding: 24px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03), transparent);
  border-left: 4px solid var(--accent-primary);
  border-radius: 4px;
}

/* 選択肢：カード型で押しやすく */
.choices{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
/* PCなら2列にするなど調整可能だが、読みやすさ重視で1列推奨 */
@media (min-width: 600px) {
  .choices { grid-template-columns: 1fr 1fr; }
}

.choice{
  appearance: none;
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.choice:hover:not(:disabled){
  background: rgba(255,255,255,0.08);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.choice__idx{
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.choice:hover .choice__idx { background: var(--accent-primary); color: white; }

/* 正誤判定スタイル */
.choice--correct{
  background: rgba(68, 208, 154, 0.15) !important;
  border-color: var(--ok) !important;
}
.choice--wrong{
  background: rgba(255, 95, 122, 0.15) !important;
  border-color: var(--danger) !important;
}
/* 無効化時 */
.choice--disabled{ cursor: default; opacity: 0.8; }

/* --- フィードバックエリア --- */
.feedback{
  margin-top: 24px;
  padding: 24px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.pill{
  display: inline-flex; /* inline-blockから変更して中央揃えしやすく */
  align-items: center;
  justify-content: center;
  padding: 6px 16px;       /* 少し広げる */
  border-radius: 99px;
  font-weight: 800;        /* 太くする */
  font-size: 14px;
  margin-right: 12px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3); /* 影をつける */
}

/* OK: 鮮やかな緑背景に、濃い黒文字でコントラスト確保 */
.pill.ok{ 
  background: #44d09a; 
  color: #052e1f;        /* 真っ黒より少し緑がかった濃い色 */
  border: 1px solid #44d09a;
  box-shadow: 0 0 15px rgba(68, 208, 154, 0.4); /* 緑の光 */
}

/* NG: 鮮やかな赤背景に、白文字（または濃い赤） */
.pill.ng{ 
  background: #ff5f7a; 
  color: #ffffff; 
  border: 1px solid #ff5f7a;
  box-shadow: 0 0 15px rgba(255, 95, 122, 0.4); /* 赤の光 */
}

.explain{ margin: 16px 0 24px; font-size: 15px; line-height: 1.7; }

/* --- レポート・その他 --- */
.card-in{
  background: transparent;
  border-top: 1px solid var(--card-border);
  border-radius: 0;
  padding: 24px 0;
  margin-top: 0;
}
.card-in:first-child{ border-top: none; padding-top: 0; }

.kv{
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.kv__k{ color: var(--text-muted); }
.kv__v{ font-weight: 700; }

.badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(78, 154, 241, 0.1);
  border: 1px solid var(--accent-primary);
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  margin: 0 8px 8px 0;
}
.badge b { color: var(--accent-primary); }

.pre{
  background: #000;
  padding: 16px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
  overflow-x: auto;
  border: 1px solid var(--card-border);
}

.footer{
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* ユーティリティ */
.hidden{ display: none !important; }
.sep{ margin: 24px 0; border: 0; border-top: 1px solid var(--card-border); }