:root {
  --primary: #1a3a5c;
  --accent:  #e85d26;
  --light:   #f0f4f9;
  --border:  #dde4ef;
  --success: #27ae60;
  --warning: #f39c12;
  --danger:  #e74c3c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%; overflow: hidden;
  font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  background: #1a2a3a;
}

/* ===== CHROME ===== */
#chrome { position: fixed; top: 0; left: 0; right: 0; z-index: 100; }

header {
  background: var(--primary);
  color: white;
  height: 48px;
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
header h1 { font-size: 15px; font-weight: 700; }
.header-sub { font-size: 11px; opacity: 0.65; margin-top: 1px; }
.header-right { display: flex; gap: 10px; align-items: center; }
.slide-counter {
  background: rgba(255,255,255,0.15);
  border-radius: 20px; padding: 3px 12px; font-size: 12px; font-weight: 600;
}
.menu-toggle {
  background: none; border: 1.5px solid rgba(255,255,255,0.4); color: white;
  border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.menu-toggle:hover { background: rgba(255,255,255,0.1); }

/* ===== SET SWITCHER ===== */
#setBar {
  background: #0f1f2f;
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
}
.set-btn {
  height: 32px; padding: 0 20px; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
  color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.08);
  transition: all 0.2s; white-space: nowrap;
}
.set-btn:hover { color: white; background: rgba(255,255,255,0.15); }
.set-btn.active[data-set="basic"] {
  background: var(--primary); color: white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}
.set-btn.active[data-set="intl"] {
  background: #8b1a1a; color: white;
  box-shadow: 0 0 0 2px rgba(255,100,100,0.4);
}
.set-btn.active[data-set="grades"] {
  background: #1a7a4a; color: white;
  box-shadow: 0 0 0 2px rgba(100,220,150,0.4);
}
.set-btn.active[data-set="expulsion"] {
  background: #6d2b00; color: white;
  box-shadow: 0 0 0 2px rgba(255,140,60,0.4);
}
.set-btn.active[data-set="student-life"] {
  background: #0d5c63; color: white;
  box-shadow: 0 0 0 2px rgba(80,200,200,0.4);
}
.set-label {
  margin-left: auto; font-size: 11px; color: rgba(255,255,255,0.3);
}

/* ===== QUIZ DROPDOWN ===== */
.quiz-dropdown-wrap {
  position: relative;
  margin-left: 6px;
}
.quiz-drop-btn {
  height: 32px; padding: 0 14px;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 6px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit;
  color: white; background: rgba(255,255,255,0.1);
  transition: all 0.2s; white-space: nowrap;
}
.quiz-drop-btn:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.6); }
.quiz-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1a2a3a;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  min-width: 230px;
  z-index: 200;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  overflow: hidden;
}
.quiz-drop-menu.open { display: block; }
.quiz-drop-title {
  padding: 10px 14px 6px;
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.quiz-drop-item {
  display: block;
  padding: 9px 14px;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.quiz-drop-item:hover { background: rgba(255,255,255,0.1); color: white; }
.quiz-drop-sep {
  height: 1px; background: rgba(255,255,255,0.1); margin: 4px 0;
}
.quiz-drop-all {
  font-size: 12px; color: rgba(255,255,255,0.5);
}

/* ===== CATEGORY BAR ===== */
.category-bar {
  background: white; border-bottom: 2px solid var(--border);
  height: 38px; padding: 0 12px;
  display: flex; align-items: center; gap: 2px;
  overflow-x: auto; scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }
.cat-btn {
  height: 30px; padding: 0 14px; border: none; background: none;
  cursor: pointer; font-size: 12px; font-family: inherit; color: #888;
  white-space: nowrap; border-bottom: 3px solid transparent; transition: all 0.2s;
}
.cat-btn.active { color: var(--primary); border-bottom-color: var(--accent); font-weight: 700; }
.cat-btn.active.intl-mode { border-bottom-color: #c0392b; color: #7b241c; }
.cat-btn.active.grades-mode { border-bottom-color: #1e8449; color: #145a32; }
.cat-btn.active.expulsion-mode { border-bottom-color: #b94a00; color: #6d2b00; }
.cat-btn.active.student-life-mode { border-bottom-color: #0d5c63; color: #0d5c63; }
.cat-btn:hover { color: var(--primary); }

/* ===== STAGE ===== */
#stage {
  position: fixed;
  top: 132px; /* 48+46+38 */
  bottom: 56px;
  left: 0; right: 0;
  display: flex; align-items: center; justify-content: center;
  background: #1a2a3a;
}

/* ===== SCALER 1600×800 ===== */
#scaler {
  width: 1600px; height: 800px;
  transform-origin: center center;
  position: relative;
}

/* ===== SLIDE ===== */
.slide {
  display: none; width: 1600px; height: 800px;
  position: absolute; top: 0; left: 0;
  animation: fadeSlide 0.25s ease;
}
.slide.active { display: flex; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== LEFT PANEL ===== */
.slide-left {
  width: 480px; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 40px 36px; position: relative; overflow: hidden;
}
.slide-left.c-blue   { background: linear-gradient(160deg, #1a3a5c 0%, #2d6a9f 100%); }
.slide-left.c-teal   { background: linear-gradient(160deg, #0d5c63 0%, #1e8898 100%); }
.slide-left.c-green  { background: linear-gradient(160deg, #145a32 0%, #1e8449 100%); }
.slide-left.c-purple { background: linear-gradient(160deg, #4a235a 0%, #7d3c98 100%); }
.slide-left.c-red    { background: linear-gradient(160deg, #7b241c 0%, #c0392b 100%); }
.slide-left.c-navy   { background: linear-gradient(160deg, #17202a 0%, #2e4057 100%); }
.slide-left.c-orange { background: linear-gradient(160deg, #784212 0%, #ca6f1e 100%); }
/* 留学生専用カラー */
.slide-left.c-crimson { background: linear-gradient(160deg, #6e0a0a 0%, #a93226 100%); }
.slide-left.c-amber   { background: linear-gradient(160deg, #7d4304 0%, #c0710a 100%); }
.slide-left.c-slate   { background: linear-gradient(160deg, #1c2833 0%, #2e4057 100%); }

.slide-left::before {
  content: ''; position: absolute; right: -60px; bottom: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.slide-left::after {
  content: ''; position: absolute; right: 40px; top: -40px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.slide-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.18); color: white;
  font-size: 22px; font-weight: 700; padding: 7px 20px;
  border-radius: 20px; letter-spacing: 0.06em; width: fit-content;
}
.slide-num {
  font-size: 110px; font-weight: 900; color: rgba(255,255,255,0.12);
  line-height: 1; margin: 4px 0 -4px;
}
.slide-title {
  font-size: 54px; font-weight: 800; color: white; line-height: 1.2;
}
.slide-subtitle {
  font-size: 26px; color: rgba(255,255,255,0.75); line-height: 1.5; margin-top: 14px;
}
.slide-left-bottom { font-size: 18px; color: rgba(255,255,255,0.4); }
.slide-qr {
  position: absolute;
  bottom: 36px; right: 36px;
  width: 100px; height: 100px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  opacity: 0.88;
  pointer-events: none;
}

/* ===== RIGHT PANEL ===== */
.slide-right {
  flex: 1; background: white;
  padding: 28px 40px; overflow-y: auto;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.slide-right::-webkit-scrollbar { width: 6px; }
.slide-right::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* ===== CONTENT ===== */
h2 {
  font-size: 30px; font-weight: 700; color: var(--primary);
  border-left: 6px solid var(--accent); padding-left: 14px; margin-top: 2px;
}
h2.intl { border-left-color: #c0392b; color: #6e0a0a; }
h2.grades { border-left-color: #1e8449; color: #145a32; }
p { font-size: 24px; line-height: 1.65; color: #444; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.info-card {
  background: #f8fafc; border-radius: 12px; padding: 16px 20px;
  border-left: 6px solid var(--primary);
}
.info-card.warn    { border-left-color: var(--warning); }
.info-card.danger  { border-left-color: var(--danger); }
.info-card.success { border-left-color: var(--success); }
.info-card.crimson { border-left-color: #a93226; background: #fdf2f2; }
.info-card .card-icon { font-size: 36px; margin-bottom: 6px; }
.info-card h3 { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--primary); }
.info-card.crimson h3 { color: #7b241c; }
.info-card p, .info-card li { font-size: 20px; line-height: 1.55; color: #555; }
.info-card ul { padding-left: 22px; }

.example-box {
  background: #fff8f0; border: 2px solid #ffd4b0; border-radius: 12px; padding: 14px 20px;
}
.example-box.red { background: #fdf2f2; border-color: #f5a9a9; }
.example-box .ex-label {
  font-size: 16px; font-weight: 800; color: var(--accent); letter-spacing: 0.1em; margin-bottom: 8px;
}
.example-box.red .ex-label { color: #c0392b; }
.example-box p { font-size: 21px; line-height: 1.65; }

.alert {
  border-radius: 10px; padding: 14px 20px; font-size: 21px; line-height: 1.55;
  display: flex; gap: 12px; align-items: flex-start;
}
.alert.red    { background: #fdecea; border-left: 6px solid var(--danger); }
.alert.yellow { background: #fffbea; border-left: 6px solid var(--warning); }
.alert.green  { background: #eafaf1; border-left: 6px solid var(--success); }
.alert.blue   { background: #eaf3fb; border-left: 6px solid var(--primary); }
.alert.crimson{ background: #fbeaea; border-left: 6px solid #a93226; border-top: 2px solid #f1c0c0; }
.alert-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }

.info-table { width: 100%; border-collapse: collapse; font-size: 20px; }
.info-table th {
  background: var(--primary); color: white;
  padding: 10px 16px; text-align: left; font-size: 19px;
}
.info-table th.intl { background: #7b241c; }
.info-table th.grades { background: #145a32; }
.info-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.info-table tr:nth-child(even) td { background: #f8fafc; }

.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  background: var(--primary); color: white;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-num.crimson { background: #a93226; }
.step-content h4 { font-size: 22px; font-weight: 700; margin-bottom: 3px; color: var(--primary); }
.step-content h4.intl { color: #7b241c; }
.step-content h4.grades { color: #145a32; }
.step-content p  { font-size: 19px; color: #666; line-height: 1.5; }

.tag-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  background: #e8eef8; color: var(--primary);
  font-size: 20px; padding: 6px 16px; border-radius: 20px; font-weight: 600;
}
.tag.red    { background: #fde; color: #c0392b; }
.tag.green  { background: #e3f9e5; color: #1e8449; }
.tag.orange { background: #fef0e0; color: #ca6f1e; }
.tag.crimson{ background: #fbeaea; color: #7b241c; }

.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
strong { color: var(--primary); }
strong.red { color: #c0392b; }

/* ===== NAVBAR ===== */
#navBar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 56px;
  background: white; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.1); z-index: 100;
}
.nav-btn {
  background: var(--primary); color: white; border: none; border-radius: 50px;
  padding: 9px 26px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: background 0.2s;
}
.nav-btn:hover { background: #2d6a9f; }
.nav-btn:disabled { background: #ccc; cursor: not-allowed; }
.nav-btn.sec { background: white; color: var(--primary); border: 2px solid var(--primary); }
.nav-btn.sec:hover { background: #f0f4f9; }
.nav-btn.intl-mode     { background: #8b1a1a; }
.nav-btn.intl-mode:hover { background: #a93226; }
.nav-btn.sec.intl-mode { background: white; color: #8b1a1a; border-color: #8b1a1a; }
.nav-btn.grades-mode     { background: #1a7a4a; }
.nav-btn.grades-mode:hover { background: #1e8449; }
.nav-btn.sec.grades-mode { background: white; color: #1a7a4a; border-color: #1a7a4a; }
.nav-btn.expulsion-mode     { background: #6d2b00; }
.nav-btn.expulsion-mode:hover { background: #b94a00; }
.nav-btn.sec.expulsion-mode { background: white; color: #6d2b00; border-color: #6d2b00; }
.nav-btn.student-life-mode     { background: #0d5c63; }
.nav-btn.student-life-mode:hover { background: #1e8898; }
.nav-btn.sec.student-life-mode { background: white; color: #0d5c63; border-color: #0d5c63; }

.progress-dots { display: flex; gap: 5px; align-items: center; }
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: #ccc;
  transition: all 0.2s; cursor: pointer;
}
.dot.active { background: var(--accent); width: 18px; border-radius: 4px; }
.dot.active.intl-mode { background: #a93226; }
.dot.active.grades-mode { background: #1e8449; }
.dot.active.expulsion-mode { background: #b94a00; }
.dot.active.student-life-mode { background: #0d5c63; }
.dot:hover { background: var(--primary); }

/* ===== MENU ===== */
.menu-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
}
.menu-panel {
  position: absolute; top: 0; right: 0;
  width: 300px; height: 100%;
  background: white; overflow-y: auto; padding-bottom: 20px;
}
.menu-head {
  background: var(--primary); color: white;
  padding: 14px 18px; font-size: 14px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.menu-head.intl { background: #7b241c; }
.menu-head.grades { background: #145a32; }
.menu-head.expulsion { background: #6d2b00; }
.menu-head.student-life { background: #0d5c63; }
.menu-close { background: none; border: none; color: white; font-size: 18px; cursor: pointer; }
.menu-cat { padding: 10px 18px 4px; font-size: 11px; font-weight: 700; color: #aaa; letter-spacing: 0.1em; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  cursor: pointer; font-size: 13px; transition: background 0.15s;
  border-left: 3px solid transparent;
}
.menu-item:hover { background: #f0f4f9; }
.menu-item.active { border-left-color: var(--accent); background: #fff5f0; font-weight: 700; color: var(--primary); }
.menu-item.active.intl { border-left-color: #c0392b; background: #fdf2f2; color: #7b241c; }
.menu-item.active.grades { border-left-color: #1e8449; background: #f0faf4; color: #145a32; }
.menu-item.active.expulsion { border-left-color: #b94a00; background: #fff5ee; color: #6d2b00; }
.menu-item .mn { color: #bbb; font-size: 12px; width: 22px; }

/* 緊急バッジ */
.badge-urgent {
  display: inline-block; background: #c0392b; color: white;
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 10px;
  margin-left: 6px; vertical-align: middle; letter-spacing: 0.05em;
}

/* ===== MOBILE (≤767px) ===== */
@media (max-width: 767px) {
  html, body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Chrome を sticky に */
  #chrome {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  header {
    height: auto;
    min-height: 44px;
    padding: 6px 12px;
  }
  header h1 { font-size: 13px; }
  .header-sub { display: none; }
  .slide-counter { font-size: 11px; padding: 2px 8px; }
  .menu-toggle { padding: 3px 10px; font-size: 11px; }

  /* セット切替バー：横スクロール・折り返しなし */
  #setBar {
    height: auto;
    padding: 6px 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    gap: 6px;
  }
  #setBar::-webkit-scrollbar { display: none; }
  .set-btn { flex-shrink: 0; height: 28px; padding: 0 10px; font-size: 11px; }
  .set-label { display: none; }
  .quiz-dropdown-wrap { margin-left: 0; flex-shrink: 0; }
  .quiz-drop-btn { height: 28px; padding: 0 10px; font-size: 11px; }

  /* カテゴリバー */
  .category-bar { height: auto; padding: 4px 8px; }
  .cat-btn { height: 26px; padding: 0 10px; font-size: 11px; }

  /* Stage：通常フローに戻してページ全体をスクロール */
  #stage {
    position: static;
    top: auto; bottom: auto; left: auto; right: auto;
    height: auto;
    overflow: visible;
    display: block;
    background: #1a2a3a;
    padding-bottom: 64px;
  }

  /* Scaler：固定サイズ・変形を解除 */
  #scaler {
    width: 100%;
    height: auto;
    transform: none !important;
    position: static;
  }

  /* スライド：縦並びで全幅表示 */
  .slide {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: column;
    animation: none;
  }
  .slide.active { display: flex; }

  /* 左パネル：コンパクトなタイトル帯 */
  .slide-left {
    width: 100%;
    padding: 14px 16px 12px;
    justify-content: flex-start;
    gap: 4px;
  }
  .slide-left::before, .slide-left::after { display: none; }
  .slide-num { display: none; }
  .slide-tag { font-size: 12px; padding: 3px 10px; }
  .slide-title { font-size: 20px; }
  .slide-subtitle { font-size: 12px; margin-top: 4px; }
  .slide-left-bottom { display: none; }
  .slide-qr { display: none; }

  /* 右パネル */
  .slide-right {
    overflow-y: visible;
    padding: 14px 14px 18px;
    justify-content: flex-start;
    height: auto;
  }

  /* テキストサイズ */
  h2 { font-size: 17px; }
  p { font-size: 15px; }

  /* グリッドを1列に */
  .two-col, .three-col { grid-template-columns: 1fr; }

  /* カード */
  .info-card { padding: 12px 14px; }
  .info-card .card-icon { font-size: 24px !important; }
  .info-card h3 { font-size: 15px; }
  .info-card p, .info-card li { font-size: 14px; }

  /* アラート */
  .alert { font-size: 14px; padding: 10px 12px; }
  .alert-icon { font-size: 18px; }

  /* テーブル：横スクロール可能に */
  .info-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
  }
  .info-table th { padding: 6px 8px; font-size: 12px; }
  .info-table td { padding: 7px 8px; }

  /* その他 */
  .tag { font-size: 13px; padding: 4px 10px; }
  .example-box p { font-size: 15px; }
  .step-content h4 { font-size: 16px; }
  .step-content p { font-size: 14px; }

  /* ナビゲーションバー */
  #navBar {
    height: auto;
    padding: 8px 16px;
  }
  .nav-btn { padding: 7px 18px; font-size: 12px; }
  .progress-dots { display: none; }
}
