:root {
  --primary: #2c3e50;
  --secondary: #e67e22;
  --bg: #ecf0f1;
  --card: #ffffff;
  --text: #333333;
  --accent: #3498db;
}

body {
  font-family: 'Hiragino Maru Gothic ProN', 'Meiryo', sans-serif;
  background-color: #bdc3c7;
  margin: 0;
  padding: 10px;
  display: flex;
  justify-content: center;
  color: var(--text);
}

#app {
  width: 100%;
  max-width: 800px;
  background: var(--bg);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  overflow: hidden;
  position: relative;
}

header {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid var(--secondary);
}
header h1 { margin: 0; font-size: 20px; }
.step-indicator { background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 16px; font-weight: bold; }

/* Visualizer */
.visualizer { background: #fff; padding: 20px; border-bottom: 3px dashed #95a5a6; }
.area-label { font-weight: bold; color: #555; display: flex; justify-content: space-between; align-items: center; }
.btn-small { background: #eee; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s; font-family: inherit;}
.btn-small:active { transform: scale(0.95); }
.btn-magic { background: #e8f8f5; color: #16a085; border: 1px solid #1abc9c; }

.pool-container { max-height: 120px; overflow-y: auto; background: #fafafa; border: 2px solid #ddd; border-radius: 8px; margin-top: 8px; padding: 8px; }
.pool { display: flex; flex-wrap: wrap; gap: 6px; }

.groups { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; min-height: 80px; }
.group-box {
  background: #fdf2e9; border: 2px solid #e67e22; border-radius: 8px; padding: 6px;
  display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; justify-content: center;
  width: 80px; min-height: 60px;
}
.group-box.full { background: #fdebd0; border-color: #d35400; }

.item {
  width: 24px; height: 24px; background: #3498db; border-radius: 50%;
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.3), 0 2px 2px rgba(0,0,0,0.2);
  cursor: pointer; transition: transform 0.1s;
}
.item:hover { transform: scale(1.1); }
.item-slot { width: 24px; height: 24px; background: rgba(255,255,255,0.6); border-radius: 50%; }

/* Detective Board */
.detective-board { padding: 20px; }
.question-card { background: var(--card); border-radius: 12px; padding: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.question-card h2 { margin-top: 0; color: var(--primary); font-size: 20px; border-bottom: 2px solid #ecf0f1; padding-bottom: 8px; }
.question-text { font-size: 22px; font-weight: bold; line-height: 1.8; margin-bottom: 15px; }
rt { font-size: 12px; color: #777; }

.suspect-answer { background: #fff3e0; border: 3px solid #ffb74d; padding: 15px; border-radius: 8px; font-size: 24px; font-weight: bold; text-align: center; margin-bottom: 20px; }
.suspect-answer .label { color: #e65100; font-size: 18px; display: block; margin-bottom: 5px;}

.judgment-area { text-align: center; margin-bottom: 20px; }
.judgment-area p { font-size: 18px; font-weight: bold; margin-bottom: 10px; }
.action-buttons { display: flex; gap: 15px; justify-content: center; }

.btn-judge { flex: 1; max-width: 200px; padding: 15px; font-size: 20px; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; transition: 0.1s; color: white; }
.btn-judge:active { transform: translateY(4px); }
.btn-circle { background: #27ae60; box-shadow: 0 4px 0 #1e8449; }
.btn-cross { background: #e74c3c; box-shadow: 0 4px 0 #c0392b; }

.correction-area { background: #e8f6f3; padding: 20px; border-radius: 12px; text-align: center; margin-bottom: 20px; animation: fadeIn 0.4s; border: 2px dashed #1abc9c;}
.correction-prompt { font-weight: bold; font-size: 18px; color: #16a085; margin-top: 0; }

.answer-box { font-size: 24px; font-weight: bold; margin-bottom: 15px; }
input[type="text"] {
  width: 60px; height: 44px; font-size: 24px; text-align: center; font-weight: bold;
  border: 3px solid #bdc3c7; border-radius: 8px; outline: none; transition: 0.2s; font-family: inherit;
}
input[type="text"]:focus { border-color: var(--accent); background: #ebf5fb; }

.btn-primary, .btn-next { width: 100%; background: var(--accent); color: white; border: none; padding: 16px; font-size: 20px; font-weight: bold; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 0 #2980b9; transition: 0.1s; }
.btn-primary:active, .btn-next:active { transform: translateY(4px); box-shadow: 0 0 0 #2980b9; }
.btn-next { background: #f39c12; box-shadow: 0 4px 0 #d68910; animation: pop 0.4s; }

.msg { margin-top: 15px; padding: 15px; border-radius: 8px; font-weight: bold; font-size: 18px; line-height: 1.5; white-space: pre-wrap; animation: fadeIn 0.3s; }
.msg.error { background: #fdedec; color: #c0392b; border-left: 6px solid #e74c3c; }
.msg.warning { background: #fef9e7; color: #d68910; border-left: 6px solid #f1c40f; }
.msg.success { background: #eaeded; color: #2c3e50; border-left: 6px solid #34495e; }

/* Clear Screen */
.clear-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.95); display: flex; justify-content: center; align-items: center; text-align: center; z-index: 100; animation: fadeIn 1s; }
.clear-content { padding: 40px; }
.crown { font-size: 80px; animation: pop 1s infinite alternate; }
.clear-content h2 { color: #e67e22; font-size: 36px; margin: 10px 0; }
.clear-content p { font-size: 20px; font-weight: bold; color: #333; line-height: 1.6; }

.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(0.9); } 100% { transform: scale(1); } }