*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Hiragino Kaku Gothic ProN', sans-serif; background: #f0f6ff; color: #1e293b; display: flex; justify-content: center; min-height: 100vh; padding: 20px; }
.screen { display: none; width: 100%; max-width: 600px; flex-direction: column; align-items: center; }
.screen.active { display: flex; }

.menu-title { font-size: 2rem; margin-bottom: 0.5rem; }
.menu-subtitle { color: #64748b; margin-bottom: 2rem; }

.menu-btn {
  display: flex; align-items: center; gap: 1rem; width: 100%; padding: 1.2rem; margin-bottom: 1rem;
  background: white; border: 2px solid #e2e8f0; border-radius: 12px; cursor: pointer; text-decoration: none; color: inherit;
  transition: transform 0.1s, box-shadow 0.1s; text-align: left;
}
.menu-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: #3b82f6; }
.btn-icon { font-size: 2rem; }
.btn-desc { display: flex; flex-direction: column; font-weight: bold; font-size: 1.1rem; }
.btn-desc small { font-size: 0.8rem; color: #64748b; font-weight: normal; margin-top: 4px; }

.menu-link { margin-top: 1rem; color: #3b82f6; text-decoration: none; font-weight: bold; }

.quiz-header { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.back-btn { background: none; border: none; font-size: 1rem; color: #64748b; cursor: pointer; font-weight: bold; }
.quiz-title { font-weight: bold; font-size: 1.2rem; }
.progress { font-weight: bold; color: #3b82f6; font-size: 1.2rem; }

.quiz-body { width: 100%; background: white; padding: 2rem; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.question-text { font-size: 1.2rem; line-height: 1.5; margin-bottom: 1.5rem; font-weight: bold; }

.answer-input { width: 100%; padding: 1rem; font-size: 1.2rem; border: 2px solid #cbd5e1; border-radius: 8px; margin-bottom: 1rem; outline: none; transition: border-color 0.2s, background 0.2s; }
.answer-input:focus { border-color: #3b82f6; }
.answer-input.ok { border-color: #16a34a; background: #f0fdf4; color: #166534; }
.answer-input.ng { border-color: #dc2626; background: #fef2f2; color: #991b1b; }
.answer-input:disabled { cursor: not-allowed; }

.action-btn { width: 100%; padding: 1rem; font-size: 1.1rem; font-weight: bold; border-radius: 8px; border: none; cursor: pointer; margin-top: 1rem; transition: background 0.2s; }
.action-btn.primary { background: #3b82f6; color: white; }
.action-btn.primary:hover:not(:disabled) { background: #2563eb; }
.action-btn.primary:disabled { background: #cbd5e1; cursor: not-allowed; }
.action-btn.secondary { background: #f1f5f9; color: #475569; }

.feedback { margin-top: 1rem; font-size: 1rem; min-height: 1.5rem; }
.feedback.correct { color: #16a34a; }
.feedback.incorrect { color: #dc2626; }

.tip-verdict { display: block; font-weight: bold; font-size: 1.1rem; text-align: center; margin-bottom: 0.6rem; }
.tip-verdict.correct { color: #16a34a; }
.tip-verdict.incorrect { color: #dc2626; }

.tip-block { margin-top: 0.5rem; background: #f8fafc; border-left: 3px solid #3b82f6; border-radius: 6px; padding: 0.7rem 0.9rem; text-align: left; }
.tip-text { font-size: 0.85rem; color: #334155; font-weight: normal; line-height: 1.6; margin-bottom: 0.3rem; }
.tip-ref { font-size: 0.78rem; color: #64748b; font-weight: normal; margin-top: 0.2rem; }

/* Visual Quiz CSS */
.map-area { position: relative; width: 100%; height: 350px; border: 2px solid #bce0fd; border-radius: 8px; margin-bottom: 20px; overflow: hidden; }
.map-japan { background-image: url('../img/japan_map.svg'); background-size: 70%; background-position: 60% 30%; background-repeat: no-repeat; background-color: #d1f2fb; }
.map-world { background-image: url('../img/world_map.svg'); background-size: 110%; background-position: center 20%; background-repeat: no-repeat; background-color: #d1f2fb; }
.map-europe { background-image: url('../img/world_map.svg'); background-size: 160%; background-position: 75% 30%; background-repeat: no-repeat; background-color: #d1f2fb; }
/* 風クイズ用：100%表示で左端(大西洋)〜右端(日本)を一画面に収める */
.map-world-jp { background-image: url('../img/world_map.svg'); background-size: 100%; background-position: center 20%; background-repeat: no-repeat; background-color: #d1f2fb; }

.drop-zone { position: absolute; border: 2px dashed #64748b; background-color: rgba(255,255,255,0.6); font-size: 10px; text-align: center; font-weight: bold; color: transparent; border-radius: 4px; display: flex; justify-content: center; align-items: center; transition: all 0.2s; padding: 2px; box-shadow: inset 0 0 5px rgba(0,0,0,0.1); }
.drop-zone.drag-over { border-color: #3b82f6; background-color: rgba(59,130,246,0.2); }
.drop-zone.correct { border-color: #2ecc71; background-color: #d5f5e3; border-style: solid; }
.drop-zone.incorrect { border-color: #e74c3c; background-color: #fadbd8; border-style: solid; }

/* 矢印形ドロップゾーン: clip-pathで右向き矢印。rotateで方向を表す */
/* clip-pathがborderを切り取るため、drop-shadowでアウトラインを代替 */
.zone-arrow { border-radius: 0; clip-path: polygon(0% 25%, 70% 25%, 70% 0%, 100% 50%, 70% 100%, 70% 75%, 0% 75%); filter: drop-shadow(0 0 2px rgba(50,50,50,0.8)); }
.zone-arrow.drag-over { filter: drop-shadow(0 0 3px #3b82f6); }
.zone-arrow.correct   { filter: drop-shadow(0 0 3px #2ecc71); }
.zone-arrow.incorrect { filter: drop-shadow(0 0 3px #e74c3c); }

/* Plates Zone absolute positions — % widths/heights so zones scale with container width */
#zone-eurasia { top: 30%; left: 10%; width: 20%; height: 11%; }
#zone-pacific { top: 50%; left: 75%; width: 20%; height: 11%; }
#zone-philippine { top: 75%; left: 45%; width: 22%; height: 11%; }
#zone-northamerica { top: 10%; left: 75%; width: 20%; height: 11%; }
#zone-japan-trench { top: 35%; left: 68%; width: 6%; height: 20%; writing-mode: vertical-rl; }
#zone-nankai { top: 65%; left: 35%; width: 15%; height: 9%; transform: rotate(-30deg); }

/* Boundaries CSS */
.boundaries-graphics { display: flex; flex-direction: column; gap: 20px; width: 100%; align-items: center; margin-bottom: 20px; }
.boundary-item { display: flex; gap: 20px; align-items: center; width: 100%; max-width: 400px; justify-content: space-between; background: #f8fafc; padding: 15px; border-radius: 8px; border: 1px solid #cbd5e1; }
.boundary-diagram { font-size: 1.2rem; font-weight: bold; background: #e2e8f0; padding: 10px; border-radius: 8px; }
.boundary-item .drop-zone { position: relative; top: 0; left: 0; width: 150px; height: 40px; transform: none; }

.labels-container { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.draggable-label { background-color: #1e293b; color: white; padding: 6px 12px; border-radius: 12px; cursor: grab; font-size: 12px; font-weight: bold; user-select: none; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.draggable-label:active { cursor: grabbing; }

/* Latitude Compare Quiz */
.lat-compare-grid { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-bottom: 16px; }
.lat-compare-cities { display: flex; gap: 4px; justify-content: space-between; }
.lat-city-col { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 4px; }
.lat-city-name { font-size: 11px; font-weight: bold; text-align: center; background: #e2e8f0; border-radius: 6px; padding: 5px 3px; line-height: 1.4; width: 100%; }
.lat-city-sub { font-size: 9px; font-weight: normal; color: #64748b; display: block; }
.lat-zone { position: relative; top: 0; left: 0; width: 100%; height: 44px; transform: none; }
.lat-axis-label { font-size: 11px; color: #94a3b8; text-align: center; }
.lat-label { display: flex; flex-direction: column; align-items: center; padding: 5px 8px; }
.lat-label-main { font-size: 11px; font-weight: bold; line-height: 1.3; }
.lat-label-sub { font-size: 9px; font-weight: normal; opacity: 0.8; line-height: 1.2; }

.result-title { font-size: 2rem; margin-bottom: 1rem; }
.result-score { font-size: 3rem; font-weight: bold; color: #3b82f6; margin-bottom: 2rem; }
