/* ボクセルキャンパス 電気回路ラボ 総合ポータル — 小学生・中学生に読みやすいUD丸ゴシックスタイル */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 17px; color: #1e293b; background: #f0f6fc; line-height: 1.88;
}
button, input, select { font-family: inherit; }
ruby { ruby-align: center; }
ruby rt { font-size: 0.56em; font-weight: 800; color: inherit; opacity: 0.9; line-height: 1.1; }
a { color: inherit; }

/* ヘッダーヒーロー */
.hero {
  background: linear-gradient(135deg, #091e3a 0%, #0e4175 55%, #0284c7 100%);
  color: #fff; padding: 30px 22px 34px;
  border-bottom: 4px solid #f59e0b;
}
.container { max-width: 1180px; margin: 0 auto; }
.hero-top {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.55; font-weight: 900; letter-spacing: .02em; }
.hero-lead { margin: 0; color: #f0f9ff; font-size: 17.5px; line-height: 1.95; max-width: 740px; font-weight: 700; }

.hero-cta-box {
  background: rgba(15, 23, 42, 0.60); border: 2px solid rgba(250, 204, 21, 0.88);
  border-radius: 16px; padding: 18px 22px; text-align: center; min-width: 295px;
}
.btn-hero-start {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 6px 24px; border-radius: 28px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  border: 2px solid #fde68a; color: #fff; text-decoration: none;
  font-size: 18.5px; line-height: 1.4; font-weight: 900; box-shadow: 0 6px 18px rgba(217, 119, 6, 0.45);
  transition: transform .12s, box-shadow .12s;
}
.btn-hero-start:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(217, 119, 6, 0.65); }
.hero-cta-sub { font-size: 15px; line-height: 1.75; color: #fde68a; margin-top: 9px; font-weight: 800; }

/* 3ステップの学び方フローカード */
.flow-3steps {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 10px;
  margin-top: 22px;
}
.flow-step-card {
  background: rgba(15, 23, 42, 0.48); border: 2px solid rgba(186, 230, 253, 0.55);
  border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 5px;
}
.flow-step-num {
  align-self: flex-start; padding: 2px 10px; border-radius: 999px;
  background: #f59e0b; color: #1e1b4b; font-size: 12px; font-weight: 900; line-height: 1.4;
}
.flow-step-title { font-size: 18px; font-weight: 900; color: #fef08a; line-height: 1.65; }
.flow-step-card p { margin: 0; font-size: 15.5px; line-height: 1.88; color: #f0f9ff; font-weight: 700; }
.flow-step-arrow {
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: #fde047;
}

/* 統計カード */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  margin-top: 18px;
}
.stat-card {
  background: rgba(255, 255, 255, 0.14); border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 14px;
}
.stat-icon { font-size: 32px; line-height: 1; }
.stat-val { font-size: 22px; font-weight: 900; color: #fef08a; line-height: 1.4; }
.stat-lbl { font-size: 15px; line-height: 1.75; color: #e0f2fe; font-weight: 800; }

/* メインセクション */
.main-wrap { padding: 30px 22px 64px; }
.sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 32px 0 16px; padding-bottom: 10px; border-bottom: 2px solid #cbd5e1;
}
.sec-head:first-child { margin-top: 0; }
.sec-head h2 { margin: 0; font-size: 23px; line-height: 1.65; font-weight: 900; color: #0f294a; display: flex; align-items: center; gap: 8px; }
.sec-sub { font-size: 16px; line-height: 1.88; color: #334155; font-weight: 700; }

/* 12ステップカードグリッド */
.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px;
}
.step-card {
  background: #fff; border: 2px solid #cbd5e1; border-radius: 14px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
  transition: transform .12s, border-color .12s;
}
.step-card:hover { transform: translateY(-2px); border-color: #38bdf8; }
.step-card.is-done { border-color: #4ade80; background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%); }
.step-card.is-current { border-color: #f59e0b; box-shadow: 0 4px 16px rgba(245, 158, 11, 0.22); }
.step-card.is-locked { opacity: 0.66; background: #f1f5f9; border-style: dashed; border-color: #94a3b8; }
.step-card.is-locked:hover { transform: none; border-color: #94a3b8; }
.step-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.step-num-badge {
  padding: 3px 11px; border-radius: 14px; font-size: 14px; font-weight: 900;
  background: #0f294a; color: #fff;
}
.step-card.is-done .step-num-badge { background: #16a34a; }
.step-card.is-current .step-num-badge { background: #d97706; }
.step-card.is-locked .step-num-badge { background: #64748b; }
.step-stars { font-size: 18px; letter-spacing: 1px; color: #f59e0b; font-weight: 900; }
.step-title { margin: 0; font-size: 19px; font-weight: 900; color: #0f172a; line-height: 1.78; }
.step-meta {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 15.5px; line-height: 1.88; color: #334155; background: #f8fafc;
  padding: 10px 12px; border-radius: 9px; border: 1.5px solid #e2e8f0;
}
.step-flow-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.sf-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 5px 11px 4px; border-radius: 999px;
  background: #e2e8f0; color: #475569; font-size: 13px; font-weight: 800; line-height: 1.78;
}
.sf-tag.ok {
  background: #dcfce7; color: #15803d; border: 1px solid #86efac; font-weight: 900;
}
.step-play-link {
  margin-top: auto; display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 6px 14px; border-radius: 10px; text-decoration: none;
  background: #0284c7; color: #fff; font-size: 16px; line-height: 1.72; font-weight: 900; text-align: center;
}
.step-play-link:hover { background: #0369a1; }
.step-card.is-done .step-play-link { background: #15803d; }
.step-locked-btn {
  margin-top: auto; display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 6px 14px; border-radius: 10px;
  background: #cbd5e1; color: #475569; font-size: 15px; line-height: 1.72; font-weight: 900;
}
.btn-portal-debug {
  min-height: 42px; height: auto; padding: 6px 16px; border-radius: 8px;
  border: 2px solid #94a3b8; background: #1e293b; color: #e2e8f0;
  font-size: 14.5px; line-height: 1.45; font-weight: 900; cursor: pointer;
}
.btn-portal-debug.on { background: #9333ea; color: #ffffff; border-color: #eab308; }

/* 12大秘宝バッジ図鑑 */
.badges-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 12px;
}
.badge-item {
  background: #fff; border: 2px solid #cbd5e1; border-radius: 12px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
}
.badge-item.locked { opacity: 0.62; background: #f1f5f9; border-style: dashed; }
.badge-item.unlocked { border-color: #f59e0b; background: #fffbeb; }
.badge-icon-box {
  width: 48px; height: 48px; border-radius: 10px; background: #1e293b;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #94a3b8; font-size: 22px; font-weight: 900;
}
.badge-icon-box img { width: 40px; height: 40px; }
.badge-info-step { font-size: 13px; font-weight: 800; color: #64748b; line-height: 1.6; }
.badge-info-name { font-size: 15px; font-weight: 900; color: #0f172a; line-height: 1.82; }

/* 体系カリキュラムマップ */
.terms-accordion { display: flex; flex-direction: column; gap: 14px; }
.term-box {
  background: #fff; border: 2px solid #cbd5e1; border-radius: 14px; overflow: hidden;
}
.term-box.active-term { border-color: #0284c7; }
.term-summary {
  padding: 15px 18px; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #f8fafc; font-size: 17px; font-weight: 900; line-height: 1.78;
}
.term-summary::-webkit-details-marker { display: none; }
.term-box[open] .term-summary { background: #eff6ff; border-bottom: 1.5px solid #bfdbfe; }
.term-head-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.term-grade-pill {
  padding: 5px 12px 4px; border-radius: 14px; font-size: 13.5px; line-height: 1.78; font-weight: 900;
  background: #dbeafe; color: #1e40af;
}
.term-grade-pill.y2 { background: #fef3c7; color: #92400e; }
.term-status-pill {
  padding: 5px 12px 4px; border-radius: 14px; font-size: 13.5px; line-height: 1.78; font-weight: 900;
  background: #e2e8f0; color: #334155;
}
.term-status-pill.ready { background: #dcfce7; color: #166534; border: 1.5px solid #86efac; }

.term-table-wrap { overflow-x: auto; padding: 12px 16px 16px; }
.cur-table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.cur-table th, .cur-table td {
  padding: 10px 11px; border-bottom: 1px solid #e2e8f0; text-align: left; line-height: 1.85;
}
.cur-table th { background: #f1f5f9; color: #1e293b; font-weight: 900; font-size: 14.5px; }
.tag-concept {
  display: inline-block; padding: 5px 11px 4px; border-radius: 12px;
  background: #e0f2fe; color: #0369a1; font-size: 13.5px; line-height: 1.78; font-weight: 900;
}

/* バックアップ・リセットカード */
.backup-card {
  margin-top: 32px; background: #fff; border: 2px solid #cbd5e1; border-radius: 14px;
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.backup-desc { font-size: 15.5px; color: #475569; margin-top: 4px; font-weight: 600; }
.backup-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-tool {
  min-height: 42px; height: auto; padding: 6px 16px; border-radius: 8px; border: 1.5px solid #94a3b8;
  background: #f8fafc; color: #1e293b; font-size: 15px; line-height: 1.45; font-weight: 900; cursor: pointer;
}
.btn-tool:hover { background: #e0f2fe; border-color: #38bdf8; }
#backupMsg { font-size: 15px; font-weight: 900; color: #15803d; }

.reset-portal-card { background: #fffbeb; border-color: #fcd34d; }
.btn-portal-area-reset {
  min-height: 42px; height: auto; padding: 6px 14px; border-radius: 8px; border: 1.5px solid #d97706;
  background: #ffffff; color: #92400e; font-size: 14.5px; line-height: 1.45; font-weight: 900; cursor: pointer;
}
.btn-portal-area-reset:hover { background: #fef3c7; }
.btn-portal-all-reset {
  min-height: 42px; height: auto; padding: 6px 16px; border-radius: 8px; border: 2px solid #9f1239;
  background: #e11d48; color: #ffffff; font-size: 15px; line-height: 1.45; font-weight: 900; cursor: pointer;
}
.btn-portal-all-reset:hover { background: #be123c; }
.portal-reset-msg { font-size: 15px; font-weight: 900; color: #b91c1c; align-self: center; }

@media (max-width: 860px) {
  .flow-3steps { grid-template-columns: 1fr; gap: 8px; }
  .flow-step-arrow { transform: rotate(90deg); height: 18px; }
}
@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
