/* ============================================================
   Minecraftプログラミング 共通CSS
   全レッスンHTMLが <link rel="stylesheet" href="mc.css"> で参照する
   ============================================================ */

/* ======== 全体 ======== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans", "Yu Gothic", sans-serif;
  background-color: #eaf3e0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(0,0,0,0.03) 31px, rgba(0,0,0,0.03) 32px),
    repeating-linear-gradient(90deg, transparent 0, transparent 31px, rgba(0,0,0,0.03) 31px, rgba(0,0,0,0.03) 32px);
  color: #222;
  line-height: 1.7;
  font-size: 17px;
}
ruby rt { font-size: 0.55em; }
.pixel-font {
  font-family: "DotGothic16", "Helvetica Neue", sans-serif;
  letter-spacing: 0.04em;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  background: #fff36a;
  color: #222;
  border: 3px solid #222;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: bold;
  text-decoration: none;
  transform: translateY(-140%);
  transition: transform 0.12s ease;
}
.skip-link:focus {
  transform: translateY(0);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid #fff36a;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(34,34,34,0.35);
}
button, summary, .lesson-check {
  touch-action: manipulation;
}

/* ======== ヘッダー ======== */
header {
  background: #fff;
  border-bottom: 3px solid #1abc9c;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #222;
}
.logo-img { height: 40px; }
.logo-text {
  font-weight: bold;
  font-size: 1.05rem;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.logo-text-sub { font-size: 0.7rem; color: #666; }
.back-to-overview {
  background: #1abc9c;
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: bold;
  white-space: nowrap;
}

/* ======== レイアウト ======== */
main {
  max-width: 800px;
  margin: 24px auto;
  padding: 0 16px;
}

/* ======== レッスン記事 ======== */
.lesson {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
}
.lesson-header {
  background: linear-gradient(180deg, #76C95B 0%, #58A92F 100%);
  margin: -28px -24px 24px;
  padding: 22px 24px 18px;
  border-radius: 12px 12px 0 0;
  position: relative;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.18);
}
/* 草ブロックの下の土レイヤー */
.lesson-header::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 10px;
  background:
    repeating-linear-gradient(90deg,
      #8B5A2B 0, #8B5A2B 10px,
      #6B3F18 10px, #6B3F18 20px,
      #8B5A2B 20px, #8B5A2B 30px,
      #7A4A20 30px, #7A4A20 40px);
}
.lesson-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}
.tag-num { background: #C13B33; }
.tag-lv { background: #2C5DA0; }
.tag-time { background: #444; }
.lesson-header h1 {
  margin: 6px 0 0;
  font-size: 1.8rem;
  line-height: 1.4;
  font-family: "DotGothic16", "Helvetica Neue", sans-serif;
  letter-spacing: 0.03em;
}

.lesson section { margin: 28px 0; }
.lesson h2 {
  font-size: 1.2rem;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lesson h2::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background: #1abc9c;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 5px #1abc9c;
  flex-shrink: 0;
}
.lesson ol, .lesson ul { padding-left: 1.4em; }
.lesson li { margin: 6px 0; }

/* 完成画面プレースホルダ */
.screenshot-placeholder {
  background: #f0f0f0;
  border: 2px dashed #bbb;
  color: #888;
  text-align: center;
  padding: 40px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.screenshot-placeholder.has-preview {
  background: #dcefd5;
  border: 3px solid #6fa85c;
  color: #23443f;
  padding: 18px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.35);
}
.mc-preview {
  display: grid;
  gap: 10px;
  justify-items: center;
}
.mc-preview-scene {
  display: grid;
  gap: 3px;
  width: min(100%, 380px);
  padding: 16px;
  background: #9ed37f;
  border: 4px solid #6b8f4e;
  border-radius: 8px;
  box-shadow: 0 4px 0 #4f6f35;
}
.mc-preview-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
}
.mc-preview-cell {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 2px;
  background: rgba(255,255,255,0.22);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12);
  display: grid;
  place-items: center;
  color: #233;
  font-size: 0.62rem;
  font-weight: bold;
  line-height: 1;
}
.mc-preview-cell-air { background: rgba(255,255,255,0.18); box-shadow: none; }
.mc-preview-cell-grass { background: #58A92F; }
.mc-preview-cell-panel { background: #e9f0f8; }
.mc-preview-cell-workspace { background: #fff; }
.mc-preview-cell-block-blue { background: #4A6CD4; }
.mc-preview-cell-stone, .mc-preview-cell-block, .mc-preview-cell-wall { background: #9ca3a8; }
.mc-preview-cell-player { background: #2C5DA0; border-radius: 50%; }
.mc-preview-cell-chat { background: #fff; color: #23449d; }
.mc-preview-cell-mob { background: #f4d35e; border-radius: 50%; }
.mc-preview-cell-road { background: #8B5A2B; }
.mc-preview-cell-floor { background: #c7b299; }
.mc-preview-cell-roof { background: #c13b33; }
.mc-preview-cell-door { background: #6b3f18; }
.mc-preview-cell-torch { background: #ffe066; border-radius: 50%; box-shadow: 0 0 10px rgba(255,224,102,0.8); }
.mc-preview-cell-lava { background: #e74c3c; box-shadow: 0 0 8px rgba(231,76,60,0.6); }
.mc-preview-cell-stair { background: #b98b5f; }
.mc-preview-cell-sand { background: #e8d28a; }
.mc-preview-cell-pattern-a { background: #58A92F; }
.mc-preview-cell-coin { background: #f4c430; border-radius: 50%; }
.mc-preview-cell-text {
  aspect-ratio: auto;
  min-height: 18px;
  background: #222;
  color: #fff;
  box-shadow: none;
}
.mc-preview-caption {
  margin: 0;
  color: #23443f;
  font-weight: bold;
  line-height: 1.5;
}

/* ======== MakeCode ブロック表現 ======== */
.mc-program {
  background: #fafaf8;
  border: 3px solid #555;
  border-radius: 10px;
  padding: 36px 20px 24px;
  position: relative;
  box-shadow: 0 4px 0 #333;
}
.mc-program::before {
  content: "💻 プログラム";
  position: absolute;
  top: -14px;
  left: 16px;
  background: #2C5DA0;
  color: #fff;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  font-family: "DotGothic16", sans-serif;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 0 #1a3d6e;
}
.mc-program-title {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 14px;
  font-weight: normal;
}

/* カテゴリ色（MakeCode for Minecraft 準拠の近似色） */
.mc-cat-player   { --mc-bg: #4A6CD4; --mc-shadow: #2C4A9E; }
.mc-cat-blocks   { --mc-bg: #58A92F; --mc-shadow: #3D7A1F; }
.mc-cat-mobs     { --mc-bg: #C2185B; --mc-shadow: #8E0E40; }
.mc-cat-agent    { --mc-bg: #E67E22; --mc-shadow: #B85F12; }
.mc-cat-loops    { --mc-bg: #E8A92E; --mc-shadow: #B5821C; }
.mc-cat-logic    { --mc-bg: #00B8B8; --mc-shadow: #008888; }
.mc-cat-vars     { --mc-bg: #C0392B; --mc-shadow: #8E2A20; }
.mc-cat-pos      { --mc-bg: #5D6D7E; --mc-shadow: #3F4D5C; }
.mc-cat-gameplay { --mc-bg: #76C95B; --mc-shadow: #4F9837; }

/* 共通ブロック */
.mc-block {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  background: var(--mc-bg);
  color: #fff;
  font-weight: bold;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--mc-shadow), inset 0 1px 0 rgba(255,255,255,0.18);
  position: relative;
  max-width: 100%;
}
.mc-block .mc-icon {
  font-size: 1.1em;
  line-height: 1;
}

/* イベントブロック（ハット型）：上が丸い */
.mc-event {
  display: inline-block;
  margin: 0;
  max-width: 100%;
}
.mc-event-head {
  background: var(--mc-bg);
  color: #fff;
  font-weight: bold;
  font-size: 0.95rem;
  padding: 12px 18px;
  border-radius: 18px 18px 4px 4px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  max-width: 100%;
}
.mc-event-body {
  background: var(--mc-bg);
  padding: 4px 6px 14px 16px;
  border-radius: 0 0 16px 4px;
  margin-top: -2px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  box-shadow: 0 2px 0 var(--mc-shadow);
  max-width: 100%;
}
.mc-event-body .mc-block {
  box-shadow: 0 1px 0 var(--mc-shadow), inset 0 1px 0 rgba(255,255,255,0.18);
}

/* C-block（ループ・条件などの入れ物） */
.mc-cblock {
  display: inline-block;
  margin: 0;
  max-width: 100%;
}
.mc-cblock-head, .mc-cblock-foot {
  background: var(--mc-bg);
  color: #fff;
  font-weight: bold;
  font-size: 0.95rem;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  max-width: 100%;
}
.mc-cblock-head { border-radius: 4px 4px 0 0; }
.mc-cblock-foot { border-radius: 0 0 4px 4px; padding: 6px 16px; min-width: 80px; }
.mc-cblock-body {
  background: var(--mc-bg);
  padding: 2px 6px 6px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: -1px;
  max-width: 100%;
}
.mc-cblock-body .mc-block {
  box-shadow: 0 1px 0 var(--mc-shadow), inset 0 1px 0 rgba(255,255,255,0.18);
}

/* 入力フィールド（数値・文字） */
.mc-input {
  background: #fff;
  color: #333;
  font-weight: normal;
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 0.9rem;
  border: 1px solid rgba(0,0,0,0.12);
  display: inline-block;
  min-width: 24px;
  text-align: center;
}
.mc-input-num {
  background: #fff;
  color: #333;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: normal;
  display: inline-block;
}
/* ドロップダウン風 */
.mc-input-drop {
  background: rgba(0,0,0,0.18);
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: normal;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mc-input-drop::after {
  content: "▾";
  font-size: 0.7em;
}

/* ======== ミッションカード（草ブロック風） ======== */
.mission-card {
  background: #FFF8DC;
  border: 4px solid #5BAA47;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 6px 0 #3D7A1F, 0 10px 20px rgba(0,0,0,0.1);
  overflow: hidden;
  margin: 8px 0;
}
.mission-banner {
  background: linear-gradient(180deg, #76C95B 0%, #58A92F 100%);
  color: #fff;
  padding: 12px 18px;
  font-size: 1.15rem;
  font-weight: bold;
  font-family: "DotGothic16", "Helvetica Neue", sans-serif;
  text-shadow: 2px 2px 0 #2F5F1F;
  position: relative;
  letter-spacing: 0.05em;
}
.mission-banner::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(90deg,
    #8B5A2B 0, #8B5A2B 8px,
    #6B3F18 8px, #6B3F18 16px);
}
.mission-content {
  padding: 22px 22px 18px;
  font-size: 1.05rem;
}
.mission-content p:last-child { margin-bottom: 0; }

/* ======== ゴール（できるようになること）バッジ ======== */
.goals-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.goals-grid li {
  background: #fff;
  border: 3px solid #1abc9c;
  border-radius: 8px;
  padding: 12px 16px 12px 52px;
  position: relative;
  box-shadow: 0 3px 0 #128a72;
  font-weight: 500;
}
.goals-grid li::before {
  content: "⭐";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  background: #ffe066;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #d4a017;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 #b8860b;
}

/* ======== 手順（クエストステップ） ======== */
.steps-quest {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.steps-quest li {
  position: relative;
  padding: 14px 16px 14px 60px;
  background: #f4f9ed;
  border-left: 5px solid #58A92F;
  border-radius: 4px;
  margin-bottom: 8px;
  counter-increment: step;
  font-weight: 500;
}
.steps-quest li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: #58A92F;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  font-family: "DotGothic16", sans-serif;
  box-shadow: 0 3px 0 #3D7A1F;
}

/* ======== ポイントBOX（電球） ======== */
.point-box {
  background: #fffbea;
  border: 3px solid #f4c430;
  padding: 18px 18px 18px 64px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 4px 0 #c9a227;
}
.point-box::before {
  content: "💡";
  position: absolute;
  left: 14px;
  top: 16px;
  font-size: 2rem;
  background: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #f4c430;
}

/* ======== チャレンジBOX（宝箱） ======== */
.challenge-box {
  background: linear-gradient(135deg, #FFE082 0%, #FFD54F 100%);
  border: 3px solid #C9A227;
  padding: 22px 22px 18px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 5px 0 #8B6914, 0 8px 20px rgba(201,162,39,0.25);
  font-weight: 500;
}
.challenge-box::before {
  content: "💎 ボーナスチャレンジ";
  position: absolute;
  top: -14px;
  left: 14px;
  background: #C9A227;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  font-family: "DotGothic16", sans-serif;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 0 #8B6914;
}

/* ======== ふりかえり（じゃーなる風） ======== */
.reflect-box {
  background: #fdf8ec;
  border: 2px dashed #c9a05a;
  border-radius: 6px;
  padding: 18px 22px;
  position: relative;
}
.reflect-box::before {
  content: "📓";
  position: absolute;
  top: -14px;
  right: 16px;
  font-size: 1.6rem;
  background: #fff;
  padding: 2px 6px;
  border-radius: 50%;
}
.reflect-box ul { margin: 0; padding-left: 1.2em; }

/* ======== Pythonコード（折りたたみ） ======== */
details.python {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 8px 14px;
}
details.python summary {
  cursor: pointer;
  font-weight: bold;
  padding: 6px 0;
  color: #555;
}
details.python pre {
  background: #1e1e1e;
  color: #f8f8f2;
  padding: 14px 16px;
  border-radius: 4px;
  overflow-x: auto;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ======== おうちの人へ ======== */
.parent-note {
  background: #f3eef7;
  border: 1px solid #d4c4e2;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 0.95rem;
}
.parent-note h2 {
  border-left-color: #8e44ad;
}

/* ======== ナビ ======== */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
.lesson-nav a {
  text-decoration: none;
  color: #1abc9c;
  font-weight: bold;
  padding: 8px 14px;
  border-radius: 4px;
}
.lesson-nav a:hover { background: #e8f7f4; }
.lesson-nav .nav-disabled { color: #ccc; pointer-events: none; }

/* ======== レッスン完了・今日のコマンド ======== */
.lesson-complete {
  display: grid;
  gap: 12px;
  margin: 30px 0 0;
}
.today-command, .complete-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-radius: 8px;
  padding: 16px 18px;
}
.today-command {
  background: #eef7ff;
  border: 3px solid #4A6CD4;
  box-shadow: 0 4px 0 #2C4A9E;
}
.today-command-label, .complete-label {
  margin: 0 0 4px;
  color: #53615f;
  font-size: 0.82rem;
  font-weight: bold;
}
.today-command-code {
  margin: 0;
}
.today-command-code code {
  display: inline-block;
  background: #fff;
  color: #23449d;
  border: 2px solid #c6d2ff;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 1.35rem;
  font-weight: bold;
  line-height: 1;
}
.today-command-hint {
  max-width: 320px;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}
.complete-card {
  background: #fffbea;
  border: 3px solid #f4c430;
  box-shadow: 0 4px 0 #c9a227;
}
.complete-title {
  margin: 0;
  font-weight: bold;
}
.complete-help {
  margin: 4px 0 0;
  font-size: 0.9rem;
}
.complete-help a, .today-command-hint a {
  color: #117c68;
  font-weight: bold;
}
.complete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: #1abc9c;
  color: #fff;
  padding: 10px 18px;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 0 #128a72;
  white-space: nowrap;
}
.complete-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #128a72;
}
.complete-button-icon {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
}
.lesson-complete.is-complete .complete-card {
  background: #f1fff9;
  border-color: #1abc9c;
  box-shadow: 0 4px 0 #128a72;
}
.lesson-complete.is-complete .complete-button {
  background: #2f7d32;
  box-shadow: 0 3px 0 #1f5a22;
}
.lesson-complete.is-complete .complete-button-icon {
  position: relative;
  background: #fff;
}
.lesson-complete.is-complete .complete-button-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 8px;
  height: 5px;
  border-left: 3px solid #2f7d32;
  border-bottom: 3px solid #2f7d32;
  transform: rotate(-45deg);
}

/* ======== つまずき診断 ======== */
.trouble-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.trouble-menu a {
  display: flex;
  align-items: center;
  min-height: 54px;
  background: #fff;
  border: 3px solid #1abc9c;
  border-radius: 8px;
  color: #173f38;
  font-weight: bold;
  line-height: 1.45;
  padding: 12px 14px;
  text-decoration: none;
  box-shadow: 0 3px 0 #128a72;
}
.trouble-menu a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #128a72;
}
.trouble-card {
  scroll-margin-top: 92px;
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08);
}
.trouble-card h2 {
  margin-bottom: 16px;
}
.trouble-steps {
  display: grid;
  gap: 10px;
}
.trouble-steps div {
  background: #f4f9ed;
  border-left: 5px solid #58A92F;
  border-radius: 4px;
  padding: 12px 14px;
}
.trouble-steps strong {
  display: inline-block;
  margin-bottom: 4px;
  color: #2f6f22;
}
.trouble-steps p {
  margin: 0;
}

/* ======== 授業計画 ======== */
.curriculum-page {
  max-width: none;
}
.curriculum-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.curriculum-summary > div {
  background: #fff;
  border: 2px solid #dbe7d5;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.curriculum-summary h2 {
  margin-bottom: 8px;
}
.curriculum-summary p {
  margin: 0;
  font-size: 0.95rem;
}
.curriculum-map {
  display: grid;
  gap: 10px;
}
.curriculum-level {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
  background: #fff;
  border-left: 8px solid var(--lv-bg);
  border-radius: 8px;
  padding: 13px 16px;
  box-shadow: 0 3px 0 var(--lv-shadow);
}
.curriculum-level strong {
  color: var(--lv-bg);
}
.curriculum-note {
  margin-top: -6px;
  color: #555;
  font-size: 0.95rem;
}
.curriculum-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 2px solid #dbe7d5;
  border-radius: 8px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08);
}
.curriculum-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.5;
}
.curriculum-table th, .curriculum-table td {
  border-bottom: 1px solid #e7eee3;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}
.curriculum-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1f5a50;
  color: #fff;
  white-space: nowrap;
}
.curriculum-table td:first-child {
  font-weight: bold;
  text-align: center;
}
.curriculum-table a {
  color: #117c68;
  font-weight: bold;
  text-decoration: none;
}
.curriculum-table a:hover {
  text-decoration: underline;
}
.curriculum-badge {
  display: inline-block;
  min-width: 42px;
  border-radius: 4px;
  padding: 2px 6px;
  color: #fff;
  font-weight: bold;
  text-align: center;
}
.curriculum-row-lv0 .curriculum-badge { background: #58A92F; }
.curriculum-row-lv1 .curriculum-badge { background: #E8A92E; }
.curriculum-row-lv2 .curriculum-badge { background: #4A6CD4; }
.curriculum-row-lv3 .curriculum-badge { background: #8E44AD; }
.curriculum-row-lv0 { background: #fbfff8; }
.curriculum-row-lv1 { background: #fffdf6; }
.curriculum-row-lv2 { background: #f8fbff; }
.curriculum-row-lv3 { background: #fdf8ff; }

/* ======== 作品発表シート ======== */
.showcase-page {
  max-width: none;
}
.showcase-intro {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}
.showcase-intro > div, .showcase-checklist, .showcase-script {
  background: #fff;
  border: 2px solid #dbe7d5;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.showcase-intro h2, .showcase-checklist h2, .showcase-script h2 {
  margin-bottom: 8px;
}
.showcase-intro p {
  margin: 0;
}
.showcase-sheet {
  display: grid;
  gap: 14px;
  background: #fff;
  border: 3px solid #1abc9c;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 4px 0 #128a72;
}
.showcase-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.showcase-field {
  display: grid;
  gap: 6px;
}
.showcase-field-wide {
  grid-column: 1 / -1;
}
.showcase-field label {
  color: #23443f;
  font-weight: bold;
}
.showcase-input {
  background: #fbfff8;
  border: 2px dashed #9fcf93;
  border-radius: 6px;
  color: #222;
  font: inherit;
  line-height: 1.55;
  padding: 8px 10px;
  resize: vertical;
  width: 100%;
}
.showcase-input:focus {
  background: #fff;
  border-style: solid;
  outline: 3px solid rgba(26,188,156,0.2);
}
.showcase-input-line {
  min-height: 44px;
}
.showcase-input-box {
  min-height: 96px;
}
.showcase-input-sketch {
  min-height: 260px;
  background:
    linear-gradient(#eef6ea 1px, transparent 1px),
    linear-gradient(90deg, #eef6ea 1px, transparent 1px),
    #fff;
  background-size: 24px 24px;
}
.write-line, .write-box {
  display: block;
  background: #fbfff8;
  border: 2px dashed #9fcf93;
  border-radius: 6px;
}
.write-line {
  min-height: 44px;
}
.write-box {
  min-height: 96px;
}
.write-box-tall {
  min-height: 150px;
}
.showcase-sketch {
  min-height: 260px;
  background:
    linear-gradient(#eef6ea 1px, transparent 1px),
    linear-gradient(90deg, #eef6ea 1px, transparent 1px),
    #fff;
  background-size: 24px 24px;
  border: 2px dashed #9fcf93;
  border-radius: 6px;
  position: relative;
}
.showcase-sketch::before {
  content: "スクリーンショットを貼る / 作品の絵を描く";
  position: absolute;
  top: 10px;
  left: 12px;
  color: #6f8b68;
  font-size: 0.9rem;
  font-weight: bold;
}
.showcase-checklist ul, .showcase-script ol {
  margin: 0;
  padding-left: 1.35em;
}
.showcase-checklist li, .showcase-script li {
  margin: 6px 0;
}
.showcase-controls {
  align-items: center;
  background: #fff;
  border-top: 5px solid #1abc9c;
  border-radius: 8px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.05);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}
.showcase-save-status {
  color: #496345;
  font-weight: bold;
  margin: 0;
}
.showcase-control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.showcase-control-buttons button {
  background: #1abc9c;
  border: 2px solid #128a72;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: bold;
  min-height: 40px;
  padding: 7px 12px;
}
.showcase-control-buttons button:hover {
  background: #128a72;
}
.showcase-link-box {
  background: #fffbea;
  border: 3px solid #f4c430;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 4px 0 #c9a227;
}
.showcase-link-box a {
  color: #117c68;
  font-weight: bold;
}

/* ======== 関連レッスン ======== */
.related-lessons {
  background: #fff;
  border: 3px solid #dbe7d5;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08);
}
.related-lessons-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.related-lessons-head strong {
  font-size: 1.05rem;
}
.related-lessons-head span {
  color: #666;
  font-size: 0.9rem;
}
.related-lessons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.related-lesson-card {
  display: grid;
  gap: 4px;
  background: #f5fffb;
  border: 2px solid #9fd7c9;
  border-radius: 8px;
  color: #222;
  min-height: 96px;
  padding: 12px 14px;
  text-decoration: none;
}
.related-lesson-card:hover {
  border-color: #1abc9c;
  box-shadow: 0 3px 0 #128a72;
  transform: translateY(-1px);
}
.related-kind {
  justify-self: start;
  background: #1abc9c;
  color: #fff;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: bold;
}
.related-num {
  color: #117c68;
  font-weight: bold;
}
.related-title {
  line-height: 1.45;
}

/* ======== 章ページ ======== */
.chapter-page {
  max-width: none;
}
.chapter-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.chapter-card {
  background: #fff;
  border: 2px solid #dbe7d5;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.chapter-card h2 {
  margin-bottom: 8px;
}
.chapter-card p {
  margin: 0;
}
.chapter-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.chapter-stat {
  background: #fff;
  border-top: 5px solid var(--lv-bg);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 3px 0 var(--lv-shadow);
}
.chapter-stat strong {
  display: block;
  font-size: 1.2rem;
}
.chapter-stat span {
  color: #555;
  font-size: 0.9rem;
}
.chapter-progress {
  background: #fff;
  border-top: 5px solid var(--lv-bg);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.05);
}
.chapter-progress .progress-meter span {
  background: linear-gradient(90deg, var(--lv-bg), #1abc9c);
}
.chapter-goal {
  background: #fffbea;
  border: 3px solid #f4c430;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 4px 0 #c9a227;
}
.chapter-goal p {
  margin: 0;
}
.chapter-picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.chapter-pick {
  background: #fff;
  border: 2px solid #e5e5e5;
  border-left: 6px solid var(--lv-bg);
  border-radius: 8px;
  padding: 12px 14px;
  text-decoration: none;
  color: #222;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.chapter-pick strong {
  display: block;
  color: var(--lv-bg);
}
.chapter-pick span {
  font-size: 0.92rem;
}

/* ======== 先生用 授業進行 ======== */
.teaching-page {
  max-width: none;
}
.teaching-timeline {
  display: grid;
  gap: 10px;
}
.teaching-timeline div {
  display: grid;
  grid-template-columns: 90px 150px 1fr;
  gap: 12px;
  align-items: start;
  background: #fff;
  border-left: 6px solid #1abc9c;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.teaching-timeline strong {
  color: #117c68;
}
.teaching-timeline span {
  font-weight: bold;
}
.teaching-timeline p {
  margin: 0;
}
.teaching-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.teaching-grid ul {
  margin: 0;
  padding-left: 1.25em;
}
.teaching-note {
  background: #eef7ff;
  border-left: 5px solid #4A6CD4;
  border-radius: 6px;
  margin: 14px 0 0;
  padding: 12px 14px;
}
.teaching-note a {
  color: #117c68;
  font-weight: bold;
}
.teaching-checks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.teaching-checks div {
  background: #fff;
  border: 2px solid #dbe7d5;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.teaching-checks strong {
  display: block;
  color: #117c68;
  margin-bottom: 5px;
}
.teaching-checks p {
  margin: 0;
  font-size: 0.95rem;
}
.parent-guide-page {
  max-width: none;
}
.parent-progress div {
  border-left-color: #E8A92E;
}

/* ======== 修了証 ======== */
.certificate-page {
  background: #fff;
}
.certificate-sheet {
  background: linear-gradient(#fffdf2, #fff);
  border: 10px solid #58A92F;
  border-radius: 8px;
  box-shadow: 0 6px 0 #3D7A1F, 0 14px 30px rgba(0,0,0,0.12);
  margin: 0 auto;
  max-width: 900px;
  min-height: 620px;
  padding: 46px 54px;
  position: relative;
  text-align: center;
}
.certificate-sheet::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 3px solid #f4c430;
  border-radius: 4px;
  pointer-events: none;
}
.certificate-kicker {
  color: #117c68;
  font-weight: bold;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
}
.certificate-sheet h1 {
  color: #23443f;
  font-family: "DotGothic16", "Helvetica Neue", sans-serif;
  font-size: 2.2rem;
  line-height: 1.45;
  margin: 0 0 28px;
}
.certificate-name, .certificate-date {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: end;
  margin: 24px auto;
  max-width: 620px;
  text-align: left;
}
.certificate-name span, .certificate-date span {
  color: #496345;
  font-weight: bold;
}
.certificate-name div, .certificate-date div {
  border-bottom: 2px solid #23443f;
  min-height: 42px;
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: bold;
  padding: 0 8px 6px;
}
.certificate-name div.is-empty::before {
  content: " ";
}
.certificate-date div {
  justify-content: flex-end;
}
.certificate-text {
  font-size: 1.05rem;
  line-height: 1.9;
  margin: 30px auto;
  max-width: 680px;
}
.certificate-skills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px auto;
  max-width: 680px;
}
.certificate-skills span {
  background: #e8f7f4;
  border: 2px solid #1abc9c;
  border-radius: 999px;
  color: #117c68;
  font-weight: bold;
  padding: 6px 12px;
}
.certificate-sign {
  margin: 34px 0 0;
  font-weight: bold;
}
.certificate-progress-output {
  color: #496345;
  font-size: 0.9rem;
  font-weight: bold;
  margin: 18px 0 0;
}
.certificate-controls {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(280px, 1.15fr);
  gap: 14px;
  margin-top: 24px;
}
.certificate-status, .certificate-form {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.05);
  padding: 18px 20px;
}
.certificate-status {
  border-top: 5px solid #58A92F;
}
.certificate-status p {
  margin: 0 0 8px;
}
.certificate-status strong {
  color: #117c68;
  font-family: "DotGothic16", "Helvetica Neue", sans-serif;
  font-size: 1.8rem;
}
.certificate-form {
  border-top: 5px solid #1abc9c;
  display: grid;
  gap: 12px;
}
.certificate-form label {
  display: grid;
  gap: 6px;
  color: #23443f;
  font-weight: bold;
}
.certificate-form input {
  border: 2px solid #cddfc7;
  border-radius: 6px;
  font: inherit;
  min-height: 44px;
  padding: 8px 10px;
}
.certificate-form button {
  background: #1abc9c;
  border: 2px solid #128a72;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: bold;
  min-height: 44px;
}
.certificate-form button:hover {
  background: #128a72;
}
.certificate-note {
  background: #fffbea;
  border: 3px solid #f4c430;
  border-radius: 8px;
  box-shadow: 0 4px 0 #c9a227;
  margin-top: 24px;
  padding: 16px 20px;
}
.certificate-note a {
  color: #117c68;
  font-weight: bold;
}

/* ======== 品質チェック ======== */
.quality-page {
  max-width: none;
}
.quality-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 2px solid #dbe7d5;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.quality-actions button,
.quality-actions a {
  min-height: 42px;
  border: 2px solid #128a72;
  border-radius: 6px;
  background: #1abc9c;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: bold;
  padding: 8px 16px;
  text-decoration: none;
  display: inline-block;
}
.quality-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.quality-summary div {
  background: #fff;
  border-top: 5px solid #1abc9c;
  border-radius: 8px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
  padding: 14px;
}
.quality-summary strong {
  display: block;
  font-size: 1.4rem;
}
.quality-summary span {
  color: #555;
  font-size: 0.9rem;
}
.quality-badge {
  display: inline-block;
  border-radius: 4px;
  font-weight: bold;
  min-width: 56px;
  padding: 2px 8px;
  text-align: center;
}
.quality-badge-ok {
  background: #e8f7f4;
  color: #117c68;
}
.quality-badge-warn {
  background: #fff1d6;
  color: #8a5a00;
}
.quality-warn {
  background: #fffaf0;
}

/* ======== フッター ======== */
footer {
  background: #222;
  color: #ddd;
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  margin-top: 40px;
}
.footer-content { max-width: 900px; margin: 0 auto; }

/* ======== インデックス（目次）ページ ======== */
.index-hero {
  background: linear-gradient(180deg, #76C95B 0%, #58A92F 100%);
  color: #fff;
  padding: 40px 24px 32px;
  border-radius: 12px;
  text-align: center;
  position: relative;
  margin-bottom: 32px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.18);
  box-shadow: 0 6px 0 #3D7A1F, 0 10px 24px rgba(0,0,0,0.06);
}
.index-hero::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 10px;
  background: repeating-linear-gradient(90deg,
    #8B5A2B 0, #8B5A2B 10px,
    #6B3F18 10px, #6B3F18 20px,
    #8B5A2B 20px, #8B5A2B 30px,
    #7A4A20 30px, #7A4A20 40px);
}
.index-hero h1 {
  font-family: "DotGothic16", "Helvetica Neue", sans-serif;
  font-size: 2rem;
  margin: 0 0 10px;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.index-hero .subtitle {
  font-size: 1.05rem;
  margin: 0;
  opacity: 0.95;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  text-shadow: none;
}
.hero-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 18px;
  background: rgba(255,255,255,0.94);
  color: #265b1f;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 3px 0 rgba(47,95,31,0.35);
}
.hero-button-primary {
  background: #fff36a;
  border-color: #f4c430;
  color: #3f3a00;
}
.hero-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 0 rgba(47,95,31,0.35);
}

.index-intro {
  background: #fff;
  border-radius: 10px;
  padding: 22px 26px;
  margin: 24px 0 32px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.05);
  line-height: 1.75;
}
.index-intro p { margin: 0 0 8px; }
.index-intro p:last-child { margin-bottom: 0; }
.index-intro .kv {
  display: inline-block;
  background: #1abc9c;
  color: #fff;
  font-weight: bold;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-right: 6px;
}

.course-dashboard {
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(280px, 1.15fr);
  gap: 14px;
  margin: 0 0 22px;
}
.progress-panel, .route-panel, .index-guide > div {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.05);
}
.progress-panel {
  padding: 20px;
  border-top: 5px solid #1abc9c;
}
.route-panel {
  padding: 20px 22px;
  border-top: 5px solid #4A6CD4;
}
.eyebrow {
  margin: 0 0 6px;
  color: #666;
  font-size: 0.82rem;
  font-weight: bold;
  letter-spacing: 0.05em;
}
.progress-count {
  margin: 0;
  color: #222;
  font-family: "DotGothic16", "Helvetica Neue", sans-serif;
  font-size: 2.4rem;
  line-height: 1;
}
.progress-count span:last-child {
  color: #777;
  font-size: 1rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.progress-meter {
  height: 14px;
  background: #e6efe3;
  border: 2px solid #c9dcc2;
  border-radius: 99px;
  overflow: hidden;
  margin: 18px 0 12px;
}
.progress-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #1abc9c, #58A92F);
  transition: width 0.2s ease;
}
.next-lesson {
  margin: 0;
  font-size: 0.95rem;
  font-weight: bold;
}
.next-lesson a {
  color: #117c68;
}
.progress-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.progress-actions button {
  min-height: 34px;
  border: 2px solid #cddfc7;
  border-radius: 6px;
  background: #fff;
  color: #24443f;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: bold;
  padding: 5px 9px;
}
.progress-actions button:hover {
  border-color: #1abc9c;
  background: #f5fffb;
}
.progress-message {
  min-height: 1.3em;
  margin: 8px 0 0;
  color: #117c68;
  font-size: 0.85rem;
  font-weight: bold;
}
.certificate-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 12px;
  border: 2px solid #cddfc7;
  border-radius: 6px;
  background: #fff;
  color: #496345;
  font-weight: bold;
  padding: 7px 12px;
  text-decoration: none;
}
.certificate-link.is-ready {
  background: #fff36a;
  border-color: #f4c430;
  color: #3f3a00;
  box-shadow: 0 3px 0 #c9a227;
}
.route-list {
  margin: 0;
  padding-left: 1.4em;
}
.route-list li {
  margin: 4px 0;
}
.index-guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 26px;
}
.index-guide > div {
  padding: 18px 20px;
}
.index-guide h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.index-guide p {
  margin: 0;
  font-size: 0.96rem;
}
.index-guide a {
  color: #117c68;
  font-weight: bold;
}
.lesson-tools {
  position: sticky;
  top: 70px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  background: rgba(234,243,224,0.95);
  border: 1px solid rgba(91,170,71,0.25);
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 26px;
  backdrop-filter: blur(6px);
}
.lesson-search {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: bold;
  color: #496345;
}
.lesson-search input {
  width: 100%;
  min-height: 42px;
  border: 2px solid #cddfc7;
  border-radius: 6px;
  padding: 8px 12px;
  font: inherit;
  background: #fff;
}
.lesson-search input:focus {
  outline: 3px solid rgba(26,188,156,0.25);
  border-color: #1abc9c;
}
.level-filter, .status-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.status-filter {
  grid-column: 1 / -1;
}
.filter-button, .status-button {
  min-height: 42px;
  border: 2px solid #cddfc7;
  border-radius: 6px;
  padding: 7px 12px;
  background: #fff;
  color: #333;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
.filter-button.is-active, .status-button.is-active {
  background: #1abc9c;
  border-color: #128a72;
  color: #fff;
}

.level-section {
  margin: 36px 0;
}
.level-header {
  background: var(--lv-bg);
  color: #fff;
  padding: 16px 22px;
  border-radius: 8px;
  font-weight: bold;
  font-family: "DotGothic16", "Helvetica Neue", sans-serif;
  letter-spacing: 0.05em;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 0 var(--lv-shadow);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.15);
  flex-wrap: wrap;
}
.level-header .lv-badge {
  background: #fff;
  color: var(--lv-bg);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.95rem;
  text-shadow: none;
}
.level-header .lv-title { font-size: 1.1rem; }
.level-header .lv-range {
  margin-left: auto;
  font-size: 0.9rem;
  opacity: 0.95;
}
.level-header .lv-link {
  background: rgba(255,255,255,0.95);
  color: var(--lv-bg);
  border-radius: 4px;
  padding: 4px 10px;
  text-decoration: none;
  text-shadow: none;
  font-size: 0.85rem;
}
.level-header .lv-link:hover {
  background: #fff36a;
}

.level-lv0 { --lv-bg: #58A92F; --lv-shadow: #3D7A1F; }
.level-lv1 { --lv-bg: #E8A92E; --lv-shadow: #B5821C; }
.level-lv2 { --lv-bg: #4A6CD4; --lv-shadow: #2C4A9E; }
.level-lv3 { --lv-bg: #8E44AD; --lv-shadow: #6C3382; }

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.lesson-item {
  position: relative;
  min-width: 0;
}
.lesson-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 6px;
  padding: 10px 14px;
  text-decoration: none;
  color: #222;
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
  position: relative;
  min-height: 62px;
  padding-right: 52px;
}
.lesson-card:hover {
  transform: translateY(-2px);
  border-color: var(--lv-bg);
  box-shadow: 0 3px 0 var(--lv-shadow);
}
.lesson-card .num {
  background: var(--lv-bg);
  color: #fff;
  font-family: "DotGothic16", sans-serif;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  box-shadow: 0 2px 0 var(--lv-shadow);
}
.lesson-card .title {
  font-size: 0.95rem;
  line-height: 1.4;
  flex: 1;
}
.lesson-check {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  border: 2px solid #cfd8cc;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.lesson-check span {
  display: block;
  width: 12px;
  height: 7px;
  margin: 10px auto 0;
  border-left: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transform: rotate(-45deg);
}
.lesson-card.is-done {
  border-color: #9fd7c9;
  background: #f5fffb;
}
.lesson-card.is-done .title {
  color: #58665f;
}
.lesson-item.is-done .lesson-check,
.lesson-card.is-done .lesson-check {
  background: #1abc9c;
  border-color: #128a72;
}
.lesson-item.is-done .lesson-check span,
.lesson-card.is-done .lesson-check span {
  border-left-color: #fff;
  border-bottom-color: #fff;
}

@media (max-width: 600px) {
  .lesson-grid { grid-template-columns: 1fr; }
  .index-hero { padding: 28px 16px 22px; }
  .index-hero h1 { font-size: 1.4rem; }
  .index-hero .subtitle { font-size: 0.95rem; }
  .course-dashboard, .index-guide, .lesson-tools { grid-template-columns: 1fr; }
  .lesson-tools { top: 62px; }
  .level-filter, .status-filter { justify-content: flex-start; }
  .level-header { padding: 12px 14px; gap: 8px; }
  .level-header .lv-title { font-size: 0.95rem; }
  .level-header .lv-range { font-size: 0.8rem; }
}

/* ======== マスコット（ピクセルアート・ランダム表示・タイトル枠内右上） ======== */
.mc-mascot {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 56px;
  height: 56px;
  z-index: 5;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.25));
  animation: mc-mascot-bob 3.2s ease-in-out infinite;
}
@keyframes mc-mascot-bob {
  0%, 100% { transform: translateY(0); }
  50%     { transform: translateY(-5px); }
}

.mc-mascot-creeper { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'><rect width='8' height='8' fill='%235dba47'/><rect x='0' y='2' width='1' height='1' fill='%2374c863'/><rect x='5' y='0' width='1' height='1' fill='%234a9337'/><rect x='7' y='4' width='1' height='1' fill='%2374c863'/><rect x='0' y='5' width='1' height='1' fill='%234a9337'/><rect x='6' y='6' width='1' height='1' fill='%2374c863'/><rect x='1' y='1' width='2' height='2' fill='%23222'/><rect x='5' y='1' width='2' height='2' fill='%23222'/><rect x='2' y='4' width='4' height='1' fill='%23222'/><rect x='1' y='5' width='2' height='2' fill='%23222'/><rect x='5' y='5' width='2' height='2' fill='%23222'/><rect x='1' y='7' width='6' height='1' fill='%23222'/></svg>"); }

.mc-mascot-pig { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'><rect width='8' height='8' fill='%23ec9696'/><rect x='0' y='0' width='2' height='2' fill='%23d77d7d'/><rect x='6' y='0' width='2' height='2' fill='%23d77d7d'/><rect x='3' y='1' width='1' height='1' fill='%23f5b1b1'/><rect x='5' y='4' width='1' height='1' fill='%23f5b1b1'/><rect x='2' y='3' width='1' height='1' fill='%23222'/><rect x='5' y='3' width='1' height='1' fill='%23222'/><rect x='2' y='5' width='4' height='2' fill='%23d77d7d'/><rect x='3' y='6' width='1' height='1' fill='%23222'/><rect x='4' y='6' width='1' height='1' fill='%23222'/></svg>"); }

.mc-mascot-grass { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'><rect y='2' width='8' height='6' fill='%238b5a2b'/><rect x='1' y='3' width='1' height='1' fill='%23734820'/><rect x='4' y='4' width='2' height='1' fill='%23a06c3a'/><rect x='2' y='5' width='1' height='1' fill='%23734820'/><rect x='6' y='6' width='1' height='1' fill='%23a06c3a'/><rect x='3' y='7' width='1' height='1' fill='%23734820'/><rect width='8' height='2' fill='%235dba47'/><rect x='1' y='0' width='1' height='1' fill='%2374c863'/><rect x='4' y='1' width='1' height='1' fill='%234a9337'/><rect x='6' y='0' width='1' height='1' fill='%2374c863'/><rect x='0' y='2' width='1' height='1' fill='%234a9337'/><rect x='5' y='2' width='1' height='1' fill='%234a9337'/><rect x='3' y='2' width='1' height='1' fill='%235dba47'/></svg>"); }

.mc-mascot-heart { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'><rect x='1' y='1' width='2' height='1' fill='%23e74c3c'/><rect x='5' y='1' width='2' height='1' fill='%23e74c3c'/><rect x='0' y='2' width='8' height='2' fill='%23e74c3c'/><rect x='1' y='4' width='6' height='1' fill='%23e74c3c'/><rect x='2' y='5' width='4' height='1' fill='%23e74c3c'/><rect x='3' y='6' width='2' height='1' fill='%23e74c3c'/><rect x='1' y='2' width='1' height='1' fill='%23ff7766'/><rect x='2' y='3' width='1' height='1' fill='%23ff7766'/></svg>"); }

.mc-mascot-diamond { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'><rect x='3' y='0' width='2' height='1' fill='%2387ddde'/><rect x='2' y='1' width='4' height='1' fill='%235dd5d5'/><rect x='1' y='2' width='6' height='1' fill='%2387ddde'/><rect x='0' y='3' width='8' height='2' fill='%235dd5d5'/><rect x='1' y='5' width='6' height='1' fill='%2387ddde'/><rect x='2' y='6' width='4' height='1' fill='%235dd5d5'/><rect x='3' y='7' width='2' height='1' fill='%2387ddde'/><rect x='2' y='2' width='1' height='1' fill='%23ffffff'/><rect x='1' y='3' width='1' height='1' fill='%23ffffff'/></svg>"); }

.mc-mascot-torch { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'><rect x='3' y='0' width='2' height='1' fill='%23ff8c00'/><rect x='2' y='1' width='1' height='2' fill='%23ff8c00'/><rect x='5' y='1' width='1' height='2' fill='%23ff8c00'/><rect x='3' y='1' width='2' height='2' fill='%23ffe066'/><rect x='3' y='1' width='1' height='1' fill='%23fff5a8'/><rect x='3' y='3' width='2' height='1' fill='%23ff8c00'/><rect x='3' y='4' width='2' height='4' fill='%238b5a2b'/><rect x='3' y='4' width='1' height='4' fill='%23c98c4b'/></svg>"); }

/* ======== モバイル ======== */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .lesson { padding: 20px 14px; }
  .lesson-header { margin: -20px -14px 24px; padding: 18px 16px 14px; }
  .lesson-header h1 { font-size: 1.3rem; }
  .mc-program { padding: 32px 12px 16px; }
  .screenshot-placeholder.has-preview { padding: 12px; }
  .mc-preview-scene { padding: 10px; gap: 2px; }
  .mc-preview-row { gap: 2px; }
  .mc-preview-caption { font-size: 0.9rem; }
  .mc-block, .mc-event-head, .mc-cblock-head {
    font-size: 0.85rem;
    padding: 8px 10px;
  }
  .mc-event-body, .mc-cblock-body { padding-left: 10px; padding-right: 4px; }
  .mc-input, .mc-input-num, .mc-input-drop { font-size: 0.8rem; padding: 2px 8px; }
  .mc-mascot { width: 42px; height: 42px; top: 6px; right: 8px; }
  .today-command, .complete-card { grid-template-columns: 1fr; }
  .today-command-hint { max-width: none; }
  .complete-button { width: 100%; white-space: normal; }
  .curriculum-summary { grid-template-columns: 1fr; }
  .curriculum-level { grid-template-columns: 1fr; gap: 4px; }
  .showcase-intro, .showcase-fields { grid-template-columns: 1fr; }
  .showcase-field-wide { grid-column: auto; }
  .showcase-controls { align-items: stretch; flex-direction: column; }
  .showcase-control-buttons { display: grid; width: 100%; }
  .chapter-overview, .chapter-stats { grid-template-columns: 1fr; }
  .related-lessons-head { display: block; }
  .related-lessons-grid { grid-template-columns: 1fr; }
  .teaching-timeline div, .teaching-grid, .teaching-checks { grid-template-columns: 1fr; }
  .certificate-sheet { padding: 34px 22px; }
  .certificate-sheet h1 { font-size: 1.55rem; }
  .certificate-name, .certificate-date { grid-template-columns: 1fr; gap: 4px; }
  .certificate-controls { grid-template-columns: 1fr; }
  .quality-actions, .quality-summary { grid-template-columns: 1fr; }
  .quality-actions { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .mc-mascot {
    animation: none !important;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
    font-size: 11px;
  }
  body::before, header, footer, .hero-actions, .lesson-nav, .mc-mascot, .mission-card, .curriculum-summary, .curriculum-map, .parent-note, .showcase-intro, .showcase-checklist, .showcase-controls, .showcase-link-box, .certificate-controls, .certificate-note {
    display: none !important;
  }
  main {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .lesson {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }
  .lesson-header {
    background: none;
    color: #111;
    margin: 0 0 10px;
    padding: 0;
    text-shadow: none;
  }
  .lesson-header::after {
    display: none;
  }
  .lesson-header h1 {
    color: #111;
    font-size: 20px;
  }
  .lesson-tags {
    display: none;
  }
  .lesson section {
    margin: 0;
  }
  .curriculum-table-wrap {
    overflow: visible;
    border: 0;
    box-shadow: none;
  }
  .curriculum-table {
    min-width: 0;
    font-size: 8.5px;
  }
  .curriculum-table th {
    position: static;
    background: #eee;
    color: #111;
  }
  .curriculum-table th, .curriculum-table td {
    padding: 4px 5px;
    border: 1px solid #aaa;
  }
  .curriculum-table a {
    color: #111;
    text-decoration: none;
  }
  .curriculum-badge {
    color: #111;
    border: 1px solid #777;
    background: #fff !important;
  }
  .showcase-sheet {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .showcase-fields {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .showcase-field-wide {
    grid-column: 1 / -1;
  }
  .write-line, .write-box, .showcase-sketch {
    border: 1px solid #777;
    background: #fff;
  }
  .showcase-input {
    border: 1px solid #777;
    background: #fff;
    min-height: 70px;
  }
  .showcase-input-line {
    min-height: 32px;
  }
  .showcase-input-sketch {
    min-height: 190px;
  }
  .write-line { min-height: 32px; }
  .write-box { min-height: 70px; }
  .write-box-tall { min-height: 110px; }
  .showcase-sketch { min-height: 190px; }
  .certificate-sheet {
    border: 8px solid #111;
    box-shadow: none;
    min-height: 92vh;
    max-width: none;
    padding: 40px;
  }
  .certificate-sheet::before {
    border-color: #111;
  }
  .certificate-sheet h1 {
    font-size: 28px;
  }
  .certificate-skills span {
    border-color: #111;
    color: #111;
    background: #fff;
  }
}

/* トップページでは道場名以外を通常ゴシックにして可読性を優先する */
body.dojo-index-page :where(.index-hero .subtitle, .hero-button, .index-intro .kv, .progress-panel .eyebrow, .route-panel .eyebrow, .progress-count, .next-lesson, .certificate-link, .progress-actions button, .index-guide h2, .lesson-search span, .filter-button, .status-button, .lv-badge, .lv-title, .lv-range, .lv-link, .lesson-card .num, .lesson-card .title) {
  font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans", "Yu Gothic", sans-serif !important;
  letter-spacing: 0;
}

body.dojo-index-page :where(.index-hero, .index-intro, .progress-panel, .route-panel, .index-guide > div, .lesson-tools, .level-section) {
  border: 1px solid #dfe5ee !important;
  border-radius: 10px !important;
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.08) !important;
}
body.dojo-index-page .index-hero { text-shadow: none; }
body.dojo-index-page .index-hero h1 { text-shadow: 0 2px 10px rgba(0,0,0,0.18); }
body.dojo-index-page .hero-button,
body.dojo-index-page .certificate-link,
body.dojo-index-page .filter-button,
body.dojo-index-page .status-button,
body.dojo-index-page .progress-actions button,
body.dojo-index-page .lv-link {
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
body.dojo-index-page .hero-actions .hero-button:nth-child(n+3) {
  min-height: 36px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.78);
  color: #4d5968;
  font-size: 0.86rem;
}
body.dojo-index-page .hero-actions a[href*="certificate"] {
  background: rgba(255,255,255,0.72) !important;
  color: #667085 !important;
}
body.dojo-index-page .lesson-card {
  border: 1px solid #dfe5ee !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.05);
}
body.dojo-index-page .lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(23, 32, 51, 0.12);
}
body.dojo-index-page .header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.dojo-index-page .preview-badge {
  display: inline-block;
  background: #e11d48;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
body.dojo-index-page .admin-links {
  max-width: 1100px;
  margin: 24px auto 0;
  padding: 0 16px;
  color: #667085;
  font-size: 0.84rem;
  text-align: right;
}
body.dojo-index-page .admin-links summary {
  cursor: pointer;
}
body.dojo-index-page .admin-links a {
  color: #667085;
}
html:not(.admin-mode) body.dojo-index-page .admin-links {
  display: none !important;
}
body.dojo-index-page .dojo-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: -16px 0 16px;
}
body.dojo-index-page .dojo-summary div {
  background: #fff;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.06);
}
body.dojo-index-page .dojo-summary span {
  display: block;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 700;
}
body.dojo-index-page .dojo-summary strong {
  display: block;
  margin-top: 3px;
  color: #172033;
}
body.dojo-index-page .dojo-preview-note {
  margin: 0 0 18px;
  padding: 11px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid #ea580c;
  border-radius: 8px;
  color: #7c2d12;
  font-size: 0.88rem;
}
@media (max-width: 600px) {
  body.dojo-index-page .dojo-summary { grid-template-columns: 1fr; }
  body.dojo-index-page .hero-actions .hero-button:nth-child(n+4) { display: none; }
}
