/* ── バナーの4色をそのまま採用 ── */
:root {
  --pink:   #F28B8B;   /* バナー左上：ピンク   → 開放の窓 */
  --green:  #A8D98A;   /* バナー右上：グリーン → 盲点の窓 */
  --yellow: #F5D97A;   /* バナー左下：イエロー → 秘密の窓 */
  --blue:   #85C8E8;   /* バナー右下：ブルー   → 未知の窓 */

  --bg:         #FFFBF5;
  --card-bg:    #FFFFFF;
  --text:       #2D2D2D;
  --text-light: #8A8A8A;
  --radius:     18px;
  --shadow:     0 6px 28px rgba(0,0,0,0.07);
}

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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── 背景装飾 ── */
.bg-deco {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-deco span {
  position: absolute; border-radius: 50%; opacity: 0.15;
}
.bg-deco span:nth-child(1){ width:360px;height:360px; background:var(--pink);   top:-100px; right:-100px; }
.bg-deco span:nth-child(2){ width:260px;height:260px; background:var(--blue);   bottom:-70px; left:-70px; }
.bg-deco span:nth-child(3){ width:180px;height:180px; background:var(--yellow); bottom:20%; right:4%; }
.bg-deco span:nth-child(4){ width:120px;height:120px; background:var(--green);  top:28%; left:2%; }

/* ── プログレスバー ── */
#progressBar {
  position: fixed; top: 0; left: 0; z-index: 300;
  height: 4px;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--green), var(--blue));
  width: 0%; transition: width 0.5s ease;
}

/* ── ヘッダー ── */
.app-header {
  background: white;
  border-bottom: 3px solid var(--yellow);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.logo-grid {
  width: 36px; height: 36px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  border-radius: 8px; overflow: hidden; flex-shrink: 0;
}
.logo-grid span { display: block; }
.logo-grid span:nth-child(1){ background: var(--pink); }
.logo-grid span:nth-child(2){ background: var(--green); }
.logo-grid span:nth-child(3){ background: var(--yellow); }
.logo-grid span:nth-child(4){ background: var(--blue); }
.app-header h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 17px; font-weight: 900; color: var(--text);
}

/* ── メインコンテナ ── */
.main-container {
  max-width: 680px; margin: 0 auto;
  padding: 24px 16px 72px;
  position: relative; z-index: 1;
}

/* ── スクリーン遷移 ── */
.screen { display: none; }
.screen.active { display: block; animation: fadeUp 0.35s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════
   WELCOME SCREEN
══════════════════════════════ */
.hero { text-align: center; padding: 36px 0 28px; }
.hero-logo {
  width: 80px; height: 80px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  border-radius: 20px; overflow: hidden;
  margin: 0 auto 20px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.hero-logo span { display: block; }
.hero-logo span:nth-child(1){ background: var(--pink); }
.hero-logo span:nth-child(2){ background: var(--green); }
.hero-logo span:nth-child(3){ background: var(--yellow); }
.hero-logo span:nth-child(4){ background: var(--blue); }
.hero h1 {
  font-size: clamp(28px, 7vw, 44px); font-weight: 900; line-height: 1.2;
  color: var(--text); margin-bottom: 8px;
}
.hero h1 em {
  font-style: normal; color: var(--pink);
}
.hero-sub { color: var(--text-light); font-size: 13px; line-height: 1.7; }

/* ── カード ── */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  margin-bottom: 16px; border: 1.5px solid rgba(0,0,0,0.04);
}
.card-title {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.card-icon {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}

/* ── ステップ ── */
.steps { display: flex; flex-direction: column; gap: 9px; }
.step {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; line-height: 1.65; color: var(--text-light);
}
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--pink); color: white;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}

/* ── 人数選択 ── */
.num-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.num-btn {
  width: 50px; height: 50px; border-radius: 14px;
  border: 2px solid #E8E8E8; background: white;
  font-size: 20px; font-weight: 700; cursor: pointer;
  transition: all 0.18s; display: flex; align-items: center; justify-content: center;
  color: var(--text); -webkit-tap-highlight-color: transparent;
}
.num-btn.selected {
  border-color: var(--pink); background: var(--pink); color: white;
  box-shadow: 0 4px 12px rgba(242,139,139,0.4); transform: scale(1.06);
}
.num-btn:not(.selected):hover { border-color: var(--pink); color: var(--pink); }

/* ── 入力フィールド ── */
.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-field {
  width: 100%; padding: 11px 15px;
  border: 2px solid #EBEBEB; border-radius: 12px;
  font-size: 15px; font-family: 'Noto Sans JP', sans-serif;
  background: white; color: var(--text);
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
}
.input-field:focus {
  outline: none; border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(242,139,139,0.15);
}
.input-field::placeholder { color: #CACACA; }

/* ── 特徴グリッド ── */
.char-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
@media (min-width: 480px) { .char-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) { .char-grid { grid-template-columns: repeat(4, 1fr); } }

/* ── ボタン ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 14px 28px; border-radius: 100px;
  font-size: 15px; font-weight: 700; font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer; border: none; transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: var(--pink); color: white;
  box-shadow: 0 4px 16px rgba(242,139,139,0.4);
}
.btn-primary:hover:not(:disabled) {
  background: #E07070;
  box-shadow: 0 6px 20px rgba(242,139,139,0.5); transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: white; color: var(--text); border: 2px solid #E8E8E8;
}
.btn-secondary:hover { border-color: var(--pink); color: var(--pink); }
.btn-full { width: 100%; }

/* ── 注意書き ── */
.note {
  background: rgba(0,0,0,0.04); border-radius: 12px;
  padding: 11px 14px; font-size: 12px; color: var(--text-light);
  line-height: 1.6; display: flex; gap: 7px; align-items: flex-start;
}

/* ══════════════════════════════
   CHECK SCREEN — タップ式UI
══════════════════════════════ */

/* 現在の人バナー */
.player-banner {
  background: linear-gradient(135deg, var(--pink) 0%, #F5B0B0 100%);
  border-radius: var(--radius); padding: 18px 20px;
  margin-bottom: 14px; display: flex; align-items: center; gap: 14px;
}
.player-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: white; color: var(--pink);
  font-size: 20px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.player-info { flex: 1; min-width: 0; }
.player-label { font-size: 12px; color: rgba(255,255,255,0.9); font-weight: 500; margin-bottom: 4px; }
.player-name-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.player-name  { font-size: 22px; font-weight: 900; color: white; white-space: nowrap; }
.player-instruction { font-size: 13px; color: rgba(255,255,255,0.92); font-weight: 500; white-space: nowrap; }

/* 上限インフォ */
.check-info {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding: 0 2px;
  font-size: 13px; color: var(--text-light);
}
.check-info strong { color: var(--pink); }

/* メンバー別チェック数サマリー */
.member-summary {
  background: white; border-radius: 14px;
  padding: 12px 14px; margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1.5px solid #F0F0F0;
}
.member-summary-label {
  font-size: 11px; font-weight: 700; color: var(--text-light);
  letter-spacing: 0.05em; margin-bottom: 9px;
}
.summary-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.summary-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 100px;
  font-size: 12px; font-weight: 700;
  background: #F4F4F4; color: var(--text);
}
.s-count {
  min-width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: white; font-weight: 900;
}

/* 特徴カードリスト */
.feature-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.feature-row {
  background: white; border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1.5px solid #F0F0F0; overflow: hidden;
}
.feature-label {
  font-size: 14px; font-weight: 700;
  padding: 12px 16px 8px; color: var(--text);
}
.member-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 0 12px 12px;
}

/* メンバーチップ */
.member-chip {
  padding: 7px 16px; border-radius: 100px;
  font-size: 13px; font-weight: 700;
  border: 2px solid #E8E8E8;
  background: white; color: var(--text-light);
  cursor: pointer; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.member-chip:active { transform: scale(0.93); }

/* チェック済みカラー（メンバー番号別） */
.member-chip.ch-0 { background: var(--pink);   border-color: var(--pink);   color: white; }
.member-chip.ch-1 { background: var(--green);  border-color: var(--green);  color: #2D2D2D; }
.member-chip.ch-2 { background: var(--yellow); border-color: var(--yellow); color: #2D2D2D; }
.member-chip.ch-3 { background: var(--blue);   border-color: var(--blue);   color: white; }
.member-chip.ch-4 { background: #D4A8FF; border-color: #D4A8FF; color: white; }
.member-chip.ch-5 { background: #FFB347; border-color: #FFB347; color: white; }
.member-chip.ch-6 { background: #90EE90; border-color: #90EE90; color: #2D2D2D; }
.member-chip.ch-7 { background: #FFB6C1; border-color: #FFB6C1; color: #2D2D2D; }

/* 上限済みのチップをグレーアウト（チェックされていないもの） */
.member-chip.at-limit { opacity: 0.32; cursor: not-allowed; }

/* ══════════════════════════════
   RESULT SCREEN
══════════════════════════════ */
.result-header { text-align: center; padding: 28px 0 20px; }
.result-header h2 { font-size: 28px; font-weight: 900; color: var(--text); }
.result-header p  { color: var(--text-light); font-size: 13px; margin-top: 6px; }

/* (result card styles moved below) */

.result-actions { display: flex; flex-direction: column; gap: 10px; padding-bottom: 40px; }

/* ── 結果カードラッパー ── */
.johari-card-wrap { margin-bottom: 28px; }
.johari-card {
  background: white; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  border: 1.5px solid rgba(0,0,0,0.04);
}

/* ── カードヘッダー（保存ボタンなし） ── */
.johari-card-header {
  background: linear-gradient(135deg, var(--pink), #F5ACAC);
  padding: 14px 18px;
}
.johari-card-header h3 { color: white; font-size: 17px; font-weight: 900; }

/* ── 結果グリッド（軸ラベルなし） ── */
.johari-layout { display: block; }

/* 4ペイングリッド（外枠はラベル削除に伴いグリッド側で統一） */
.johari-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid #BBBBBB;
  /* 親 .johari-card の角丸クリップと外枠罫線の弧を一致させ、下端の罫線欠けを防ぐ */
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  overflow: hidden;
}
.johari-pane { padding: 14px 12px; min-height: 130px; }
.johari-pane:nth-child(1) { background: rgba(242,139,139,0.10); border-right: 2px solid #BBBBBB; border-bottom: 2px solid #BBBBBB; }
.johari-pane:nth-child(2) { background: rgba(168,217,138,0.10); border-bottom: 2px solid #BBBBBB; }
.johari-pane:nth-child(3) { background: rgba(245,217,122,0.12); border-right: 2px solid #BBBBBB; }
.johari-pane:nth-child(4) { background: rgba(133,200,232,0.10); }

.pane-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  margin-bottom: 4px; display: flex; align-items: center; gap: 5px;
  flex-wrap: wrap; line-height: 1.35;
}
.pane-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pane-desc {
  font-size: 10px; color: var(--text-light); line-height: 1.4;
  margin-bottom: 8px;
}

.johari-pane:nth-child(1) .pane-title { color: #C05050; }
.johari-pane:nth-child(1) .pane-dot   { background: var(--pink); }
.johari-pane:nth-child(2) .pane-title { color: #5B9040; }
.johari-pane:nth-child(2) .pane-dot   { background: var(--green); }
.johari-pane:nth-child(3) .pane-title { color: #9A7C00; }
.johari-pane:nth-child(3) .pane-dot   { background: var(--yellow); }
.johari-pane:nth-child(4) .pane-title { color: #2C7EA8; }
.johari-pane:nth-child(4) .pane-dot   { background: var(--blue); }

.tags-wrap { display: flex; flex-wrap: wrap; gap: 4px; }
.result-tag {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 3px;
}
.johari-pane:nth-child(1) .result-tag { background: rgba(242,139,139,0.22); color: #C05050; }
.johari-pane:nth-child(2) .result-tag { background: rgba(168,217,138,0.28); color: #5B9040; }
.johari-pane:nth-child(3) .result-tag { background: rgba(245,217,122,0.35); color: #9A7C00; }
.johari-pane:nth-child(4) .result-tag { background: rgba(133,200,232,0.28); color: #2C7EA8; }
.tag-empty { font-size: 12px; color: #CACACA; }

/* ── ×N カウントバッジ ── */
.tag-count {
  font-size: 10px; font-weight: 900;
  opacity: 0.75; letter-spacing: 0.02em;
}

/* ── 保存ボタン（カード外） ── */
.download-row {
  display: flex; justify-content: flex-end;
  padding: 10px 4px 0;
}
.btn-download-below {
  background: white; color: var(--text-light);
  border: 2px solid #E8E8E8; border-radius: 100px;
  font-size: 13px; font-weight: 700;
  padding: 8px 18px; cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.18s; -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center; gap: 5px;
}
.btn-download-below:hover {
  border-color: var(--pink); color: var(--pink);
  box-shadow: 0 3px 12px rgba(242,139,139,0.2);
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #2D2D2D; color: white;
  padding: 11px 22px; border-radius: 100px;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  z-index: 999; transition: transform 0.28s ease;
  white-space: nowrap; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
