:root {
  --primary: #00838f;
  --secondary: #e0f7fa;
  --accent: #ff7043;
  --correct: #4caf50;
  --error: #f44336;
  --text: #333;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  background-color: #f4f6f8;
  color: var(--text);
  margin: 0;
  padding: 20px;
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
}

header {
  text-align: center;
  background: var(--primary);
  color: white;
  padding: 20px;
  border-radius: 12px 12px 0 0;
}

h1 { margin: 0 0 10px 0; font-size: 1.8rem; }
h2 { color: var(--primary); border-bottom: 2px solid var(--secondary); padding-bottom: 5px; margin-top: 5px;}
h3 { font-size: 1.1rem; color: #555; border-left: 4px solid var(--accent); padding-left: 10px; }

.mission-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  margin-bottom: 30px;
  position: relative;
  border-top: 4px solid transparent;
}

.badge {
  position: absolute;
  top: -15px;
  left: 20px;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: bold;
}
.badge.apply { background: #e91e63; }
.badge.review { background: #ff9800; }
.badge.eye { background: #2196f3; }

/* 入力欄 */
input[type="text"], select {
  padding: 8px;
  font-size: 1.1rem;
  border: 2px solid #ccc;
  border-radius: 6px;
  text-align: center;
  width: 80px;
  transition: border-color 0.3s;
}
input[type="text"].short { width: 40px; }
input[type="text"]:focus, select:focus { outline: none; border-color: var(--primary); background: var(--secondary); }
input.correct, select.correct { border-color: var(--correct); background: #e8f5e9; }
input.wrong, select.wrong { border-color: var(--error); background: #ffebee; }

/* テーブル */
.bike-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}
.bike-table th, .bike-table td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: center;
}
.bike-table th { background: #f0f4c3; color: #33691e; }
.bike-table td:nth-child(even) { background: #fafafa; }
.empty-cell { background: #eee !important; }

/* ラジオボタン */
.choices { display: flex; gap: 20px; margin-top: 10px; }
.choices label { cursor: pointer; font-size: 1.1rem; padding: 10px; border: 2px solid #ddd; border-radius: 8px; }
.choices label:hover { background: var(--secondary); }

/* 数直線 */
.number-line-container {
  margin: 40px 0;
  position: relative;
}
.labels {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 1.2rem;
  padding: 0 5px;
  margin-bottom: 5px;
}
.number-line {
  position: relative;
  height: 30px;
  border-bottom: 3px solid #333;
  display: flex;
}
.tick {
  flex: 1;
  border-right: 1px solid #999;
  height: 10px;
  margin-top: 20px;
}
.tick.mid { height: 18px; margin-top: 12px; }
.tick.major { height: 25px; margin-top: 5px; border-right: 2px solid #333; }
.tick:last-child { border-right: none; }

.nl-inputs {
  position: relative;
  height: 60px;
  margin-top: 10px;
}
.nl-input-group {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  font-weight: bold;
}
.nl-input-group::before {
  content: '↑';
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 5px;
}
.nl-input-group input { width: 60px; padding: 4px; font-size: 1rem; }

/* 位取り表 */
.place-value-chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: #bbb;
  border: 2px solid #bbb;
  margin: 20px 0;
}
.pv-header { background: #bbdefb; padding: 10px; text-align: center; font-weight: bold; }
.pv-cell { background: white; padding: 10px; text-align: center; font-size: 1.5rem; font-weight: bold; display: flex; align-items: center; justify-content: center;}
.pv-cell.empty { background: #f9f9f9; }
.pv-input { width: 50px !important; font-size: 1.5rem !important; }

/* ボタンとヒント */
.btn-check {
  display: block;
  width: 200px;
  margin: 20px auto 0;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.btn-check:hover { opacity: 0.9; }
.btn-check:active { transform: scale(0.95); }

.result-msg { text-align: center; font-weight: bold; font-size: 1.2rem; margin-top: 15px; height: 24px; }

details { margin-bottom: 20px; }
summary { cursor: pointer; color: #f57f17; font-weight: bold; padding: 10px; background: #fffde7; border-radius: 5px; }
.hint-content { padding: 15px; background: #fffde7; border-left: 4px solid #fbc02d; margin-top: 5px; }