:root {
  --primary: #FF6B9D;
  --secondary: #FFD93D;
  --accent: #6BCB77;
  --bg: #FFF9F0;
  --text: #3D3D3D;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 20px;
  --font: 'Noto Sans JP', 'Noto Color Emoji', 'Hiragino Kaku Gothic ProN', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html,
body {
  height: 100%;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== TOP PAGE ===== */
.top-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  gap: 10px;
  background: linear-gradient(160deg, #FFF0F5 0%, #FFF9E0 50%, #F0FFF4 100%);
}

.top-title {
  font-size: clamp(52px, 15vw, 88px);
  font-weight: 400;
  font-family: 'Darumadrop One', cursive;
  text-align: center;
  color: var(--primary);
  text-shadow: 3px 4px 0 #FFD93D, 1px 1px 0 rgba(0, 0, 0, 0.15);
  line-height: 1.2;
  white-space: nowrap;
}

.top-subtitle {
  font-size: clamp(14px, 4vw, 20px);
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', sans-serif;
  font-weight: 700;
  color: #888;
  text-align: center;
}

.top-mascot {
  font-size: clamp(80px, 22vw, 120px);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-16px);
  }
}

.top-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.btn-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border: none;
  border-radius: 20px;
  font-size: clamp(16px, 4.5vw, 22px);
  font-weight: 900;
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Noto Color Emoji', sans-serif;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
  text-decoration: none;
  color: white;
}

.btn-main span:first-child {
  font-size: 1.6em;
}

.btn-main span:last-child {
  white-space: nowrap;
}

.btn-main:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.btn-hiragana {
  background: linear-gradient(135deg, #FF6B9D, #FF8E53);
}

.btn-katakana {
  background: linear-gradient(135deg, #4ECDC4, #44A8F0);
}

.btn-progress {
  background: linear-gradient(135deg, #A78BFA, #7C3AED);
}

.btn-game {
  background: linear-gradient(135deg, #FF9800, #FF5722);
}

.top-progress-bar {
  width: 100%;
  max-width: 360px;
  background: #f0e0f0;
  border-radius: 20px;
  height: 16px;
  overflow: hidden;
}

.top-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF6B9D, #FFD93D);
  border-radius: 20px;
  transition: width 0.5s ease;
}

.top-progress-label {
  font-size: 13px;
  color: #999;
  text-align: center;
}

/* ===== TODAY'S CHARACTER CARD ===== */
.today-char-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 360px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #FFE0EC, #FFF5C0);
  border: 3px solid var(--secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.today-char-card:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.today-char-label {
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 700;
  color: #888;
  letter-spacing: 0.05em;
}

.today-char-kana {
  font-size: clamp(48px, 14vw, 80px);
  font-weight: 900;
  font-family: var(--font);
  color: var(--primary);
  line-height: 1;
  text-shadow: 2px 3px 0 rgba(255, 107, 157, 0.18);
}

.today-char-hint {
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 700;
  color: var(--accent);
}

.today-perfect {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  padding: 24px;
  background: linear-gradient(135deg, #E8F5E9, #FFF5C0);
  border: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.today-perfect-emoji {
  font-size: 52px;
  line-height: 1;
}

.today-perfect-text {
  font-size: clamp(22px, 7vw, 32px);
  font-weight: 900;
  color: var(--accent);
}

/* ===== SELECT PAGE ===== */
.select-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

.btn-back {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  transition: background 0.1s;
  flex-shrink: 0;
}

.btn-back:active {
  background: #f0f0f0;
}

.btn-nav {
  background: none;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  flex-shrink: 0;
}

.btn-nav:active {
  background: #f0f0f0;
}

.btn-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.kana-pos {
  font-size: 12px;
  color: #aaa;
  white-space: nowrap;
  flex-shrink: 0;
}

.page-title {
  font-size: clamp(16px, 4.5vw, 22px);
  font-weight: 900;
  color: var(--text);
  flex: 1;
  text-align: center;
}

.row-label {
  font-size: clamp(11px, 3vw, 14px);
  color: #aaa;
  padding: 12px 20px 4px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.kana-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 0 12px 12px;
}

.kana-btn {
  aspect-ratio: 1;
  border: 3px solid #eee;
  border-radius: 16px;
  background: white;
  font-size: clamp(20px, 6vw, 32px);
  font-weight: 900;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
  overflow: hidden;
}

.kana-btn:active {
  transform: scale(0.93);
  box-shadow: none;
}

.kana-btn.mastered {
  background: linear-gradient(135deg, #FFF0F5, #FFF8E0);
  border-color: var(--secondary);
}

.kana-btn.mastered::after {
  content: '★';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 12px;
  color: var(--secondary);
}

/* スター別デザイン（select.html） */
.kana-btn[data-stars="2"] {
  background: linear-gradient(135deg, #FFE0A0, #FFF0C0);
  border-color: #FFA500;
}

.kana-btn[data-stars="2"]::after {
  content: '★★';
  font-size: 10px;
  color: #E07800;
}

.kana-btn[data-stars="3"] {
  background: linear-gradient(135deg, #FFF8DC, #FFF0F0, #F0FFF0);
  animation: rainbow-border 2.5s linear infinite;
}

.kana-btn[data-stars="3"]::after {
  content: '👑';
  font-size: 12px;
  color: transparent;
}

/* ===== PRACTICE PAGE ===== */
.practice-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.practice-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 16px;
}

.practice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 500px;
}

.practice-kana-label {
  font-size: clamp(24px, 8vw, 42px);
  font-weight: 900;
  color: var(--primary);
}

.practice-reading {
  font-size: clamp(14px, 4vw, 20px);
  color: #888;
}

.stars-display {
  display: flex;
  gap: 4px;
  font-size: clamp(20px, 6vw, 28px);
}

.star {
  color: #e0e0e0;
  transition: color 0.3s;
}

.star.lit {
  color: var(--secondary);
}

/* Canvas area */
.canvas-container {
  position: relative;
  width: min(90vw, 380px);
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: white;
  touch-action: none;
}

#canvas-guide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#canvas-user {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#canvas-feedback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Bottom controls */
.practice-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 500px;
}

.btn-control {
  flex: 1;
  min-width: 100px;
  max-width: 160px;
  padding: 14px 10px;
  border: none;
  border-radius: 50px;
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 900;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  color: white;
}

.btn-control:active {
  transform: scale(0.95);
}

.btn-replay {
  background: linear-gradient(135deg, #4ECDC4, #44A8F0);
}

.btn-clear {
  background: linear-gradient(135deg, #FFB347, #FF6B9D);
}

.btn-next {
  background: linear-gradient(135deg, #6BCB77, #44D7B6);
}

.btn-judge {
  background: linear-gradient(135deg, #A78BFA, #7C3AED);
}

.btn-control:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: default;
}

/* Stroke counter */
.stroke-counter {
  font-size: clamp(13px, 3.5vw, 16px);
  color: #aaa;
  text-align: center;
}

/* Feedback banner */
.feedback-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: white;
  border-radius: 24px;
  padding: 24px 40px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.feedback-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.feedback-emoji {
  font-size: 56px;
}

.feedback-text {
  font-size: 28px;
  font-weight: 900;
  margin-top: 8px;
}

.feedback-ok {
  color: var(--accent);
}

.feedback-ng {
  color: var(--primary);
}

/* Confetti overlay */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

/* ===== PROGRESS PAGE ===== */
.progress-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.progress-body {
  flex: 1;
  padding: 16px;
}

.progress-section {
  margin-bottom: 24px;
}

.progress-section-title {
  font-size: clamp(16px, 5vw, 20px);
  font-weight: 900;
  color: var(--text);
  padding: 8px 4px;
  border-bottom: 3px solid var(--secondary);
  margin-bottom: 12px;
}

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
}

.stamp-item {
  aspect-ratio: 1;
  background: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border: 2px solid #eee;
  color: #ccc;
}

.stamp-item.mastered {
  background: linear-gradient(135deg, #FFF5E0, #FFFAE0);
  border-color: var(--secondary);
  color: var(--text);
  position: relative;
}

.stamp-item.mastered::after {
  content: '★';
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 10px;
  color: var(--secondary);
}

/* ── スター別シールデザイン ── */
/* ★★ (2 stars) */
.stamp-item[data-stars="2"] {
  background: linear-gradient(135deg, #FFE0A0, #FFF0C0, #FFD880);
  border-color: #FFA500;
  border-width: 2px;
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.35);
}

.stamp-item[data-stars="2"]::after {
  content: '★★';
  font-size: 9px;
  color: #E07800;
}

/* ★★★ (3 stars) — レインボー枠 + 王冠バッジ */
.stamp-item[data-stars="3"] {
  background: linear-gradient(135deg, #FFF8DC, #FFF0F0, #F0FFF0);
  border: 2.5px solid transparent;
  background-clip: padding-box;
  position: relative;
  box-shadow: 0 0 0 2.5px transparent, 0 3px 10px rgba(0, 0, 0, 0.12);
  animation: rainbow-border 2.5s linear infinite;
}

.stamp-item[data-stars="3"]::after {
  content: '👑';
  font-size: 11px;
  bottom: 0px;
  right: 2px;
  /* override color so emoji renders naturally */
  color: transparent;
  text-shadow: none;
  filter: none;
}

@keyframes rainbow-border {
  0% {
    box-shadow: 0 0 0 2.5px #FF6B9D, 0 3px 10px rgba(0, 0, 0, 0.12);
  }

  16% {
    box-shadow: 0 0 0 2.5px #FF8E53, 0 3px 10px rgba(0, 0, 0, 0.12);
  }

  33% {
    box-shadow: 0 0 0 2.5px #FFD93D, 0 3px 10px rgba(0, 0, 0, 0.12);
  }

  50% {
    box-shadow: 0 0 0 2.5px #6BCB77, 0 3px 10px rgba(0, 0, 0, 0.12);
  }

  66% {
    box-shadow: 0 0 0 2.5px #4ECDC4, 0 3px 10px rgba(0, 0, 0, 0.12);
  }

  83% {
    box-shadow: 0 0 0 2.5px #A78BFA, 0 3px 10px rgba(0, 0, 0, 0.12);
  }

  100% {
    box-shadow: 0 0 0 2.5px #FF6B9D, 0 3px 10px rgba(0, 0, 0, 0.12);
  }
}

/* ── ストリーク（れんぞくれんしゅう）バッジ ── */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #FF8E53, #FF6B9D);
  color: white;
  border-radius: 50px;
  padding: 8px 20px;
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(255, 107, 157, 0.35);
  margin-bottom: 12px;
  animation: streak-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes streak-pop {
  from {
    transform: scale(0.7);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.total-badge {
  background: linear-gradient(135deg, var(--primary), #FF8E53);
  color: white;
  border-radius: 50px;
  padding: 12px 24px;
  text-align: center;
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 900;
  margin-bottom: 16px;
}

/* ===== LOADING ===== */
.loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  z-index: 999;
  animation: fadeOut 0.3s 0.5s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    pointer-events: none;
  }
}

/* Responsive tweaks */
@media (min-width: 600px) {
  .kana-grid {
    grid-template-columns: repeat(5, 1fr);
    max-width: 500px;
    margin: 0 auto;
  }

  .practice-body {
    justify-content: center;
  }
}

/* ===== GAME TYPE SELECT ===== */
.type-select-body {
  justify-content: center;
  gap: 28px;
}

.type-select-prompt {
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.type-select-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-type-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: clamp(130px, 38vw, 170px);
  padding: 20px 12px;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn-type-select:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.btn-type-hiragana {
  background: linear-gradient(135deg, #FF6B9D, #FF8FAB);
  color: white;
}

.btn-type-katakana {
  background: linear-gradient(135deg, #4ECDC4, #44A8F0);
  color: white;
}

.btn-type-both {
  background: linear-gradient(135deg, #A78BFA, #7C3AED);
  color: white;
}

.type-select-kana {
  font-size: clamp(26px, 8vw, 40px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.05em;
}

.type-select-label {
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 700;
}

/* ===== GAME PAGE ===== */
.game-emoji {
  font-family: 'Noto Color Emoji', sans-serif;
  font-size: clamp(72px, 22vw, 120px);
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
}

.game-char-cards {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.char-card {
  width: clamp(44px, 14vw, 64px);
  height: clamp(44px, 14vw, 64px);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 7vw, 36px);
  font-weight: 900;
  font-family: var(--font);
  border: 3px solid;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.char-card.todo {
  background: #f5f5f5;
  border-color: #ddd;
  color: #bbb;
}

.char-card.active {
  background: linear-gradient(135deg, #FFF0F5, #FFE0FF);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.12);
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.25);
}

.char-card.done {
  background: linear-gradient(135deg, #E8F5E9, #F0FFF4);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-next-word {
  align-self: center;
}

.btn-guide-toggle {
  background: linear-gradient(135deg, #90A4AE, #607D8B);
}

.btn-guide-toggle.active {
  background: linear-gradient(135deg, #FFB300, #FF8F00);
}

.btn-mute {
  background: none;
  border: none;
  font-size: 22px;
  font-family: 'Noto Color Emoji', sans-serif;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  opacity: 0.7;
  transition: opacity 0.15s;
  line-height: 1;
  flex-shrink: 0;
}

.btn-mute:active {
  opacity: 1;
}

/* ===== 保護者設定リンク（トップページ） ===== */
.top-parent-link {
  font-size: 11px;
  color: #bbb;
  text-decoration: none;
  text-align: center;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.15s;
  letter-spacing: 0.02em;
}

.top-parent-link:active {
  color: #999;
}

/* ===== 保護者設定ページ ===== */
.parent-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* PIN入力オーバーレイ */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 249, 240, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 200;
}

.pin-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  text-align: center;
}

.pin-dots {
  display: flex;
  gap: 14px;
}

.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: white;
  transition: background 0.15s, border-color 0.15s;
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
}

@keyframes pin-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(6px);
  }
}

.pin-dots.shake {
  animation: pin-shake 0.4s ease;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 10px;
}

.pin-key {
  height: 72px;
  border: 2px solid #e0e0e0;
  border-radius: 16px;
  background: white;
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.1s, background 0.1s;
}

.pin-key:active {
  transform: scale(0.93);
  background: #f5f5f5;
}

.pin-key.del {
  font-size: 18px;
  color: #999;
}

.pin-error {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  min-height: 18px;
  text-align: center;
}

/* 設定ページ本体 */
.settings-page {
  display: none;
  flex-direction: column;
  flex: 1;
}

.parent-body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 32px;
}

.parent-section {
  background: white;
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.parent-section-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 8px;
}

.parent-notice {
  font-size: 12px;
  color: #888;
  background: #FFF9E0;
  border: 1px solid #FFD93D;
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.6;
}

/* 難易度ボタン */
.difficulty-group {
  display: flex;
  gap: 8px;
}

.difficulty-btn {
  flex: 1;
  padding: 10px 4px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: white;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  color: #999;
  line-height: 1.3;
}

.difficulty-btn.active {
  border-color: var(--primary);
  background: #FFF0F5;
  color: var(--primary);
}

/* 文字行トグル */
.row-toggle-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.row-toggle-btn {
  padding: 8px 2px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: white;
  font-size: 16px;
  font-weight: 900;
  font-family: var(--font);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
  color: var(--text);
  line-height: 1.2;
}

.row-toggle-btn small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: #aaa;
}

.row-toggle-btn.enabled {
  border-color: var(--accent);
  background: #F0FFF4;
}

.row-toggle-btn.disabled {
  opacity: 0.4;
}

/* ON/OFFスイッチ */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.toggle-sublabel {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ddd;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(20px);
}

/* アクションボタン */
.btn-reset {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #FF6B9D, #FF8E53);
  color: white;
  font-size: 15px;
  font-weight: 900;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s;
}

.btn-reset:active {
  transform: scale(0.97);
}

.btn-change-pin {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  background: white;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  color: #888;
  margin-top: 10px;
  transition: border-color 0.15s;
}

.btn-change-pin:active {
  border-color: var(--primary);
}

.action-result {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  min-height: 20px;
  margin-top: 8px;
}

/* ===== SESSION BREAK MODAL ===== */
.session-break-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  animation: modal-fade-in 0.25s ease;
}
@keyframes modal-fade-in { from { opacity:0 } to { opacity:1 } }

.session-break-inner {
  background: linear-gradient(160deg, #FFF0F5 0%, #FFFDE0 60%, #F0FFF4 100%);
  border-radius: 32px;
  padding: 36px 28px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  width: min(90vw, 340px);
  box-shadow: 0 12px 48px rgba(0,0,0,0.25);
  text-align: center;
}
.session-break-mascot { font-size: 72px; animation: bounce 1.5s ease-in-out infinite; }
.session-break-title  { font-size: clamp(22px,7vw,30px); font-weight:900; line-height:1.4; }
.session-break-title span { color: var(--primary); font-size: 1.2em; }
.session-break-sub    { font-size: clamp(15px,4vw,18px); font-weight:900; color:#FF8E53; min-height:24px; }
.session-break-buttons { display:flex; flex-direction:column; gap:12px; width:100%; }

.btn-session-continue {
  width:100%; padding:18px; border:none; border-radius:50px;
  background: linear-gradient(135deg,#6BCB77,#44D7B6); color:white;
  font-size: clamp(18px,5vw,22px); font-weight:900; font-family:var(--font); cursor:pointer;
  box-shadow: 0 4px 14px rgba(107,203,119,0.4);
  transition: transform 0.1s;
}
.btn-session-continue:active { transform: scale(0.96); }

.btn-session-end {
  width:100%; padding:16px; border:2px solid #e0e0e0; border-radius:50px;
  background:white; color:#888;
  font-size: clamp(16px,4.5vw,20px); font-weight:900; font-family:var(--font); cursor:pointer;
  transition: transform 0.1s, border-color 0.1s;
}
.btn-session-end:active { transform:scale(0.96); border-color:var(--primary); }

/* ===== DAILY LIMIT BUTTONS (parent.html) ===== */
.limit-btn-group {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.limit-btn {
  flex: 1; min-width: 56px; padding: 10px 8px;
  border: 2px solid #e0e0e0; border-radius: 12px;
  background: white; color: #666;
  font-size: 13px; font-weight: 700; font-family: var(--font); cursor: pointer;
  transition: all 0.15s;
}
.limit-btn.active {
  border-color: var(--primary); background: var(--primary); color: white;
}
.parent-sublabel {
  font-size: 12px; color: #aaa; margin-top: -4px; margin-bottom: 4px;
}