/* =========================================================
   EN•joy Phase 3 Pro UI (patch_phase3_pro.css)
   ・開発室（テーマカラー背景・メンバー・PW・ホワイトボード/フレームワーク）
   ・つくり手マップPro（1タップ詳細・ピン色変化・クラスタ・出会いたいカード）
   ========================================================= */

.p3-panel {
  background: #ffffff;
  border: 1px solid rgba(23, 32, 38, 0.10);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
  padding: 16px;
  margin-bottom: 14px;
  color: #172026;
  box-sizing: border-box;
}
html.en-pc-mode #view-en .en-wrap #enP3LabPanel,
html.en-pc-mode #view-feed .en-wrap #enP3MakersPanel {
  grid-column: 1 / -1;
}

.p3-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.p3-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #246a36;
  text-transform: uppercase;
}
.p3-title {
  margin: 2px 0 0;
  font-size: 16.5px;
  font-weight: 900;
  line-height: 1.3;
  color: #172026;
}
.p3-sub {
  margin-top: 3px;
  font-size: 12px;
  color: #52606d;
}

/* --- 共通チップ・ボタン --- */
.p3-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.p3-scroll-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 6px;
  padding-bottom: 4px;
}
.p3-scroll-row::-webkit-scrollbar { display: none; }

.p3-chip {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(23, 32, 38, 0.12);
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.p3-chip.active {
  background: #172026;
  border-color: #172026;
  color: #fff;
}
.p3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 11px;
  border: 1px solid rgba(23, 32, 38, 0.14);
  background: #fff;
  color: #172026;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.p3-btn:hover { background: #f8fafc; }
.p3-btn:active { transform: scale(0.98); }
.p3-btn.primary { background: #246a36; border-color: #246a36; color: #fff; }
.p3-btn.pink { background: #e11d48; border-color: #e11d48; color: #fff; }
.p3-btn.soft { background: #f1f5f9; border-color: transparent; color: #334155; }

.p3-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.p3-badge.solo { background: #f3e8ff; color: #7e22ce; }
.p3-badge.team { background: #dcfce7; color: #166534; }
.p3-badge.lock { background: #fef3c7; color: #b45309; }
.p3-badge.scope { background: #e0f2fe; color: #0369a1; }

/* --- 開発ルームカード（色分け＆メンバー表示） --- */
.p3-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}
.p3-room-card {
  position: relative;
  border-radius: 15px;
  padding: 14px;
  border: 1.5px solid var(--p3-border, rgba(23, 32, 38, 0.12));
  border-left: 6px solid var(--p3-accent, #246a36);
  background: var(--p3-tint, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.p3-room-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}
.p3-members-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.p3-avatar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.10);
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
}
.p3-avatar-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--p3-accent, #246a36);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- スタジオモーダル（ルーム背景色連動・フル機能） --- */
#enP3StudioBackdrop,
#enP3PwBackdrop,
#enP3CardEditorBackdrop {
  position: fixed;
  inset: 0;
  z-index: 10070;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
#enP3StudioBackdrop.open,
#enP3PwBackdrop.open,
#enP3CardEditorBackdrop.open {
  display: flex;
}
.p3-studio-modal {
  width: min(1040px, 100%);
  height: min(90vh, 860px);
  border-radius: 20px;
  background: var(--p3-modal-bg, #f8faf8);
  border: 2px solid var(--p3-accent, #246a36);
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.p3-studio-header {
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.p3-studio-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
}

/* 付箋・KJ法 */
.p3-sticky-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.p3-sticky {
  padding: 11px 12px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.07);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
}
.p3-sticky.cat-issue  { background: #fff1f2; border-color: #fecdd3; }
.p3-sticky.cat-idea   { background: #fef9c3; border-color: #fde047; }
.p3-sticky.cat-mat    { background: #dcfce7; border-color: #86efac; }
.p3-sticky.cat-sales  { background: #e0f2fe; border-color: #7dd3fc; }

.p3-kj-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.p3-kj-col {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  padding: 10px;
}

/* お絵描きホワイトボード */
.p3-canvas-wrap {
  background: #ffffff;
  border: 1.5px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.04);
}
#enP3DrawCanvas {
  display: block;
  width: 100%;
  height: 360px;
  touch-action: none;
  cursor: crosshair;
  background-image: radial-gradient(rgba(15, 23, 42, 0.10) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* マトリックス法・ツリー */
.p3-matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
@media (max-width: 640px) {
  .p3-matrix-grid { grid-template-columns: 1fr; }
}
.p3-quad {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 12px;
  min-height: 115px;
}

/* 色スウォッチ */
.p3-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
}
.p3-swatch.active {
  border-color: #172026;
  transform: scale(1.12);
}

/* --- 🗺️ つくり手マップPro（1タップ詳細・ピン色変化・クラスタリング） --- */
.p3-map-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 860px) {
  .p3-map-layout { grid-template-columns: 1fr; }
}
#enP3MakerMap {
  width: 100%;
  height: 360px;
  border-radius: 15px;
  border: 1.5px solid rgba(23, 32, 38, 0.12);
  z-index: 1;
}
.p3-pin-marker {
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
  transition: transform 0.16s ease, background 0.2s ease;
}
.p3-pin-marker > span {
  transform: rotate(45deg);
  font-size: 14px;
  line-height: 1;
}
.p3-pin-marker.is-liked {
  background: #e11d48 !important;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.28), 0 6px 14px rgba(225, 29, 72, 0.42);
}
.p3-pin-marker.is-selected {
  transform: rotate(-45deg) scale(1.18);
  border-color: #fde047;
}
.p3-cluster-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #172026;
  color: #ffffff;
  border: 3px solid #86efac;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.30);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}
.p3-cluster-marker small {
  font-size: 8.5px;
  font-weight: 700;
  opacity: 0.85;
}
.p3-maker-card {
  background: #ffffff;
  border: 1.5px solid rgba(36, 106, 54, 0.22);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}
.p3-maker-hero {
  position: relative;
  height: 150px;
  background: linear-gradient(135deg, #e8f5e9 0%, #fff8e1 100%);
  overflow: hidden;
}
.p3-maker-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.p3-maker-body {
  padding: 13px 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.p3-mini-dialog {
  width: min(460px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
}
