.gap-layout {
  max-width: 1160px;
  margin: 0 auto;
}

/* ヒーロー＆アートカード */
.gap-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  min-height: 420px;
  gap: 40px;
  padding: 30px 0 55px;
}
.gap-hero h1 {
  font-size: clamp(32px, 3.8vw, 48px);
  line-height: 1.35;
  letter-spacing: -1px;
}
.gap-hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-copy {
  font-size: 15px;
  color: #bbc1cd;
  line-height: 1.9;
  margin: 20px 0 28px;
}
.gap-hero .fine {
  margin-top: 14px;
  font-size: 11px;
}

.gap-art-card {
  height: 370px;
  position: relative;
  background: radial-gradient(ellipse at 50% 50%, rgba(56, 189, 248, 0.14) 0%, rgba(20, 24, 36, 0.6) 70%);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}
.gap-art-badge {
  position: absolute;
  top: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
}
.gap-art-circles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: -24px;
}
.art-circle {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.45);
}
.art-circle.c-me {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.7) 0%, rgba(2, 132, 199, 0.45) 100%);
  border: 2px solid #38bdf8;
  color: #fff;
  transform: translateX(18px);
  z-index: 1;
}
.art-circle.c-friend {
  background: radial-gradient(circle, rgba(244, 63, 94, 0.7) 0%, rgba(225, 29, 72, 0.45) 100%);
  border: 2px solid #f43f5e;
  color: #fff;
  transform: translateX(-18px);
  z-index: 2;
}
.gap-art-card .art-spark {
  position: absolute;
  top: 35px;
  right: 28px;
  font-size: 28px;
  color: #fde047;
  animation: pulse 2s infinite;
}
.gap-art-card .art-caption {
  position: absolute;
  bottom: 20px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 2px;
}

/* 3ステップ説明 */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 28px;
  background: #111520;
}
.steps > div {
  padding: 26px 28px;
  border-right: 1px solid var(--line);
}
.steps > div:last-child {
  border: 0;
}
.steps span {
  font-size: 12px;
  color: var(--accent);
  font-weight: 800;
}
.steps h3 {
  margin: 12px 0 8px;
  font-size: 14px;
  font-weight: 700;
}
.steps p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}

.privacy-note {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.9;
  max-width: 800px;
  margin: 24px auto;
  text-align: center;
}

/* ルーム画面 */
.room-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  margin: 25px 0 30px;
}
.room-top .actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.room-top h2 {
  font-size: 20px;
}
.room-note .fine {
  margin-top: 14px;
}
.room-settings {
  margin-top: 30px;
  font-size: 12px;
  color: var(--muted);
}
.room-settings .fine {
  margin: 14px 0;
  line-height: 1.7;
}
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.recent-item a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.recent-item a:hover {
  text-decoration: underline;
}

/* STAGE 2 アコーディオン */
.stage2-details {
  background: #111522;
  border: 1px dashed rgba(165, 180, 252, 0.35);
  border-radius: 16px;
  padding: 18px 22px;
  margin: 28px 0;
}
.stage2-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  color: #c7d2fe;
  user-select: none;
}
.stage2-summary:hover {
  color: #fff;
}
.stage2-details[open] .stage2-toggle-arrow {
  transform: rotate(180deg);
}
.stage2-toggle-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: var(--muted);
}

.text-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0 0 20px;
}
.text-btn:hover {
  color: #fff;
}
.quiz-wrap {
  max-width: 800px;
  margin: 0 auto;
}
.name-panel {
  margin: 20px 0 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}
.name-panel input {
  margin-top: 8px;
  width: 100%;
  max-width: 360px;
}
.consent {
  display: flex;
  align-items: start;
  gap: 10px;
  font-size: 12px;
  color: #c3c8d2;
}
.consent input {
  margin-top: 3px;
  accent-color: var(--accent);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.submit-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}
.submit-panel .btn {
  width: 100%;
  margin-top: 18px;
}

.gap-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.gap-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.gap-card-header h2 {
  font-size: 19px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gap-card-num {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
}

.gap-display-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.gap-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.gap-pill {
  background: #242a36;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gap-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Q2 Color */
.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 16px 0;
}

.color-preview-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #ffffff33;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  transition: background-color 0.1s ease;
}

.color-input-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 2px solid var(--line);
  border-radius: 50%;
}

.color-code {
  font-family: monospace;
  font-size: 14px;
  color: var(--muted);
}

/* Q3 Stopwatch */
.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #10151e;
  border-radius: 14px;
  border: 1px dashed var(--line);
  margin: 16px 0;
}

.timer-digits {
  font-size: clamp(38px, 8vw, 56px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: monospace;
  color: var(--accent);
  min-height: 1.2em;
  display: flex;
  align-items: center;
}

.timer-blind {
  color: #8f9eaf;
  letter-spacing: 4px;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.timer-feedback {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  min-height: 20px;
}

.timer-controls {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

/* Results & Comparisons */
#result {
  max-width: 1040px;
  margin: 0 auto;
}

.comparison {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 28px;
  margin: 20px 0 30px;
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}

.comparison-header h2 {
  margin: 0;
  font-size: 20px;
}

.match-count {
  color: var(--accent);
  font-size: 14px;
  white-space: nowrap;
  font-weight: 800;
}

.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 16px;
}

.legend span:before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #38bdf8;
  margin-right: 6px;
}

.legend span + span:before {
  background: #f43f5e;
}

.result-hero {
  text-align: center;
  padding: 36px 20px;
  background: linear-gradient(180deg, rgba(198, 246, 155, 0.08) 0%, rgba(25, 29, 39, 0) 100%);
  border-radius: 20px;
  border: 1px solid var(--line);
  margin-bottom: 28px;
}

.result-score-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 16px 0;
}

.result-total-score {
  font-size: clamp(54px, 12vw, 84px);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.result-subtitle {
  font-size: 18px;
  font-weight: 700;
  margin-top: 8px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.compare-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

.compare-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.compare-item-title {
  font-weight: 700;
  font-size: 14px;
}

.compare-item-match {
  font-weight: 800;
  font-size: 14px;
  color: var(--accent);
}

.compare-values {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px;
  background: #10151e;
  border-radius: 10px;
}

.compare-user-box {
  text-align: center;
}

.compare-user-label {
  font-size: 10px;
  color: var(--muted);
  display: block;
}

.compare-user-val {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
}

.compare-vs {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.color-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.color-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #ffffff44;
}

.invite-banner {
  background: #1c261e;
  border: 1px solid #3c6543;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.invite-banner-icon {
  font-size: 24px;
}

.invite-banner-text h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--accent);
}

.invite-banner-text p {
  margin: 0;
  font-size: 12px;
  color: #c0d8c2;
}

.share-card {
  background: #141b24;
  border: 1px solid #304255;
  border-radius: 16px;
  padding: 24px;
  margin-top: 28px;
  text-align: center;
}

.share-card h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.share-card p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.privacy-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--accent);
  background: #1a271f;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 10px;
}

.compare-diff-phrase {
  margin-top: 10px;
  background: rgba(198, 246, 155, 0.08);
  border: 1px solid rgba(198, 246, 155, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #d1f4ba;
  display: flex;
  align-items: center;
  gap: 8px;
}
.compare-diff-phrase::before {
  content: "💬";
  font-size: 14px;
}
.gap-adjust-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ニックネーム入力 */
.name-entry-wrap {
  background: #141b24;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.name-entry-wrap label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.name-entry-wrap input {
  background: #0d121a;
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  width: 220px;
  outline: none;
  transition: border-color 0.2s;
}

.name-entry-wrap input:focus {
  border-color: var(--accent);
}

/* Q6 図形拡大インタラクション */
.shape-scale-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: #10151e;
  border-radius: 14px;
  border: 1px dashed var(--line);
  margin: 16px 0;
  overflow: hidden;
}

.shape-stage {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shape-base-box {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  pointer-events: none;
}

.shape-base-label {
  position: absolute;
  bottom: -22px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.shape-scaled-box {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(99, 102, 241, 0.45));
  border: 2px solid #38bdf8;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.25);
  transition: transform 0.05s linear;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

/* Q8 線の長さ合わせインタラクション */
.line-match-wrap {
  padding: 24px 20px;
  background: #10151e;
  border-radius: 14px;
  border: 1px dashed var(--line);
  margin: 16px 0;
}

.line-row {
  margin-bottom: 20px;
}

.line-label-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.line-sample-bar {
  height: 14px;
  width: 180px;
  background: #a5b4fc;
  border-radius: 7px;
  box-shadow: 0 0 12px rgba(165, 180, 252, 0.4);
}

.line-user-bar {
  height: 14px;
  width: 140px;
  background: #38bdf8;
  border-radius: 7px;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  transition: width 0.05s linear;
}

/* STAGE 2 プロモカード */
.stage2-promo-card {
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, #151926 70%);
  border: 1px solid rgba(165, 180, 252, 0.3);
  border-radius: 18px;
  padding: 30px 24px;
  text-align: center;
  margin: 32px 0 20px;
}

.stage2-promo-card h3 {
  font-size: 20px;
  margin: 8px 0;
  color: #f8fafc;
}

.stage2-promo-card p {
  color: var(--muted);
  font-size: 13.5px;
  max-width: 480px;
  margin: 0 auto 20px;
}

/* 「友達から見たわたし」スタイルのハイライト要約カード */
.top-divergence-box {
  background: #151926;
  border: 1px solid rgba(165, 180, 252, 0.25);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 20px 0 28px;
  text-align: left;
  line-height: 1.65;
  font-size: 14px;
}

.top-divergence-box strong {
  color: #f8fafc;
}

.highlight-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.highlight-row:last-child {
  margin-bottom: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.highlight-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1.2;
}

/* 比較視覚化バー・トラック */
.visual-compare-track {
  position: relative;
  height: 8px;
  background: #1c2433;
  border-radius: 4px;
  margin: 18px 12px 10px;
}

.track-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  z-index: 2;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.track-marker.me {
  background: #38bdf8;
}

.track-marker.friend {
  background: #f43f5e;
}

.track-marker-label {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.track-marker.me .track-marker-label {
  background: #0284c7;
  color: #fff;
}

.track-marker.friend .track-marker-label {
  background: #e11d48;
  color: #fff;
}

.compare-badge-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.compare-badge-pill.exact {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.compare-badge-pill.close {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.compare-badge-pill.diff {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.3);
}

/* 共有ボタン群 */
.share-action-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn-line-share {
  background: #06c755 !important;
  color: #ffffff !important;
  border-color: #06c755 !important;
  font-weight: 700;
}
.btn-line-share:hover {
  filter: brightness(1.08);
}

@media (max-width: 900px) {
  .gap-hero {
    grid-template-columns: 1fr;
    padding: 10px 0 30px;
    gap: 20px;
  }
  .gap-art-card {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    height: 280px;
  }
  .room-top {
    grid-template-columns: 1fr;
  }
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .comparison-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .gap-hero h1 {
    font-size: 28px;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .steps > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px;
  }
  .gap-card {
    padding: 20px 16px;
  }
  .color-picker-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .name-panel input {
    width: 100%;
  }
}
