:root {
  --bg: #faf8ff;
  --surface: #ffffff;
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --primary-light: #ede9fe;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
  --shadow-lg: 0 8px 24px rgba(139, 92, 246, 0.15);
  --radius: 16px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ======== Header ======== */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.85);
}
.app-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  flex: 1;
}
.back-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
}
.back-btn:hover { background: var(--primary-light); }

/* ======== Home: 教材一覧 ======== */
.hero {
  text-align: center;
  padding: 32px 0 24px;
}
.hero-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}
.hero-logo {
  display: block;
  width: 320px;
  max-width: 90%;
  height: auto;
  margin: 0 auto 12px;
}
.hero-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.filter-bar {
  display: flex;
  gap: 8px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.filter-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: var(--text);
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.lesson-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.lesson-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.lesson-level {
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}
.lesson-new {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #d97706;
  font-weight: 700;
  font-size: 11px;
}
.lesson-card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 4px 0;
  line-height: 1.4;
}
.lesson-card-scene {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lesson-card-meta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}

/* ======== Lesson Page ======== */
.player-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.lesson-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.lesson-title-big {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
}
.lesson-scene {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.player-main {
  background: linear-gradient(135deg, var(--primary-light), #f3e8ff);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}
.play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
  transition: transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.play-btn svg { width: 34px; height: 34px; display: block; }
.play-btn:hover { transform: scale(1.05); }
.play-btn:active { transform: scale(0.95); }
.play-btn.is-playing { background: var(--primary-dark); }

.time-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 12px;
}
.seekbar {
  flex: 1;
  height: 6px;
  background: rgba(139, 92, 246, 0.2);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.seekbar-fill {
  background: var(--primary);
  height: 100%;
  width: 0%;
  transition: width 0.1s linear;
}

/* ======== Controls ======== */
.control-section {
  margin: 16px 0;
}
.control-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.control-label svg { width: 14px; height: 14px; flex-shrink: 0; }
.control-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.control-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.control-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.control-btn:hover {
  border-color: var(--primary);
}
.control-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.control-btn.toggle.active {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.action-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ======== Text Display ======== */
.text-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.text-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.text-content {
  font-size: 16px;
  line-height: 1.8;
  margin: 0;
}
.text-content.english {
  font-family: "Georgia", -apple-system, serif;
}
.phrase-chip {
  display: inline-block;
  background: #fef3c7;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px;
  font-size: 13px;
}

.phrase-group-label { font-size: 13px; font-weight: 700; color: var(--text-muted); margin: 14px 0 8px; }
.phrase-group-label:first-child { margin-top: 0; }
.phrase-note { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.phrase-note summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; font-family: "Georgia", -apple-system, serif; }
.phrase-note summary::-webkit-details-marker { display: none; }
.phrase-note summary .phrase-text { flex: 1; }
.phrase-note summary::after { content: "▼"; font-size: 11px; color: var(--text-muted); transition: transform .2s; }
.phrase-note[open] summary::after { transform: rotate(180deg); }
.phrase-note[open] summary { border-bottom: 1px dashed var(--border); }
.phrase-note .phrase-body { padding: 10px 14px 14px; font-size: 14px; line-height: 1.8; }
.phrase-note .phrase-point { font-weight: 700; margin: 0 0 4px; }
.phrase-note .phrase-body p { margin: 0 0 4px; }
.phrase-note .phrase-body ul { margin: 4px 0; padding-left: 18px; }
.phrase-note .phrase-example { margin-top: 6px; padding: 8px 10px; background: #f5f3ff; border-radius: 8px; font-size: 13px; }

/* ======== Footer ======== */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 24px 0;
}
.app-footer a { color: var(--primary); text-decoration: none; }

/* ======== Login / Auth ======== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
}
.auth-logo {
  text-align: center;
  font-size: 32px;
  margin-bottom: 4px;
}
.auth-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
}
.auth-sub {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 24px;
}
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* ======== Custom select (app-style dropdown, replaces native <select>) ======== */
.custom-select { position: relative; }
.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus {
  outline: none;
  border-color: var(--primary);
}
.custom-select-arrow {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.custom-select.open .custom-select-arrow { transform: rotate(180deg); }
.custom-select-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 20;
  max-height: 280px;
  overflow-y: auto;
}
.custom-select.open .custom-select-panel { display: block; }
.custom-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
}
.custom-select-option:hover { background: var(--primary-light); }
.custom-select-option.selected { color: var(--primary-dark); font-weight: 700; }
.custom-select-option .check {
  width: 14px;
  flex-shrink: 0;
  color: var(--primary);
  opacity: 0;
}
.custom-select-option.selected .check { opacity: 1; }

/* ======== Custom file picker (styled label, replaces native "選択されていません") ======== */
.custom-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.custom-file-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f1f1f4;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
}
.custom-file-btn:hover { border-color: var(--primary); color: var(--primary); }
.custom-file-name {
  font-size: 13.5px;
  color: var(--text-muted);
}
.custom-file-name.has-file { color: var(--text); font-weight: 600; }

/* ======== Notice scroll box (お知らせ欄) ======== */
.notice-scroll-box {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
  margin-bottom: 16px;
}
.notice-scroll-box .item-card:last-child { margin-bottom: 0; }

/* ======== Planner calendar (提出予定日登録) ======== */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.calendar-header .control-btn { padding: 6px 14px; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.calendar-dow {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  padding: 4px 0;
}
.calendar-day {
  padding: 9px 0 6px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.calendar-day:hover { background: var(--primary-light); }
.calendar-day.selected { background: var(--primary); color: #fff; font-weight: 700; }
.calendar-day-tag {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}
.calendar-day.today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.calendar-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.chip {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 8px 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip button {
  border: none;
  background: none;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
}
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}
.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--primary-light); }
.btn-logout {
  width: 100%;
  background: var(--surface);
  color: #d9534f;
  border: 1.5px solid #d9534f;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn-logout:hover { background: #fdf1f1; }
.auth-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
}
.auth-link a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* ======== Bottom Nav (student) ======== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 10px 4px 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bottom-nav a .nav-icon { font-size: 19px; line-height: 1; }
.bottom-nav a.active { color: var(--primary); }

/* ======== Stat cards (mypage) ======== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 10px;
  text-align: center;
}
.stat-box .num { font-size: 20px; font-weight: 700; color: var(--primary); }
.stat-box .label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.period-banner {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--primary-dark);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.section-heading {
  font-size: 14px;
  font-weight: 700;
  margin: 24px 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ======== Status badges ======== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-gray { background: #f1f1f4; color: #6b7280; }
.badge-yellow { background: #fef3c7; color: #b45309; }
.badge-green { background: #d1fae5; color: #047857; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-purple { background: var(--primary-light); color: var(--primary-dark); }

/* ======== Simple list items (submission/progress) ======== */
.item-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.item-card .item-main { flex: 1; min-width: 160px; }
.item-card .item-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.item-card .item-sub { font-size: 12px; color: var(--text-muted); }

/* ======== Announcement ======== */
.notice-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 16px;
}

/* ======== Goal banner (next-submission target) ======== */
.goal-banner {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.goal-banner-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.goal-banner-text {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}
.goal-banner-text strong { color: var(--primary-dark); }

/* ======== Correction progress dots (◯/3回) ======== */
.progress-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.progress-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e5e7eb;
}
.progress-dots .dot.filled { background: var(--primary); }
.progress-dots .dot-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ======== Plan credit summary ======== */
.plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.plan-banner-label { font-size: 12.5px; color: var(--text-muted); }
.plan-banner-num { font-size: 15px; font-weight: 700; color: var(--primary-dark); margin-top: 2px; }

/* ======== Admin layout ======== */
.admin-body { background: #f7f7fb; }
.admin-header {
  background: #1f2937;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.admin-header .app-title { color: #fff; }
.admin-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.admin-nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
}
.admin-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.admin-nav a.active { background: var(--primary); color: #fff; }
.admin-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.admin-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  justify-content: space-between;
}
.admin-toolbar .filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.data-table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
table.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: #faf8ff;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: #fbfaff; }
.table-link { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 12.5px; }
.mini-input {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  width: 100%;
}

.admin-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.admin-card h3 {
  font-size: 14px;
  margin: 0 0 14px;
}
.level-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 6px;
}
.level-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.level-group-title:first-child { margin-top: 0; }

.rule-table th, .rule-table td { font-size: 12.5px; }
.rule-note {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ======== Sitemap page ======== */
.map-group {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.map-group h2 {
  font-size: 15px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.map-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.map-links a {
  display: block;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.map-links a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.map-links a .map-desc {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ======== Mobile ======== */
@media (max-width: 600px) {
  .container { padding: 16px 12px 76px; }
  .player-card, .text-card { padding: 16px; }
  .player-main { padding: 20px 12px; }
  .lesson-grid { grid-template-columns: 1fr; }
  .lesson-title-big { font-size: 20px; }
  .stat-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-box { padding: 10px 4px; }
  .admin-container { padding: 16px 12px 40px; }
}

/* ======== Radio option list ======== */
.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 8px;
  cursor: pointer;
}
.radio-option:last-child { margin-bottom: 0; }
.radio-option input[type="radio"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}
.radio-option span { flex: 1; }
