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

#top-link {
  position: fixed;
  top: 12px;
  right: 16px;
  color: #a8d8ea;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: #16213e;
  border: 1px solid #2a3a5a;
  border-radius: 20px;
  padding: 5px 14px;
  z-index: 200;
  transition: background 0.2s, color 0.2s;
}
#top-link:hover {
  background: #2a3a5a;
  color: #fff;
}

body {
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

h1 {
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  color: #a8d8ea;
  text-align: center;
}

.subtitle {
  font-size: 0.85rem;
  color: #7a8a9a;
  margin-bottom: 20px;
  text-align: center;
}

/* スコアバー */
#scorebar {
  display: flex;
  gap: 30px;
  background: #16213e;
  border: 1px solid #2a3a5a;
  border-radius: 12px;
  padding: 12px 30px;
  margin-bottom: 24px;
  font-size: 1rem;
}
#scorebar span {
  color: #a8d8ea;
  font-weight: 600;
}
#scorebar label {
  color: #7a8a9a;
  margin-right: 6px;
}

/* お題エリア */
#target-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.section-label {
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: #d0eef8;
  text-transform: uppercase;
  margin-bottom: 10px;
}

#target-canvas {
  border: 3px solid #a8d8ea;
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(168, 216, 234, 0.3);
}

/* 難易度 */
#difficulty-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.85rem;
}
#difficulty-bar label { color: #7a8a9a; }
#difficulty-select {
  background: #16213e;
  border: 1px solid #2a3a5a;
  color: #e0e0e0;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

/* 選択肢エリア */
#choices-area {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.choice-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s;
}

.choice-wrapper:hover canvas {
  box-shadow: 0 0 20px rgba(168, 216, 234, 0.5);
}

.choice-canvas {
  border: 3px solid #2a3a5a;
  border-radius: 50%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.choice-label {
  font-size: 0.85rem;
  color: #7a8a9a;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* 正解・不正解の状態 */
.choice-canvas.correct {
  border-color: #4ade80;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.6);
}
.choice-canvas.incorrect {
  border-color: #f87171;
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.4);
}
.choice-canvas.reveal {
  border-color: #4ade80;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

/* フィードバック */
#feedback {
  height: 40px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 16px;
  transition: opacity 0.3s;
}
#feedback.correct  { color: #4ade80; }
#feedback.incorrect { color: #f87171; }

/* ネクストボタン */
#btn-next {
  background: linear-gradient(135deg, #a8d8ea, #6ab3cc);
  color: #1a1a2e;
  border: none;
  border-radius: 30px;
  padding: 12px 40px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: opacity 0.2s, transform 0.15s;
  display: none;
}
#btn-next:hover {
  opacity: 0.88;
  transform: scale(1.04);
}

/* 結果オーバーレイ */
#result-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
#result-overlay.show { display: flex; }
#result-box {
  background: #16213e;
  border: 2px solid #a8d8ea;
  border-radius: 20px;
  padding: 40px 60px;
  text-align: center;
}
#result-box h2 { font-size: 2rem; color: #a8d8ea; margin-bottom: 12px; }
#result-box p  { font-size: 1.2rem; color: #e0e0e0; margin-bottom: 20px; }
#btn-restart {
  background: linear-gradient(135deg, #a8d8ea, #6ab3cc);
  color: #1a1a2e;
  border: none;
  border-radius: 30px;
  padding: 12px 40px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

/* プログレスバー */
#progress-bar-outer {
  width: 300px;
  height: 6px;
  background: #2a3a5a;
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}
#progress-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #a8d8ea, #6ab3cc);
  border-radius: 3px;
  transition: width 0.3s;
}

/* AdSense */
#ad-bottom {
  width: 100%;
  max-width: 640px;
  margin-top: 24px;
}
#ad-bottom .adsbygoogle {
  display: block;
}
