:root {
  --primary: #2e7d32;
  --secondary: #81c784;
  --bg: #f1f8e9;
  --white: #ffffff;
  --accent: #ff7043;
}

body {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  background-color: var(--bg);
  margin: 0;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 800px;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary);
}

.problem-card {
  background: var(--white);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  margin-bottom: 30px;
  position: relative;
  border: 2px solid var(--secondary);
}

.hidden { display: none; }

.badge {
  position: absolute;
  top: -15px;
  left: 20px;
  background: var(--primary);
  color: white;
  padding: 5px 15px;
  border-radius: 10px;
  font-weight: bold;
}

.badge.practice { background: var(--accent); }
.badge.summary { background: #1976d2; }

/* ひっ算グリッドのデザイン */
.hissan-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.hissan-grid {
  display: grid;
  grid-template-columns: repeat(5, 45px);
  gap: 2px;
  background-color: #e0e0e0;
  padding: 10px;
  border-radius: 5px;
  position: relative;
}

.cell {
  width: 45px;
  height: 45px;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
}

.cell.empty { background: transparent; }
.cell.symbol { background: transparent; }
.cell.dot { background: transparent; font-size: 30px; }
.cell.ghost { color: #ccc; }

.cell input {
  width: 100%;
  height: 100%;
  border: none;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  background: #fff9c4;
}

.hissan-line {
  grid-column: 1 / span 5;
  height: 3px;
  background: black;
  margin: 5px 0;
}

/* ボタンとヒント */
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

button {
  padding: 12px 25px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: 0.3s;
}

.btn-check { background: var(--primary); color: white; }
.btn-check:hover { background: #1b5e20; }
.btn-hint { background: #fff176; color: #333; }

.hint-box {
  margin-top: 15px;
  padding: 15px;
  background: #e3f2fd;
  border-left: 5px solid #2196f3;
  border-radius: 5px;
}

/* 練習問題 */
#practice-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.practice-item {
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.practice-item input {
  padding: 8px;
  font-size: 18px;
  text-align: center;
  border: 2px solid var(--secondary);
  border-radius: 5px;
}

.correct-anim {
  animation: success-bounce 0.5s ease;
  background: #c8e6c9 !important;
}

@keyframes success-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}