/* TryLab — 境界線チェッカー (boundary.css) */

.boundary-main {
  padding-top: 24px;
  padding-bottom: 60px;
}

.boundary-stage {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.boundary-stage.hidden {
  display: none !important;
}

/* プログレスバー */
.quiz-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-step-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.05em;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* 質問カード */
.boundary-card-container {
  perspective: 1000px;
}

.boundary-question-card {
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0d1527 100%);
  border: 1px solid #2e3e5c;
  border-radius: 18px;
  padding: 36px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  text-align: center;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.boundary-question-card.slide-out {
  transform: translateX(-40px);
  opacity: 0;
}

.boundary-question-card.slide-in {
  transform: translateX(40px);
  opacity: 0;
}

.q-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin-bottom: 16px;
}

.q-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.45;
  margin-bottom: 32px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 2択エリア */
.choices-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.choice-vs {
  font-size: 0.8rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.1em;
}

.choice-btn {
  background: #131d2e;
  border: 2px solid #23354f;
  border-radius: 14px;
  padding: 18px 20px;
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
}

@media (hover: hover) {
  .choice-btn:hover:not(:disabled) {
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.2);
  }
}

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

.choice-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1e293b;
  color: #94a3b8;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.choice-text {
  flex-grow: 1;
  z-index: 2;
  position: relative;
}

/* 選択後の世間比率バー */
.ratio-bar-reveal {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: rgba(56, 189, 248, 0.2);
  border-right: 3px solid #38bdf8;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 14px;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.choice-btn.selected {
  border-color: #38bdf8;
  background: #1e293b;
}

.choice-btn.revealed .ratio-bar-reveal {
  opacity: 1;
}

.ratio-pct {
  font-size: 1.25rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: ui-monospace, monospace;
}

.ratio-label {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-left: 6px;
}

.next-hint {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 24px;
  min-height: 20px;
}

/* 結果画面 */
.result-container {
  background: rgba(17, 24, 39, 0.88);
  border: 1px solid #2d3748;
  border-radius: 16px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.result-header {
  text-align: center;
}

.result-badge {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #818cf8;
  font-weight: 700;
}

.result-title {
  font-size: 1.8rem;
  color: #f8fafc;
  margin: 8px 0;
}

.result-lead {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
}

.result-card-visual {
  display: flex;
  justify-content: center;
}

#result-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  background: #0b1120;
  border: 1px solid #1e293b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.boundary-breakdown {
  background: #111827;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #1f2937;
}

.boundary-breakdown h3 {
  font-size: 1rem;
  color: #e2e8f0;
  margin-bottom: 14px;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: #162032;
  border-radius: 8px;
  border: 1px solid #243147;
}

.breakdown-q {
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1.4;
}

.breakdown-a-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.breakdown-a {
  font-weight: 700;
  font-size: 1rem;
  color: #38bdf8;
}

.breakdown-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-weight: 600;
}

.breakdown-item.minority .breakdown-a {
  color: #f43f5e;
}

.breakdown-item.minority .breakdown-badge {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
}

.result-advice-box {
  background: rgba(30, 41, 59, 0.5);
  border-left: 4px solid #818cf8;
  border-radius: 8px;
  padding: 18px 20px;
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.7;
}

.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.boundary-btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 26px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.boundary-btn.primary {
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.boundary-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

.boundary-btn.secondary {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #475569;
}

.boundary-btn.secondary:hover {
  background: #334155;
}

.boundary-btn.tertiary {
  background: transparent;
  color: #94a3b8;
  text-decoration: underline;
}

.boundary-btn.tertiary:hover {
  color: #f1f5f9;
}

/* スタート（表紙）画面 */
.boundary-start-card {
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0d1527 100%);
  border: 1px solid #2e3e5c;
  border-radius: 18px;
  padding: 44px 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.start-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.start-title {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0;
  color: #f8fafc;
}

.start-lead {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 480px;
  margin: 0;
}

.start-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin: 8px 0;
  text-align: left;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
}

.feature-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.feature-item strong {
  display: block;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.feature-item small {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
}

.btn-start-boundary {
  width: 100%;
  max-width: 380px;
  padding: 16px 28px;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #0b1120;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.35);
}

.btn-start-boundary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.5);
}

.start-fine {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}
