:root {
  --main-green: #2d8c66;
  --accent-orange: #ff7043;
  --bg-cream: #fffdf0;
  --border-gray: #cfd8dc;
}

body {
  font-family: 'Zen Maru Gothic', sans-serif;
  background-color: #e0f2f1;
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.school-app {
  width: 100%;
  max-width: 1100px;
  background: white;
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

header {
  text-align: center;
  border-bottom: 3px solid var(--main-green);
  margin-bottom: 30px;
  padding-bottom: 10px;
}

h1 { color: var(--main-green); margin: 0; font-size: 2rem; }
.guide { color: #546e7a; font-weight: bold; margin-top: 10px; }

.main-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

h2 {
  font-size: 1.4rem;
  color: #37474f;
  border-left: 8px solid var(--accent-orange);
  padding-left: 15px;
  margin-bottom: 20px;
}

/* カテゴリカード */
.cat-card {
  background: var(--bg-cream);
  border: 2px solid var(--border-gray);
  border-radius: 16px;
  padding: 15px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cat-name { font-size: 1.2rem; font-weight: bold; color: #333; }

.btn-group {
  display: flex;
  gap: 10px;
}

.add-btn, .sub-btn {
  color: white;
  border: none;
  border-radius: 12px;
  padding: 8px 15px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: 0.1s;
}

.add-btn { background: var(--accent-orange); box-shadow: 0 4px 0 #d84315; }
.add-btn:active { transform: translateY(4px); box-shadow: none; }

.sub-btn { background: #90a4ae; box-shadow: 0 4px 0 #607d8b; }
.sub-btn:active { transform: translateY(4px); box-shadow: none; }

/* 正の字表示エリア */
.sei-area {
  min-height: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  background: white;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #eee;
}

.sei-box { width: 50px; height: 50px; }

.sei-stroke {
  stroke: #eceff1;
  stroke-width: 8;
  stroke-linecap: round;
  fill: none;
}

.sei-stroke.active {
  stroke: #263238; /* 書き込まれた線の色 */
}

/* テーブルスタイル */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 1.2rem;
}

th, td {
  border: 1px solid var(--border-gray);
  padding: 15px;
  text-align: center;
}

th { background: #f5f5f5; color: var(--main-green); }
.total-row { background: #fff3e0; font-weight: bold; }
.count-cell { font-weight: bold; color: var(--accent-orange); font-size: 1.4rem; }

/* 分析エリア */
.poster-analysis {
  margin-top: 30px;
  padding: 20px;
  background: #e3f2fd;
  border-radius: 16px;
}
.poster-analysis h3 { margin-top: 0; color: #1565c0; }

.hint-box {
  margin-top: 15px;
  padding: 15px;
  background: white;
  border-radius: 10px;
  border: 2px solid var(--main-green);
  animation: fadeIn 0.5s;
}

@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }

.footer-actions { text-align: center; margin-top: 30px; }
.reset-btn {
  padding: 12px 24px;
  background: #78909c;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
}