@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

body {
  margin: 0; padding: 0;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e0f2fe;
  font-family: 'Noto Sans JP', sans-serif;
  min-height: 100vh;
  display: flex; justify-content: center; align-items: center;
  overflow: hidden;
}

.glass-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 40px; width: 90%; max-width: 650px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  text-align: center; position: relative; z-index: 10;
}

h1 { font-size: 1.6rem; color: #38bdf8; text-shadow: 0 0 10px rgba(56, 189, 248, 0.5); }
.hidden { display: none !important; }

/* フォーム系 */
.user-info { margin: 20px 0; }
#self-id {
  background: rgba(255, 255, 255, 0.1); border: 1px solid #38bdf8;
  color: #fff; padding: 10px; border-radius: 5px; width: 80%; text-align: center;
}

.choice-btn {
  background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3);
  color: #e0f2fe; padding: 15px; margin: 8px 0; width: 100%; border-radius: 10px;
  cursor: pointer; transition: all 0.3s ease; font-size: 1rem;
}
.choice-btn:hover { background: rgba(56, 189, 248, 0.3); box-shadow: 0 0 15px rgba(56, 189, 248, 0.5); }

/* ローディング演出 */
.loader {
  border: 8px solid rgba(255, 255, 255, 0.1); border-top: 8px solid #38bdf8;
  border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-text { color: #38bdf8; font-weight: bold; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* 芋虫 & ダーリンちゃん */
#bug-container {
  position: absolute; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; align-items: center; z-index: 1000;
  transition: left 3s linear, right 3s linear;
}
.bug-icon { font-size: 3rem; cursor: pointer; transition: transform 0.1s; user-select: none; filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));}
.bug-icon:active { transform: scale(0.8); }
.splashed { filter: grayscale(100%) brightness(0.5); transform: scale(1.5) rotate(180deg); pointer-events: none; }

#darling-container {
  position: fixed; top: 50px; left: 20px; display: flex; flex-direction: column; align-items: flex-start; z-index: 1000; transition: all 0.5s ease;
}
.bubble {
  background: rgba(255, 255, 255, 0.95); color: #0f172a; padding: 10px; border-radius: 10px; font-size: 0.85rem; font-weight: bold; margin-bottom: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.bubble-pink {
  background: #fdf2f8; color: #be185d; padding: 10px; border-radius: 15px; font-size: 0.8rem; margin-bottom: 5px; border: 2px solid #f472b6; max-width: 200px;
}
.darling-icon { font-size: 2.5rem; filter: drop-shadow(0 0 5px #f472b6); user-select: none; }

/* ギミック用CSS */
input[type="range"] { width: 100%; margin: 20px 0; cursor: pointer; }
.slider-value { font-size: 1.5rem; font-weight: bold; color: #38bdf8; }

.box-container { display: flex; justify-content: center; gap: 15px; margin: 30px 0; }
.align-box { width: 50px; height: 50px; background: #38bdf8; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: all 0.2s;}
.misaligned { transform: translateY(10px) rotate(5deg); background: #7dd3fc; }

.gradient-bar { width: 100%; height: 80px; background: linear-gradient(to right, white, black); cursor: crosshair; border: 2px solid #38bdf8; margin: 20px 0; position: relative; }
.boundary-line { position: absolute; top: 0; width: 2px; height: 100%; background: red; display: none; }

.tree-container { display: flex; flex-direction: column; align-items: center; gap: 20px; margin: 20px 0; }
.folder { border: 2px dashed #38bdf8; padding: 15px; width: 80%; border-radius: 10px; min-height: 60px; display: flex; flex-wrap: wrap; gap: 5px;}
.items-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.draggable-item { background: #e0f2fe; color: #0f172a; padding: 8px 12px; border-radius: 5px; cursor: pointer; font-size: 0.9rem; font-weight: bold; user-select: none;}

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

body {
  margin: 0; padding: 0;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e0f2fe; font-family: 'Noto Sans JP', sans-serif;
  height: 100vh; display: flex; justify-content: center; align-items: center;
  overflow: hidden; /* 全体は固定 */
}

.glass-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px;
  padding: 30px; width: 90%; max-width: 650px; max-height: 85vh;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column;
}

.scroll-area {
  overflow-y: auto; padding-right: 10px;
  scrollbar-width: thin; scrollbar-color: #38bdf8 transparent;
}
.scroll-area::-webkit-scrollbar { width: 6px; }
.scroll-area::-webkit-scrollbar-thumb { background: #38bdf8; border-radius: 10px; }

h1 { font-size: 1.5rem; color: #38bdf8; text-shadow: 0 0 10px rgba(56, 189, 248, 0.5); margin-bottom: 20px;}

.choice-btn {
  background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3);
  color: #e0f2fe; padding: 15px; margin: 8px 0; width: 100%; border-radius: 10px;
  cursor: pointer; transition: all 0.3s; font-size: 1rem; font-weight: bold;
}
.choice-btn:hover { background: rgba(56, 189, 248, 0.3); box-shadow: 0 0 15px rgba(56, 189, 248, 0.5); }

/* フォルダギミック */
.folder-wrap { display: flex; gap: 10px; margin: 20px 0; justify-content: space-around; }
.folder {
  border: 2px dashed #38bdf8; border-radius: 10px; width: 45%; min-height: 100px;
  padding: 10px; background: rgba(255, 255, 255, 0.05); font-size: 0.8rem;
}

/* 説明書ギミック（組み立て順序） */
.manual-steps { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.step-item {
  background: rgba(56, 189, 248, 0.2); padding: 10px; border-radius: 5px;
  cursor: move; font-size: 0.9rem; border: 1px solid #38bdf8;
}

/* その他パーツは前回と同じ or 統合 */
.loader { border: 6px solid rgba(255,255,255,0.1); border-top: 6px solid #38bdf8; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: auto; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.hidden { display: none !important; }

#bug-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; transition: all 3s linear; }
.bug-icon { font-size: 3rem; cursor: pointer; user-select: none; transition: transform 0.1s; }
.splashed { filter: grayscale(1) opacity(0); transform: scale(2); transition: all 1s ease; }
.bubble { background: white; color: black; padding: 8px; border-radius: 8px; font-size: 0.8rem; margin-bottom: 5px; max-width: 150px; }
.bubble-pink { background: #fdf2f8; color: #be185d; border: 1px solid #f472b6; padding: 10px; border-radius: 10px; font-size: 0.8rem; }

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

body {
  margin: 0; padding: 0;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e0f2fe; font-family: 'Noto Sans JP', sans-serif;
  height: 100vh; display: flex; justify-content: center; align-items: center;
  overflow: hidden;
}

.glass-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px;
  padding: 30px; width: 90%; max-width: 650px; max-height: 90vh;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5); display: flex; flex-direction: column;
}

.scroll-area { overflow-y: auto; padding-right: 10px; }
.scroll-area::-webkit-scrollbar { width: 6px; }
.scroll-area::-webkit-scrollbar-thumb { background: #38bdf8; border-radius: 10px; }

h1 { font-size: 1.5rem; color: #38bdf8; text-shadow: 0 0 10px rgba(56, 189, 248, 0.5); }
.hidden { display: none !important; }

.choice-btn {
  background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3);
  color: #e0f2fe; padding: 15px; margin: 8px 0; width: 100%; border-radius: 10px;
  cursor: pointer; transition: 0.3s; font-size: 1rem;
}
.choice-btn:hover { background: rgba(56, 189, 248, 0.3); box-shadow: 0 0 15px rgba(56, 189, 248, 0.5); }

/* ギミックパーツ */
.loader { border: 6px solid rgba(255,255,255,0.1); border-top: 6px solid #38bdf8; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: auto; }
@keyframes spin { 100% { transform: rotate(360deg); } }

#bug-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; transition: left 3s linear; text-align: center;}
.bug-icon { font-size: 3rem; cursor: pointer; user-select: none; display: block;}
.splashed { animation: splashEffect 0.5s forwards; color: #ef4444; }
@keyframes splashEffect {
  0% { transform: scale(1); }
  50% { transform: scale(2) rotate(20deg); filter: hue-rotate(90deg); }
  100% { transform: scale(1.5) rotate(180deg); opacity: 0; }
}

.bubble { background: white; color: black; padding: 8px; border-radius: 8px; font-size: 0.8rem; margin-bottom: 5px; font-weight: bold;}
.bubble-pink { background: #fdf2f8; color: #be185d; border: 1px solid #f472b6; padding: 10px; border-radius: 10px; font-size: 0.8rem; }

.align-box { width: 50px; height: 50px; background: #38bdf8; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: 0.2s;}
.misaligned { transform: translateY(10px) rotate(8deg); }

.folder-wrap { display: flex; gap: 10px; margin: 20px 0; justify-content: space-around; }
.folder { border: 2px dashed #38bdf8; border-radius: 10px; width: 45%; min-height: 120px; padding: 10px; background: rgba(255, 255, 255, 0.05); }
.draggable-item { background: #e0f2fe; color: #0f172a; padding: 5px 10px; border-radius: 5px; cursor: pointer; font-size: 0.8rem; margin: 3px; display: inline-block; font-weight: bold; }

.gradient-bar { width: 100%; height: 60px; background: linear-gradient(to right, white, black); cursor: crosshair; border: 2px solid #38bdf8; margin: 20px 0; position: relative; }
.boundary-line { position: absolute; top: 0; width: 3px; height: 100%; background: #ff4d4d; display: none; }

/* 追加・修正部分 */
.scroll-area { overflow-y: auto; padding: 10px; flex-grow: 1; touch-action: pan-y; }

/* 仕分け枠をはっきりさせる */
.folder-wrap { display: flex; gap: 15px; margin: 20px 0; min-height: 150px; }
.folder {
  border: 3px dashed #38bdf8; border-radius: 15px; width: 48%; min-height: 120px;
  padding: 10px; background: rgba(56, 189, 248, 0.05);
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px;
  position: relative;
}
.folder::before {
  content: attr(data-label); position: absolute; top: -12px; left: 10px;
  background: #1e293b; padding: 0 5px; font-size: 0.7rem; color: #38bdf8;
}

/* ドラッグアイテム */
.draggable-item {
  background: #e0f2fe; color: #0f172a; padding: 8px 12px; border-radius: 8px;
  cursor: grab; font-size: 0.85rem; font-weight: bold; user-select: none;
  touch-action: none; border: 2px solid #38bdf8;
}
.draggable-item:active { cursor: grabbing; transform: scale(1.1); z-index: 1000; }

/* 境界線ギミック */
.gradient-bar { 
  width: 100%; height: 80px; background: linear-gradient(to right, white, black); 
  border: 2px solid #38bdf8; margin: 20px 0; position: relative; cursor: crosshair;
}
.boundary-handle {
  position: absolute; top: 0; width: 10px; height: 100%; background: #ff4d4d;
  cursor: ew-resize; transform: translateX(-50%); box-shadow: 0 0 10px rgba(255,0,0,0.5);
}

/* 説明書の badge と光る演出 */
.badge-order {
  position: absolute; right: 10px; top: 10px;
  background: #38bdf8; color: #000; border-radius: 50%;
  width: 24px; height: 24px; text-align: center; line-height: 24px;
  font-weight: bold; box-shadow: 0 0 10px #38bdf8;
}
.btn-active {
  background: rgba(56, 189, 248, 0.3) !important;
  border: 2px solid #38bdf8 !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}
/* ドラッグ中アイテムを浮かす */
.dragging-clone {
  position: fixed !important;
  pointer-events: none;
  z-index: 10000;
  opacity: 0.9;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  transform: scale(1.05);
}
/* 文章修正の入力欄 */
.debug-input {
  width: 100%; background: rgba(0,0,0,0.3); color: #fff;
  border: 1px solid #38bdf8; padding: 10px; border-radius: 5px;
  font-family: monospace; margin-top: 10px;
}

/* EXITボタン */
.exit-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  color: #38bdf8;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2rem;
  z-index: 1000;
  transition: 0.3s;
  background: rgba(0,0,0,0.5);
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid #38bdf8;
}
.exit-btn:hover {
  text-shadow: 0 0 10px #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  transform: scale(1.05);
}

/* 結果アクションボタン */
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.action-btn {
  flex: 1;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid #38bdf8;
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: 0.3s;
  min-width: 100px;
}
.action-btn:hover {
  background: rgba(56, 189, 248, 0.5);
}

/* スマホ用レスポンシブ対応 */
@media (max-width: 600px) {
  .glass-container { padding: 15px; width: 95%; max-height: 95vh; }
  h1 { font-size: 1.2rem; }
  h3 { font-size: 0.95rem; }
  .choice-btn { font-size: 0.85rem; padding: 12px; }
  .folder { width: 48%; min-height: 60px; font-size: 0.8rem; }
  .align-box { width: 40px; height: 40px; }
  .slider-value { font-size: 1.2rem; }
}
/* 連打してもズームさせない、かつタップの反応を速くする */
button, .choice-btn, .bug-icon, .draggable-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; /* タップした時の青い枠を消す */
}

/* 🐛の当たり判定を少し大きくする */
#bug-container {
  padding: 20px;
  cursor: pointer;
}
