@import url('https://fonts.googleapis.com/css2?family=Bowlby+One&family=Inter:wght@400;500;700&family=Klee+One:wght@400;600&family=M+PLUS+Rounded+1c:wght@500;700;800;900&display=swap');

/* =============================================
   🎨 Slush Design System — CSS Custom Properties
   ============================================= */
:root {
  /* === いちごドリル風 カラーパレット === */
  --color-carbon: #3d2929;           /* 温かみのあるダークブラウン（いちごドリル採用色） */
  --color-paper-white: #ffffff;      /* 純白カード・コンポーネント背景 */
  --color-sky-wash: #faf7f2;         /* ぬくもりのあるアイボリー・ミルキーホワイト背景 */
  --color-concrete-gray: #f5ede2;    /* 優しいベージュ */
  --color-soft-mist: #fffdf9;        /* ふんわりミルキー色 */
  --color-electric-blue: #4cb1bf;    /* やさしいスカイアクア */
  --color-mint-pop: #48bb78;         /* フレッシュミントグリーン */
  --color-lavender: #f3e8ff;         /* パステルラベンダー */
  --color-ember: #ff5e7e;            /* いちごストロベリーピンク（メインアクセント） */
  --color-sunburst: #ffcc33;         /* 温かいサンシャインイエロー */
  --color-voltage-violet: #9f7aea;   /* やさしいバイオレット */
  --color-coral-orange: #fda359;     /* 元気なオレンジ */

  /* === 互換カラー === */
  --primary-color: #ff5e7e;
  --secondary-color: #48bb78;
  --accent-yellow: #ffcc33;
  --accent-purple: #9f7aea;
  --accent-orange: #fda359;
  --bg-gradient: #faf7f2;
  --card-bg: #ffffff;
  --text-dark: #3d2929;
  --text-muted: #786060;

  /* === フォント === */
  --font-display: 'M PLUS Rounded 1c', 'Bowlby One', ui-sans-serif, system-ui, sans-serif;
  --font-ui: 'M PLUS Rounded 1c', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-hira: "UD デジタル 教科書体 N-R", "UD Digital Kyokasho-tai", "Yu Kyokasho", "游教科書体", "HG教科書体", "Klee One", "BIZ UDPGothic", sans-serif;

  /* === いちごドリル風 ふんわりソフトシャドウ === */
  --shadow-sm: 0 2px 8px rgba(61, 41, 41, 0.05);
  --shadow-md: 0 6px 16px rgba(61, 41, 41, 0.08);
  --shadow-card: 0 8px 24px rgba(61, 41, 41, 0.08);
  --shadow-card-hover: 0 16px 36px rgba(61, 41, 41, 0.14);

  /* === ボーダーラディウス === */
  --border-radius-lg: 24px;
  --border-radius-md: 18px;
  --border-radius-sm: 12px;
  --radius-pill: 999px;
  --radius-card: 22px;
  --radius-card-elevated: 28px;

  /* === 余白 === */
  --spacing-4: 4px;
  --spacing-8: 8px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-20: 20px;
  --spacing-24: 24px;
  --spacing-32: 32px;
  --spacing-40: 40px;
  --spacing-48: 48px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: 'M PLUS Rounded 1c', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-sky-wash);
  min-height: 100vh;
  color: var(--color-carbon);
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* 背景デコレーション */
.bg-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  font-size: 48px;
  opacity: 0.45;
  animation: floatCloud 25s linear infinite;
}

.cloud-1 { top: 8%; left: -10%; animation-duration: 35s; }
.cloud-2 { top: 25%; left: -15%; animation-duration: 45s; animation-delay: 10s; font-size: 64px; }
.cloud-3 { top: 60%; left: -10%; animation-duration: 30s; animation-delay: 5s; }

@keyframes floatCloud {
  0% { transform: translateX(-10vw); }
  100% { transform: translateX(110vw); }
}

.floating-star {
  position: absolute;
  font-size: 28px;
  animation: twinkle 3s ease-in-out infinite alternate;
}

.star-1 { top: 12%; right: 10%; animation-delay: 0.5s; font-size: 36px; }
.star-2 { top: 40%; left: 5%; animation-delay: 1.2s; }
.star-3 { top: 75%; right: 8%; animation-delay: 2s; font-size: 40px; }
.star-4 { top: 85%; left: 8%; animation-delay: 1.5s; font-size: 34px; }

@keyframes twinkle {
  0% { transform: scale(0.9) rotate(-10deg); opacity: 0.6; }
  100% { transform: scale(1.15) rotate(15deg); opacity: 1; }
}

/* ===== Slush Marquee Banner ===== */
.slush-marquee {
  background: var(--color-carbon);
  color: var(--color-paper-white);
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
  border-bottom: 1px solid #000;
  z-index: 200;
  position: relative;
}

.slush-marquee-inner {
  display: inline-flex;
  gap: 0;
  animation: marqueeScroll 22s linear infinite;
}

.slush-marquee-text {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.032em;
  text-transform: uppercase;
  padding-right: 60px;
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== いちごドリル風 Header ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid #f6eee4;
  padding: 10px 20px 8px;
  box-shadow: 0 4px 16px rgba(61, 41, 41, 0.04);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-area:hover {
  transform: scale(1.04);
}

.logo-icon {
  font-size: 36px;
  animation: bounceSlow 2s infinite ease-in-out;
}

@keyframes bounceSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.main-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 23px;
  font-weight: 900;
  color: #3d2929;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.sub-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #8c7878;
  letter-spacing: 0.02em;
}

/* 科目トグル (えいご / ひらがな) */
.subject-toggle-wrapper {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 30px;
  border: 2px solid #e2e8f0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.subject-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 24px;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  color: #64748b;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.subject-btn.active {
  background: #ff6b6b;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(255, 107, 107, 0.4);
  transform: scale(1.04);
}

#btnHiragana.active {
  background: linear-gradient(135deg, #4ecdc4, #2ecc71);
  box-shadow: 0 3px 10px rgba(46, 204, 113, 0.4);
}

.star-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-sunburst);
  border: 1px solid var(--color-carbon);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 18px;
  font-weight: 900;
  color: var(--color-carbon);
}

.star-icon {
  font-size: 22px;
}

/* カテゴリナビゲーション */
.category-nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--color-carbon);
  border-radius: var(--radius-pill);
  background: var(--color-paper-white);
  color: var(--color-carbon);
  font-family: var(--font-ui), 'M PLUS Rounded 1c', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
  letter-spacing: 0.02em;
  box-shadow: none;
}

.nav-btn:hover {
  background: var(--color-soft-mist);
  transform: none;
}

.nav-btn.active {
  background: var(--color-carbon);
  color: var(--color-paper-white);
  border-color: var(--color-carbon);
  box-shadow: none;
  transform: none;
}

/* ====================================================
   🍔 左側ハンバーガーメニュー ＆ スライドインドロワー
   ==================================================== */
.hamburger-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 16px;
  color: #9a3412;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(251, 146, 60, 0.15);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  user-select: none;
}

.hamburger-menu-btn:hover {
  background: #fff7ed;
  border-color: #f97316;
  color: #ea580c;
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(251, 146, 60, 0.25);
}

.hamburger-menu-btn:active {
  transform: scale(0.96);
}

.hamburger-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 20px;
  height: 18px;
}

.hamburger-bar {
  width: 100%;
  height: 2.5px;
  background: currentColor;
  border-radius: 3px;
  transition: all 0.25s ease;
}

.hamburger-menu-btn.active .hamburger-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger-menu-btn.active .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.hamburger-menu-btn.active .hamburger-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ドロワーオーバーレイ */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ドロワーメニュー本体（左側からスライドイン） */
.drawer-menu {
  position: fixed;
  top: 0;
  left: -370px;
  width: min(350px, 86vw);
  height: 100%;
  background: #ffffff;
  box-shadow: 8px 0 35px rgba(0, 0, 0, 0.18);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: left 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer-overlay.open .drawer-menu {
  left: 0;
}

/* ドロワーヘッダー */
.drawer-header {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 2px solid #f6eee4;
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.drawer-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff5e7e, #ff8da1);
  border: 2px solid #ffccd5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.drawer-brand-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 19px;
  font-weight: 900;
  color: #3d2929;
  line-height: 1.2;
}

.drawer-brand-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: #8c7878;
}

.drawer-close-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 18px;
  font-weight: 900;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.drawer-close-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: rotate(90deg);
}

/* ドロワー本文 */
.drawer-body {
  padding: 16px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* スター獲得カード */
.drawer-star-card {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 2px solid #fde68a;
  border-radius: 18px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.12);
}

.drawer-star-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-star-icon {
  font-size: 28px;
  animation: bounceSlow 2s infinite ease-in-out;
}

.drawer-star-info {
  display: flex;
  flex-direction: column;
}

.drawer-star-label {
  font-size: 11px;
  font-weight: 800;
  color: #92400e;
}

.drawer-star-val {
  font-size: 20px;
  font-weight: 900;
  color: #b45309;
}

/* セクションタイトル */
.drawer-section-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 12.5px;
  font-weight: 900;
  color: #8c7878;
  letter-spacing: 0.04em;
  margin: 6px 0 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* リンクアイテム一覧 */
.drawer-links-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.drawer-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fdfaf6;
  border: 2px solid #f6eee4;
  border-radius: 16px;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 800;
  color: #3d2929;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.drawer-link-item:hover, .drawer-link-item.current {
  background: #fff5f7;
  border-color: #ffccd5;
  color: #ff477e;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(255, 94, 126, 0.12);
}

.drawer-link-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-link-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.drawer-link-texts {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.drawer-link-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.drawer-link-desc {
  font-size: 11px;
  font-weight: 600;
  color: #8c7878;
}

.drawer-arrow {
  color: #d1c4b8;
  font-size: 15px;
  font-weight: 900;
  transition: transform 0.2s;
}

.drawer-link-item:hover .drawer-arrow {
  color: #ff477e;
  transform: translateX(3px);
}

/* アクションボタングループ（ガチャ・がんばり・保存など） */
.drawer-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  text-align: left;
}

.drawer-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.drawer-action-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-action-icon {
  font-size: 20px;
}

.drawer-action-name {
  font-weight: 900;
}

/* 年齢・学年バッジボタン */
.drawer-age-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.drawer-age-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.drawer-age-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* ヘッダーのGoogleログイン・同期ボタン */
.sync-badge-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border: 2px solid #38bdf8;
  color: #0369a1;
  padding: 6px 13px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.2);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.sync-badge-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 5px 12px rgba(56, 189, 248, 0.3);
  background: #bae6fd;
}

.sync-badge-btn.synced {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border-color: #22c55e;
  color: #15803d;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.2);
}

/* ドロワーの洗練された細めスクロールバー */
.drawer-menu::-webkit-scrollbar {
  width: 6px;
}
.drawer-menu::-webkit-scrollbar-track {
  background: #faf8f5;
}
.drawer-menu::-webkit-scrollbar-thumb {
  background: #e2d9cf;
  border-radius: 10px;
}
.drawer-menu::-webkit-scrollbar-thumb:hover {
  background: #c8beb3;
}

/* スマホ時のヘッダースリム化 */
@media (max-width: 680px) {
  .hamburger-menu-btn {
    padding: 7px 10px !important;
  }

  .hamburger-menu-btn .hamburger-label {
    display: none;
  }
  
  .sub-title {
    display: none !important;
  }

  .back-home-link {
    display: inline-flex !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    gap: 4px !important;
  }

  .header-actions-desktop {
    display: none !important;
  }

  .sync-badge-btn {
    display: inline-flex !important;
    padding: 4px 8px !important;
    font-size: 11.5px !important;
    border-radius: 12px !important;
  }

  .app-header {
    padding: 8px 12px !important;
  }

  .header-container {
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }

  .logo-area {
    gap: 6px !important;
  }

  .main-title {
    font-size: 18px !important;
    white-space: nowrap !important;
  }

  .logo-icon {
    font-size: 26px !important;
  }

  .star-badge {
    padding: 3px 10px !important;
    font-size: 14px !important;
  }

  .star-icon {
    font-size: 16px !important;
  }

  .category-nav {
    padding-bottom: 2px !important;
    gap: 6px !important;
  }

  .nav-btn {
    padding: 6px 10px !important;
    font-size: 12.5px !important;
    border-radius: 12px !important;
  }

  .mini-poster-cell, .key-poster-cell {
    width: 48px !important;
    height: 58px !important;
  }

  .mini-cell-char, .key-cell-char {
    font-size: 20px !important;
  }

  .mini-cell-icon, .key-cell-icon {
    font-size: 14px !important;
  }

  .canvas-char-delete-btn {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
    top: 4px !important;
    right: 4px !important;
  }
}

#hiraganaNav .nav-btn.active {
  background: #4ecdc4;
  border-color: #2bcbba;
  box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.trace-nav-btn {
  background: linear-gradient(135deg, #ff9f43, #ffe66d) !important;
  color: #78350f !important;
  border-color: #f59e0b !important;
}

.trace-nav-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5) !important;
}

.chart-nav-btn {
  background: linear-gradient(135deg, #38ef7d, #11998e);
  color: #ffffff;
  border-color: #10ac84;
}

.chart-nav-btn.active {
  background: linear-gradient(135deg, #10ac84, #05c46b);
  box-shadow: 0 4px 14px rgba(16, 172, 132, 0.5);
}

.quiz-nav-btn {
  background: linear-gradient(135deg, #a06cd5, #ff6b6b);
  color: #ffffff;
  border-color: #8338ec;
}

.quiz-nav-btn.active {
  background: linear-gradient(135deg, #8338ec, #ff4757);
  box-shadow: 0 4px 14px rgba(131, 56, 236, 0.5);
}

.nav-emoji {
  font-size: 18px;
}

/* メインコンテンツ */
.main-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 12px;
  z-index: 10;
}

/* ====================================================
   📋 イラスト付きあいうえお表 (ポスターデザイン)
   ==================================================== */
.chart-section {
  max-width: 1060px;
  margin: 0 auto;
}

.poster-container {
  background: #fdfaf2;
  background-image: radial-gradient(#f0e6d2 1.5px, transparent 1.5px);
  background-size: 16px 16px;
  border: 8px solid #ffde59;
  border-radius: var(--border-radius-lg);
  padding: 18px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.poster-header {
  margin-bottom: 14px;
}

.poster-title {
  display: inline-block;
  background: #ffffff;
  border: 4px solid #ff9f43;
  padding: 6px 36px;
  border-radius: 30px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #e67e22;
  box-shadow: 0 4px 10px rgba(230, 126, 34, 0.2);
}

.poster-sub {
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  margin-top: 6px;
}

/* 右から左（あ行〜わ行）の本格あいうえおポスターグリッド */
.poster-board {
  display: flex;
  direction: rtl;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 12px 12px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 980px) {
  .poster-board {
    justify-content: center;
  }
}

.poster-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  direction: ltr;
}

/* 各セル */
.poster-cell {
  width: 82px;
  height: 104px;
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 6px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

.poster-cell:hover {
  transform: scale(1.08) translateY(-4px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
  border-color: #ffde59;
  z-index: 5;
}

.poster-cell:active {
  transform: scale(0.95);
}

.cell-char-box {
  flex: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 36px;
  font-weight: 700;
  font-family: var(--font-hira);
  text-shadow: 1px 2px 3px rgba(0,0,0,0.2);
  line-height: 1;
}

.cell-info-box {
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 2px 4px;
}

.cell-icon {
  font-size: 24px;
}

.cell-word {
  font-size: 11px;
  font-weight: 900;
  color: #334155;
  white-space: nowrap;
}

.cell-empty {
  width: 82px;
  height: 104px;
  background: transparent;
  border: none;
}

/* 列ごとのカラーテーマ */
.col-a .cell-char-box { background: #e74c3c; } /* あ行: 赤 */
.col-ka .cell-char-box { background: #e84393; } /* か行: ピンク */
.col-sa .cell-char-box { background: #fd79a8; } /* さ行: ライトピンク */
.col-ta .cell-char-box { background: #6c5ce7; } /* た行: 紫 */
.col-na .cell-char-box { background: #0984e3; } /* な行: 濃紺 */
.col-ha .cell-char-box { background: #00cec9; } /* は行: 水色 */
.col-ma .cell-char-box { background: #00b894; } /* ま行: 緑 */
.col-ya .cell-char-box { background: #a8e063; color: #2d3436; text-shadow: none; } /* や行: 黄緑 */
.col-ra .cell-char-box { background: #f1c40f; } /* ら行: 黄色 */
.col-wa .cell-char-box { background: #e67e22; } /* わ行: オレンジ */

/* ミニあいうえお表 (1文字＆じぶんでつくる両用) */
.char-picker-wrapper {
  overflow-x: auto;
  padding: 4px 0 10px;
  margin-bottom: 10px;
  width: 100%;
  direction: rtl;
  -webkit-overflow-scrolling: touch;
}

.poster-mini-board {
  display: flex;
  direction: rtl;
  gap: 5px;
  padding: 2px 12px;
  width: max-content;
  box-sizing: border-box;
}

@media (min-width: 720px) {
  .poster-mini-board {
    margin: 0 auto;
    justify-content: center;
  }
}

.mini-poster-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  direction: ltr;
}

.poster-mini-cell {
  width: 60px;
  height: 76px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.poster-mini-cell:hover {
  transform: scale(1.12);
  border-color: #ffde59;
  z-index: 5;
}

.poster-mini-cell:active {
  transform: scale(0.92);
}

.poster-mini-cell.active {
  transform: scale(1.18);
  border: 3px solid #ff4757;
  box-shadow: 0 0 12px rgba(255, 71, 87, 0.6);
  z-index: 10;
}

.poster-mini-cell .cell-char-box {
  font-size: 28px;
}

.poster-mini-cell .cell-icon {
  font-size: 17px;
}

.poster-mini-cell .cell-word {
  font-size: 9.5px;
}

.mini-cell-empty {
  width: 60px;
  height: 76px;
  flex-shrink: 0;
}

/* ====================================================
   ✍️ なぞり書きセクション
   ==================================================== */
.trace-section {
  max-width: 920px;
  margin: 0 auto;
}

.trace-container {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 18px 14px;
  box-shadow: var(--shadow-md);
  border: 5px solid #ff9f43;
  text-align: center;
}

.trace-submode-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  background: #f8fafc;
  padding: 6px;
  border-radius: 30px;
  border: 2px solid #e2e8f0;
}

.submode-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.submode-tab-btn.active {
  background: #ff9f43;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(255, 159, 67, 0.4);
  transform: scale(1.04);
}

.trace-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 8px;
}

.trace-target-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.target-word-icon {
  font-size: 34px;
  animation: bounceSlow 1.5s infinite;
}

.target-word-text {
  font-size: 24px;
  font-weight: 900;
  color: #1e293b;
}

.sound-bubble-btn {
  background: linear-gradient(135deg, #ffe66d, #ffd166);
  border: 2px solid #f59e0b;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 900;
  color: #78350f;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s;
  box-shadow: var(--shadow-sm);
}

.sound-bubble-btn:hover {
  transform: scale(1.05);
}

/* ====================================================
   📋 1文字モード用 あいうえお表ミニクイックピッカー
   ==================================================== */
.char-picker-wrapper {
  width: 100%;
  overflow-x: auto;
  padding: 4px 0 10px;
  margin-bottom: 12px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.poster-mini-board {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 6px;
  width: max-content;
  margin: 0 auto;
  padding: 2px 4px;
}

.mini-poster-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-poster-cell {
  width: 52px;
  height: 64px;
  background: #ffffff;
  border: 2.5px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 2px;
  user-select: none;
}

.mini-poster-cell:hover {
  transform: scale(1.12);
  border-color: #ff9f43;
  background: #fffbeb;
  z-index: 2;
}

.mini-poster-cell:active {
  transform: scale(0.92);
}

.mini-poster-cell.selected {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
  transform: scale(1.1);
  z-index: 3;
}

.mini-cell-char {
  font-family: var(--font-hira);
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
}

.mini-poster-cell.selected .mini-cell-char {
  color: #b45309;
}

.mini-cell-icon {
  font-size: 16px;
  line-height: 1;
}

.mini-cell-empty {
  width: 52px;
  height: 64px;
  visibility: hidden;
}

/* 単語選択バー */
.char-picker-scroll-wrapper {
  overflow-x: auto;
  padding: 4px 0 10px;
  margin-bottom: 10px;
  scrollbar-width: thin;
}

.word-picker {
  display: flex;
  gap: 8px;
  width: max-content;
  padding: 0 4px;
}

.word-pick-btn {
  padding: 8px 14px;
  border-radius: 14px;
  border: 3px solid #e2e8f0;
  background: #f8fafc;
  font-family: var(--font-hira);
  font-size: 16px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.word-pick-btn:hover {
  transform: scale(1.06);
  background: #fef3c7;
}

.word-pick-btn.active {
  background: #4ecdc4;
  color: #fff;
  border-color: #2bcbba;
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(78, 205, 196, 0.4);
}

/* じぶんでつくる パネル (変身ボタンツールバー付き) */
.custom-word-builder {
  background: #fdfaf2;
  border: 3px solid #ffde59;
  border-radius: var(--border-radius-md);
  padding: 14px;
  margin-bottom: 12px;
  width: 100%;
}

.custom-input-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.builder-label {
  font-size: 15px;
  font-weight: 800;
  color: #64748b;
}

.custom-word-preview-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.custom-word-preview {
  font-family: var(--font-hira);
  font-size: 28px;
  font-weight: 700;
  color: #ff4757;
  background: #ffffff;
  padding: 6px 20px;
  border-radius: 16px;
  border: 3px solid #ffde59;
  min-width: 160px;
  letter-spacing: 4px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
  text-align: center;
}

.custom-preview-clear-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  background: #ef4444;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

.custom-preview-clear-btn:hover {
  transform: scale(1.15);
  background: #dc2626;
}

.custom-preview-clear-btn:active {
  transform: scale(0.9);
}

.custom-word-preview.pop-anim {
  animation: charPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes charPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(3deg); }
  100% { transform: scale(1); }
}

/* 変身ツールバー */
.transform-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.tool-btn span {
  font-size: 18px;
  line-height: 1;
}

.tenten-btn {
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
  color: #d35400;
  border-color: #f39c12;
}

.maru-btn {
  background: linear-gradient(135deg, #fab1a0, #ff7675);
  color: #c0392b;
  border-color: #e74c3c;
}

.small-btn {
  background: linear-gradient(135deg, #81ecec, #74b9ff);
  color: #0984e3;
  border-color: #0984e3;
}

.chouon-btn {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  color: #ffffff;
  border-color: #6c5ce7;
}

.tool-btn:hover {
  transform: scale(1.08) translateY(-2px);
}

.tool-btn:active {
  transform: scale(0.92);
}

.builder-action-btn {
  padding: 8px 14px;
  border-radius: 14px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s;
}

.delete-char-btn { background: #ffeaa7; color: #d63031; }
.clear-all-btn { background: #dfe6e9; color: #2d3436; }
.builder-action-btn:hover { transform: scale(1.05); }

/* ====================================================
   ⌨️ じぶんでつくる用 キーボードあいうえお表
   ==================================================== */
.keyboard-container-wrapper {
  display: flex;
  direction: rtl;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
  padding: 6px 12px 10px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

@media (min-width: 680px) {
  .keyboard-container-wrapper {
    justify-content: center;
  }
}

.key-poster-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  direction: ltr;
}

.key-poster-cell {
  width: 52px;
  height: 64px;
  background: #ffffff;
  border: 2.5px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 2px;
  user-select: none;
}

.key-poster-cell:hover {
  transform: scale(1.12);
  border-color: #3b82f6;
  background: #eff6ff;
}

.key-poster-cell:active {
  transform: scale(0.92);
  background: #dbeafe;
}

.key-cell-char {
  font-family: var(--font-hira);
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
}

.key-cell-icon {
  font-size: 16px;
  line-height: 1;
}

.key-cell-empty {
  width: 52px;
  height: 64px;
  visibility: hidden;
}

/* マルチキャンバスエリア */
.trace-canvas-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.nav-arrow-btn {
  background: #f1f5f9;
  border: 3px solid #cbd5e1;
  color: #334155;
  font-size: 14px;
  font-weight: 900;
  padding: 12px 10px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.nav-arrow-btn span {
  font-size: 20px;
}

.nav-arrow-btn:hover {
  transform: scale(1.08);
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* マルチマスキャンバスコンテナ (最大3文字×2列の段組み対応) */
.multi-canvas-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
}

/* 4〜6文字のときに1行最大3マスで2列（2段）にするスタイル */
.multi-canvas-container.two-row-grid {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 10px;
  justify-content: center;
}

.canvas-box {
  position: relative;
  background: #ffffff;
  border: 5px solid #ffde59;
  border-radius: var(--border-radius-lg);
  box-shadow: inset 0 3px 8px rgba(0,0,0,0.06), 0 6px 18px rgba(0,0,0,0.08);
  touch-action: none;
  overflow: hidden;
}

/* 1文字 */
.single-char-box {
  width: 380px;
  height: 380px;
  max-width: 75vw;
  max-height: 75vw;
}

/* 2文字 */
.double-char-box {
  width: 220px;
  height: 220px;
  max-width: 40vw;
  max-height: 40vw;
}

/* 3文字 */
.triple-char-box {
  width: 180px;
  height: 180px;
  max-width: 28vw;
  max-height: 28vw;
}

/* 4〜6文字（3文字×2列の段組み） */
.grid-char-box {
  width: 165px;
  height: 165px;
  max-width: 26vw;
  max-height: 26vw;
}

.grid-cross-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.cross-line-h {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 0;
  border-top: 2px dashed #e2e8f0;
}

.cross-line-v {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 100%;
  border-left: 2px dashed #e2e8f0;
}

.trace-svg-guide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s;
}

.trace-svg-guide.hidden-guide {
  opacity: 0 !important;
}

.guide-stroke-path {
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s;
}

.anim-stroke-path {
  fill: none;
  stroke-width: 7.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.trace-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  color: #e2e8f0;
  user-select: none;
  pointer-events: none;
  line-height: 1;
  font-family: var(--font-hira);
  z-index: 2;
  transition: opacity 0.3s;
}

.single-char-box .trace-guide { font-size: 250px; }
.double-char-box .trace-guide { font-size: 150px; }
.triple-char-box .trace-guide { font-size: 120px; }
.grid-char-box .trace-guide { font-size: 110px; }

.trace-guide.hidden-guide {
  opacity: 0 !important;
}

.trace-canvas-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  z-index: 3;
}

.hanamaru-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.4) rotate(-10deg);
  font-size: 110px;
  pointer-events: none;
  z-index: 10;
  animation: stampPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 6px 14px rgba(255, 71, 87, 0.4));
}

/* ====================================================
   🔢 書き順（筆順）番号バッジ＆アニメーション
   ==================================================== */
.stroke-badge-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.3s;
}

.stroke-badge-layer.hidden-badges {
  opacity: 0 !important;
}

.stroke-number-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25), inset 0 -1px 2px rgba(0,0,0,0.2);
  border: 2.5px solid #ffffff;
  line-height: 1;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 6;
}

/* 今なぞる番の数字が大きくポップアップ！ */
.stroke-number-badge.highlight-active {
  transform: translate(-50%, -50%) scale(1.8) !important;
  box-shadow: 0 0 22px rgba(255, 222, 89, 1), 0 0 36px rgba(255, 107, 107, 0.8), 0 6px 14px rgba(0,0,0,0.4) !important;
  border-color: #ffde59 !important;
  z-index: 25 !important;
  animation: numberJump 0.6s infinite alternate ease-in-out !important;
}

/* 書き終わった数字 */
.stroke-number-badge.stroke-done {
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0.8;
  border-color: #2ed573;
}

@keyframes numberJump {
  0% { transform: translate(-50%, -50%) scale(1.6) rotate(-6deg); }
  100% { transform: translate(-50%, -50%) scale(1.95) rotate(6deg); }
}

.single-char-box .stroke-number-badge {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.grid-char-box .stroke-number-badge {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

/* 画数ごとの色分け */
.stroke-badge-1 { background: linear-gradient(135deg, #ff4757, #ff6b81); }
.stroke-badge-2 { background: linear-gradient(135deg, #1e90ff, #70a1ff); }
.stroke-badge-3 { background: linear-gradient(135deg, #2ed573, #7bed9f); }
.stroke-badge-4 { background: linear-gradient(135deg, #a06cd5, #e056fd); }
.stroke-badge-5 { background: linear-gradient(135deg, #ffa502, #ff7f50); }

/* なぞり書き実演中のゆび・ペンポインター */
.stroke-anim-pointer {
  position: absolute;
  pointer-events: none;
  z-index: 30;
  transform: translate(-30%, -85%);
  transition: transform 0.04s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pointer-hand-icon {
  font-size: 48px;
  filter: drop-shadow(2px 6px 10px rgba(0,0,0,0.4));
  animation: handWiggle 0.35s infinite alternate ease-in-out;
  transform-origin: 30% 90%;
}

.pointer-sparkle-dot {
  position: absolute;
  bottom: 6px;
  left: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 10%, rgba(255, 222, 89, 0.8) 60%, transparent 100%);
  box-shadow: 0 0 14px #ffe66d, 0 0 24px #ff6b6b;
  animation: glowPulse 0.3s infinite alternate;
  pointer-events: none;
}

@keyframes handWiggle {
  0% { transform: rotate(-8deg) scale(0.98); }
  100% { transform: rotate(4deg) scale(1.05); }
}

@keyframes glowPulse {
  0% { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(1.4); opacity: 1; }
}

.single-char-box .pointer-hand-icon { font-size: 56px; }
.double-char-box .pointer-hand-icon { font-size: 42px; }
.grid-char-box .pointer-hand-icon { font-size: 32px; }

/* かきじゅん実演ボタン */
.play-stroke-btn {
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
  color: #78350f;
  border: 2px solid #f59e0b;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.play-stroke-btn:hover {
  background: linear-gradient(135deg, #fdcb6e, #f39c12);
  color: #ffffff;
}

.toggle-stroke-btn {
  background: #f1f5f9;
  color: #334155;
  border: 2px solid #cbd5e1;
}

.toggle-stroke-btn.active {
  background: #0984e3;
  color: #ffffff;
  border-color: #00cec9;
  box-shadow: 0 3px 8px rgba(9, 132, 227, 0.4);
}

.single-char-box .hanamaru-stamp { font-size: 140px; }
.double-char-box .hanamaru-stamp { font-size: 100px; }
.triple-char-box .hanamaru-stamp { font-size: 80px; }
.grid-char-box .hanamaru-stamp { font-size: 75px; }

@keyframes stampPop {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-45deg); opacity: 0; }
  80% { transform: translate(-50%, -50%) scale(1.6) rotate(-5deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.4) rotate(-10deg); opacity: 1; }
}

.trace-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.color-palette {
  display: flex;
  gap: 12px;
  align-items: center;
}

.color-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.2s;
}

.color-dot.active {
  transform: scale(1.25);
  box-shadow: 0 0 14px rgba(0,0,0,0.3);
  border-color: #334155;
}

.rainbow-dot {
  background: linear-gradient(45deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff);
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.trace-btn {
  padding: 10px 20px;
  border-radius: 28px;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.toggle-guide-btn {
  background: #f1f5f9;
  color: #334155;
  border: 2px solid #cbd5e1;
}

.clear-btn {
  background: #f8fafc;
  color: #475569;
  border: 2px solid #e2e8f0;
}

.done-btn {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 71, 87, 0.4);
  font-size: 18px;
  padding: 10px 28px;
}

.trace-btn:hover { transform: scale(1.06); }
.trace-btn:active { transform: scale(0.95); }

/* 単語カード一覧 */
.section-header {
  text-align: center;
  margin-bottom: 20px;
}

.category-title {
  font-size: 26px;
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 6px;
}

.section-instruction {
  font-size: 15px;
  font-weight: 700;
  color: #64748b;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

@media (max-width: 600px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.word-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 4px solid #ffffff;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.word-card::after {
  content: "🔊 タップできいてね";
  position: absolute;
  bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  opacity: 0.8;
}

.word-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: var(--shadow-card-hover);
  border-color: #ffe66d;
}

.word-card:active {
  transform: scale(0.95);
}

.word-card.animating {
  animation: cardBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: #4ecdc4 !important;
  box-shadow: 0 0 20px rgba(78, 205, 196, 0.6);
}

@keyframes cardBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.15) rotate(4deg); }
  60% { transform: scale(0.95) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); }
}

.card-icon {
  font-size: 60px;
  margin-bottom: 8px;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
}

.word-card:hover .card-icon {
  transform: scale(1.2);
}

.card-en {
  font-family: 'Fredoka', cursive;
  font-size: 22px;
  font-weight: 700;
  color: #ff6b6b;
  margin-bottom: 2px;
  line-height: 1.1;
}

.card-ja {
  font-size: 14px;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 12px;
}

.hira-card-char {
  font-size: 48px;
  font-weight: 900;
  color: #4ecdc4;
  line-height: 1;
  margin-bottom: 4px;
  text-shadow: 2px 2px 0px #e0f2fe;
}

.hira-card-word {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 12px;
}

/* クイズ */
.quiz-section {
  max-width: 650px;
  margin: 0 auto;
}

.quiz-container {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 30px 20px;
  box-shadow: var(--shadow-md);
  border: 4px solid #a06cd5;
  text-align: center;
}

.quiz-badge {
  display: inline-block;
  background: #f3e8ff;
  color: #8338ec;
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 16px;
  margin-bottom: 12px;
}

.quiz-prompt {
  font-size: 22px;
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 16px;
}

.repeat-sound-btn {
  background: linear-gradient(135deg, #ffe66d, #ffd166);
  border: 3px solid #f59e0b;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 900;
  color: #78350f;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.repeat-sound-btn:hover { transform: scale(1.08); }
.repeat-sound-btn:active { transform: scale(0.95); }

.quiz-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 10px;
}

.quiz-choice-card {
  background: #f8fafc;
  border: 4px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 20px 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quiz-choice-card:hover {
  transform: scale(1.05);
  border-color: #a06cd5;
  background: #faf5ff;
}

.quiz-choice-card.correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  animation: correctPulse 0.5s ease-in-out;
}

.quiz-choice-card.wrong {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  animation: wrongShake 0.4s ease-in-out;
}

@keyframes correctPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* モーダル */
.result-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: #fff;
  border-radius: var(--border-radius-lg);
  padding: 36px 24px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  border: 5px solid #ffe66d;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-stars {
  font-size: 48px;
  margin-bottom: 12px;
  animation: bounceSlow 1.5s infinite;
}

.modal-title {
  font-size: 26px;
  font-weight: 900;
  color: #ff6b6b;
  margin-bottom: 8px;
}

.modal-score {
  font-size: 18px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 6px;
}

.modal-reward {
  font-size: 16px;
  font-weight: 900;
  color: #d97706;
  margin-bottom: 24px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-btn {
  padding: 14px 20px;
  border-radius: var(--border-radius-md);
  font-size: 18px;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.play-again-btn {
  background: linear-gradient(135deg, #4ecdc4, #2ecc71);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.back-home-btn {
  background: #f1f5f9;
  color: #475569;
}

.top-home-btn {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.top-home-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.45);
}

.modal-btn:hover { transform: scale(1.04); }

/* フッター */
.app-footer {
  background: rgba(255, 255, 255, 0.7);
  border-top: 2px solid #e2e8f0;
  padding: 16px;
  text-align: center;
  margin-top: auto;
  z-index: 10;
}

.parent-tip {
  font-size: 13px;
  color: #475569;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.5;
}

/* キャンバス */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

.hidden {
  display: none !important;
}

/* ====================================================
   📚 ひらがな・教科書体 フォント強化
   ==================================================== */
.hira-font,
.correct-hira-font,
.hira-card-char,
.target-word-text,
.quiz-choice-card .hira-card-char,
.mini-cell-char,
.builder-preview-char,
.col-label {
  font-family: var(--font-hira) !important;
}

/* ====================================================
   🌟 きっずランド トップポータル画面 (index.html)
   ==================================================== */
.portal-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 16px 50px;
  width: 100%;
  position: relative;
  z-index: 2;
}

.portal-hero {
  text-align: center;
  margin-bottom: 36px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #ffe66d;
  padding: 6px 18px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 900;
  color: #b45309;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.portal-hero-title {
  font-size: 34px;
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 10px;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
}

.portal-hero-sub {
  font-size: 16px;
  font-weight: 800;
  color: #475569;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 36px;
}

.portal-choice-card {
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 36px 24px 28px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 4px solid transparent;
  cursor: pointer;
}

.portal-choice-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-card-hover);
}

.portal-choice-card:active {
  transform: scale(0.98);
}

/* ひらがなカード */
.card-hira {
  border-color: #4ecdc4;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
}

.card-hira:hover {
  border-color: #2ecc71;
  box-shadow: 0 16px 32px rgba(46, 204, 113, 0.25);
}

/* 英語カード */
.card-english {
  border-color: #ff6b6b;
  background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%);
}

.card-english:hover {
  border-color: #ff4757;
  box-shadow: 0 16px 32px rgba(255, 71, 87, 0.25);
}

/* かずカード */
.card-numbers, .card-math {
  border-color: #60a5fa;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.card-numbers:hover, .card-math:hover {
  border-color: #2563eb;
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.25);
}

/* とけいカード */
.card-clock {
  border-color: #c084fc;
  background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
}

.card-clock:hover {
  border-color: #9333ea;
  box-shadow: 0 16px 32px rgba(147, 51, 234, 0.25);
}

.portal-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #ffde59;
  color: #78350f;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.portal-card-icon-wrap {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 58px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portal-choice-card:hover .portal-card-icon-wrap {
  transform: scale(1.15) rotate(6deg);
}

.card-hira .portal-card-icon-wrap {
  background: linear-gradient(135deg, #e0f2fe, #ccfbf1);
  font-family: var(--font-hira);
  font-weight: 700;
  color: #0d9488;
}

.card-english .portal-card-icon-wrap {
  background: linear-gradient(135deg, #fee2e2, #fed7aa);
}

.card-numbers .portal-card-icon-wrap, .card-math .portal-card-icon-wrap {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.card-clock .portal-card-icon-wrap {
  background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
}

.portal-card-title {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
  text-align: center;
}

.card-hira .portal-card-title {
  color: #0f766e;
  font-family: var(--font-hira);
}

.card-english .portal-card-title {
  color: #e11d48;
}

.card-numbers .portal-card-title, .card-math .portal-card-title {
  color: #1d4ed8;
}

.card-clock .portal-card-title {
  color: #7e22ce;
}

.portal-card-desc {
  font-size: 15px;
  color: #64748b;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
  font-weight: 700;
}

.portal-card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  width: 100%;
}

.portal-tag {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.portal-card-btn {
  width: 100%;
  padding: 16px 20px;
  border-radius: 30px;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.card-hira .portal-card-btn {
  background: linear-gradient(135deg, #2dd4bf, #059669);
}

.card-english .portal-card-btn {
  background: linear-gradient(135deg, #f87171, #e11d48);
}

.card-numbers .portal-card-btn, .card-math .portal-card-btn {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}

.card-clock .portal-card-btn {
  background: linear-gradient(135deg, #c084fc, #9333ea);
}

.portal-choice-card:hover .portal-card-btn {
  transform: scale(1.04);
}

/* ポータルの保護者様向けガイドエリア */
.portal-guide-card {
  background: rgba(255, 255, 255, 0.9);
  border: 3px solid #ffde59;
  border-radius: var(--border-radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.guide-icon {
  font-size: 40px;
  flex-shrink: 0;
}

.guide-text h4 {
  font-size: 16px;
  font-weight: 900;
  color: #78350f;
  margin-bottom: 4px;
}

.guide-text p {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

/* 戻るリンクボタン（個別ページ用） */
.back-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #334155;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back-home-link:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: scale(1.05);
}

.back-home-link:active {
  transform: scale(0.95);
}

/* ====================================================
   📊 きょうのがんばりカード（賞状モーダル＆ボタン）
   ==================================================== */
.report-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 2px solid #f97316;
  color: #c2410c;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(249, 115, 22, 0.2);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.report-badge-btn:hover {
  transform: scale(1.06);
  background: #ffedd5;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.3);
}

.report-badge-btn:active {
  transform: scale(0.95);
}

.report-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.certificate-card {
  background: #ffffff;
  border: 8px solid #f59e0b;
  outline: 4px solid #fef3c7;
  border-radius: 24px;
  padding: 30px 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  animation: certPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  background-image: radial-gradient(#fffbeb 15%, transparent 16%);
  background-size: 20px 20px;
}

@keyframes certPop {
  0% { transform: scale(0.7) translateY(40px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.cert-crown {
  font-size: 44px;
  margin-bottom: 4px;
  animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.cert-title {
  font-size: 26px;
  font-weight: 900;
  color: #78350f;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.cert-date {
  font-size: 14px;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 16px;
}

.cert-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.cert-stat-item {
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 16px;
  padding: 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.cert-stat-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.cert-stat-info {
  text-align: left;
}

.cert-stat-label {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}

.cert-stat-value {
  font-size: 18px;
  font-weight: 900;
  color: #ea580c;
}

.cert-stamp {
  display: inline-block;
  background: rgba(239, 68, 68, 0.08);
  border: 3px dashed #ef4444;
  color: #ef4444;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 20px;
  font-weight: 900;
  transform: rotate(-5deg);
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
  animation: stampSlam 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes stampSlam {
  0% { transform: scale(2.5) rotate(15deg); opacity: 0; }
  100% { transform: scale(1) rotate(-5deg); opacity: 1; }
}

.cert-cheer-msg {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #166534;
  margin-bottom: 20px;
}

.cert-actions-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.cert-share-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  border: none;
  font-size: 15px;
  font-weight: 900;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s;
}

.cert-share-btn:hover {
  transform: scale(1.05);
}

.cert-close-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  padding: 12px 28px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
  transition: all 0.2s;
}

.cert-close-btn:hover {
  transform: scale(1.05);
}

/* ====================================================
   📱 PWAホーム画面追加バナー＆ガイドモーダル
   ==================================================== */
.pwa-install-banner {
  background: linear-gradient(135deg, #fef3c7, #fed7aa);
  border: 2px dashed #f59e0b;
  border-radius: 20px;
  padding: 12px 18px;
  margin: 16px auto;
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15);
}

.pwa-banner-text {
  font-size: 14px;
  font-weight: 800;
  color: #92400e;
  text-align: left;
}

.pwa-banner-btn {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3);
  transition: transform 0.2s;
}

.pwa-banner-btn:hover {
  transform: scale(1.06);
}

.pwa-banner-close-btn {
  background: rgba(146, 64, 14, 0.12);
  color: #92400e;
  border: none;
  font-size: 14px;
  font-weight: 900;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.pwa-banner-close-btn:hover {
  background: rgba(146, 64, 14, 0.25);
  transform: scale(1.1);
}

.pwa-guide-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
}

.pwa-guide-card {
  background: #ffffff;
  border: 6px solid #3b82f6;
  border-radius: 24px;
  padding: 28px 22px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  animation: certPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwa-step-box {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
  text-align: left;
  font-size: 13.5px;
  color: #334155;
  font-weight: 700;
  line-height: 1.6;
}

.pwa-step-box strong {
  color: #2563eb;
}

/* ====================================================
   🔢 かず・とけい ポータルカード
   ==================================================== */
.card-math {
  border-color: #8b5cf6;
}

.card-math:hover {
  border-color: #7c3aed;
}

.card-math .portal-card-icon-wrap {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #7c3aed;
}

.card-math .portal-card-title {
  color: #5b21b6;
}

.card-math .portal-card-btn {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

/* ====================================================
   ⏰ とけいマスター（アナログ時計盤 ＆ コントロール）
   ==================================================== */
.clock-section {
  max-width: 700px;
  margin: 0 auto;
}

.clock-card {
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 30px 20px;
  box-shadow: var(--shadow-md);
  border: 4px solid #8b5cf6;
  text-align: center;
}

/* ====================================================
   🎯 とけいあわせ ゲーム目標バナー
   ==================================================== */
.clock-target-banner {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 3px solid #f59e0b;
  border-radius: 20px;
  padding: 12px 14px;
  margin: 0 auto 16px;
  max-width: 440px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  text-align: center;
}

.clock-target-title {
  font-size: 14px;
  font-weight: 900;
  color: #92400e;
  margin-bottom: 6px;
}

.clock-target-time-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

#targetSceneIcon {
  font-size: min(36px, 9vw);
  line-height: 1;
  flex-shrink: 0;
}

#targetTimeLabel {
  font-family: 'Fredoka', 'M PLUS Rounded 1c', sans-serif;
  font-size: min(36px, 8.5vw);
  font-weight: 900;
  color: #ea580c;
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}

.clock-dial-wrapper {
  position: relative;
  width: min(280px, 80vw);
  height: min(280px, 80vw);
  margin: 0 auto 20px;
}

.clock-dial {
  width: min(270px, 78vw);
  height: min(270px, 78vw);
  background: #ffffff;
  border: 10px solid #c4b5fd;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.08), 0 8px 24px rgba(139, 92, 246, 0.2);
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.clock-dial:active {
  cursor: grabbing;
}

.clock-dial.dragging .clock-hand {
  transition: none !important;
}

/* 時計のドラッグガイドバッジ */
.clock-drag-hint {
  font-size: 14px;
  font-weight: 800;
  color: #7c3aed;
  background: #f5f3ff;
  border: 2px dashed #a78bfa;
  border-radius: 20px;
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

/* 時計合わせゲーム用スタイル */
.clock-target-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 3px solid #f59e0b;
  border-radius: 24px;
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.clock-target-title {
  font-size: 16px;
  font-weight: 900;
  color: #92400e;
  margin-bottom: 4px;
}

.clock-target-time-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 32px;
  font-weight: 900;
  color: #78350f;
}

.clock-match-success-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 900;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: transform 0.2s;
  margin-top: 12px;
}

.quiz-clock-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 14px auto 18px;
  filter: drop-shadow(0 6px 14px rgba(139, 92, 246, 0.25));
  animation: clockFloat 3s ease-in-out infinite;
}

@keyframes clockFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.clock-center-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: #f59e0b;
  border: 3px solid #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.clock-number {
  position: absolute;
  width: 32px;
  height: 32px;
  line-height: 32px;
  font-size: 20px;
  font-weight: 900;
  color: #1e293b;
  text-align: center;
  transform: translate(-50%, -50%);
}

.clock-hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 10px 10px 0 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: grab;
}

.clock-hand-hour {
  width: 10px;
  height: 72px;
  background: linear-gradient(to top, #2563eb, #3b82f6);
  border: 2px solid #1d4ed8;
  margin-left: -5px;
  z-index: 7;
}

.clock-hand-hour::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: #3b82f6;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.clock-hand-minute {
  width: 6px;
  height: 105px;
  background: linear-gradient(to top, #dc2626, #ef4444);
  border: 2px solid #b91c1c;
  margin-left: -3px;
  z-index: 8;
}

.clock-hand-minute::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: #ef4444;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

.clock-hand.active-hand {
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8)) !important;
}

.clock-digital-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  color: #38bdf8;
  font-family: 'Fredoka', monospace, sans-serif;
  font-size: 32px;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  margin-bottom: 18px;
  letter-spacing: 2px;
}

.clock-speech-box {
  background: #ede9fe;
  border: 2px solid #c4b5fd;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 18px;
  font-weight: 900;
  color: #5b21b6;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  cursor: pointer;
  transition: transform 0.2s;
}

.clock-speech-box:hover {
  transform: scale(1.05);
}

.clock-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.clock-ctrl-btn {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 900;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}

.clock-ctrl-btn:hover {
  background: #ede9fe;
  border-color: #8b5cf6;
  color: #6d28d9;
  transform: scale(1.05);
}

.clock-presets-title {
  font-size: 16px;
  font-weight: 900;
  color: #475569;
  margin-bottom: 12px;
}

.clock-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.preset-scene-card {
  background: #faf5ff;
  border: 2px solid #e9d5ff;
  border-radius: 14px;
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.preset-scene-card:hover {
  transform: translateY(-3px) scale(1.04);
  border-color: #a855f7;
  background: #f3e8ff;
}

.preset-scene-icon { font-size: 26px; }
.preset-scene-time { font-size: 13px; font-weight: 900; color: #7c3aed; }
.preset-scene-label { font-size: 12px; font-weight: 800; color: #475569; }

/* ====================================================
   🔢 かずをかぞえよう（Counting 1〜10）
   ==================================================== */
.count-section {
  max-width: 700px;
  margin: 0 auto;
}

.count-card {
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
  border: 4px solid #f59e0b;
  text-align: center;
}

.count-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  background: #fffbeb;
  padding: 10px 16px;
  border-radius: 16px;
}

.count-badge {
  font-size: 16px;
  font-weight: 900;
  color: #b45309;
}

.count-meter {
  font-size: 22px;
  font-weight: 900;
  color: #d97706;
}

.count-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
  min-height: 180px;
  align-items: center;
  justify-items: center;
  padding: 20px;
  background: #fafaf9;
  border-radius: 20px;
  border: 2px dashed #e7e5e4;
}

.count-items-grid.grid-5x5 {
  grid-template-columns: repeat(5, 1fr);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  gap: 10px;
  padding: 14px;
}

.count-items-grid.grid-5x5 .count-item-btn {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  font-size: clamp(24px, 5.5vw, 36px);
  border-radius: 14px;
  border-width: 2px;
}

.count-items-grid.grid-5x5 .count-item-badge {
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  font-size: 12px;
}

.count-item-btn {
  width: 75px;
  height: 75px;
  border-radius: 20px;
  background: #ffffff;
  border: 3px solid #fed7aa;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  font-size: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.count-item-btn:hover {
  transform: scale(1.12);
  border-color: #f97316;
}

.count-item-btn.counted {
  background: #ffedd5;
  border-color: #ea580c;
  transform: scale(0.95);
}

.count-item-btn.wrong-anim {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.35) !important;
  animation: wrongShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px) rotate(-6deg); }
  40%, 80% { transform: translateX(8px) rotate(6deg); }
}

.count-wrong-cross {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #dc2626;
  background: rgba(254, 226, 226, 0.85);
  border-radius: inherit;
  pointer-events: none;
  z-index: 10;
  animation: wrongCrossPop 0.65s ease-out forwards;
}

@keyframes wrongCrossPop {
  0% { transform: scale(0.2); opacity: 0; }
  25% { transform: scale(1.25); opacity: 1; }
  65% { transform: scale(1.0); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0; }
}

.count-item-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ea580c;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.count-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ステージ選択ボタン (Lv.1〜10) */
.count-stage-picker {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.count-stage-btn {
  background: #ffffff;
  border: 2px solid #fed7aa;
  color: #c2410c;
  font-size: 13px;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.count-stage-btn:hover {
  transform: scale(1.08);
  border-color: #ea580c;
  background: #fff7ed;
}

.count-stage-btn.active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
  border-color: #ea580c;
  box-shadow: 0 3px 8px rgba(234, 88, 12, 0.35);
  transform: scale(1.06);
}

/* ダミーアイテムをタップしたときのシェイク */
.count-item-btn.shake-anim {
  animation: itemShake 0.4s ease-in-out;
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

@keyframes itemShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.count-hint-bubble {
  font-size: 15px;
  font-weight: 800;
  color: #c2410c;
  background: #fff7ed;
  border: 2px dashed #f97316;
  border-radius: 20px;
  padding: 8px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.count-next-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  padding: 12px 28px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
  transition: all 0.2s;
}

.count-next-btn:hover {
  transform: scale(1.06);
}

/* ====================================================
   🔢 大きくて押しやすい数字セレクター (1〜10)
   ==================================================== */
.number-picker-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 780px;
  margin: 0 auto 16px;
  padding: 4px;
}

@media (max-width: 650px) {
  .number-picker-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
}

.num-picker-card-btn {
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 70px;
}

.num-picker-card-btn:hover {
  transform: translateY(-3px) scale(1.08);
  border-color: #8b5cf6;
  background: #f5f3ff;
}

.num-picker-card-btn:active {
  transform: scale(0.95);
}

.num-picker-card-btn.selected {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe) !important;
  border-color: #8b5cf6 !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35) !important;
  transform: scale(1.06);
}

.num-picker-digit {
  font-family: 'Fredoka', 'M PLUS Rounded 1c', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #6d28d9;
  line-height: 1;
}

.num-picker-label {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  margin-top: 4px;
}

/* ====================================================
   ✍️ なぞり書きキャンバス用スタイル (共通)
   ==================================================== */
.canvas-workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 16px auto;
  width: 100%;
}

.canvas-multi-wrap {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.canvas-char-box {
  position: relative;
  background: #ffffff;
  border: 5px solid #ffde59;
  border-radius: 24px;
  box-shadow: inset 0 3px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
  touch-action: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-char-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: #ff4757;
  color: #ffffff;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(255, 71, 87, 0.45);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 25;
}

.canvas-char-delete-btn:hover {
  transform: scale(1.18);
  background: #ee5253;
}

.canvas-char-delete-btn:active {
  transform: scale(0.9);
}

.canvas-grid-cross {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.canvas-grid-cross::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  border-top: 2px dashed #e2e8f0;
}

.canvas-grid-cross::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  border-left: 2px dashed #e2e8f0;
}

.svg-stroke-guide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s;
}

.svg-stroke-guide.guide-hidden {
  opacity: 0 !important;
}

.guide-path {
  fill: none !important;
  stroke: #cbd5e1 !important;
  stroke-width: 7.5px !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.anim-stroke-path {
  fill: none !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.fallback-char-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 160px;
  font-weight: 700;
  color: #e2e8f0;
  user-select: none;
  pointer-events: none;
  z-index: 2;
  line-height: 1;
}

.fallback-char-guide.guide-hidden {
  opacity: 0 !important;
}

.stroke-badges-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.stroke-number-badge {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff4757;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  border: 2px solid #ffffff;
}

.trace-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  cursor: crosshair;
  touch-action: none;
}

.hanamaru-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  font-size: 120px;
  pointer-events: none;
  z-index: 10;
  animation: hanamaruPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hanamaruPop {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-20deg); opacity: 0; }
  70% { transform: translate(-50%, -50%) scale(1.15) rotate(10deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

.stroke-demo-pointer {
  position: absolute;
  font-size: 40px;
  pointer-events: none;
  z-index: 20;
  transform: translate(-20%, -80%);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  transition: transform 0.05s ease-out;
}

/* ==========================================================================
   🎁 ごほうびガチャ＆シール帳 (Gacha & Sticker Book)
   ========================================================================== */

/* ヘッダー用ボタン */
.gacha-badge-btn, .print-badge-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid #f59e0b;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(245, 158, 11, 0.2);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gacha-badge-btn:hover, .print-badge-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 12px rgba(245, 158, 11, 0.3);
}

.print-badge-btn {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  box-shadow: 0 3px 6px rgba(59, 130, 246, 0.2);
}

.print-badge-btn:hover {
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

/* ガチャモーダル */
.gacha-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gacha-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.gacha-modal-content {
  background: #ffffff;
  border-radius: 28px;
  max-width: 540px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  text-align: center;
  border: 4px solid #fde047;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gacha-modal-overlay.active .gacha-modal-content {
  transform: scale(1);
}

.modal-close-icon-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.modal-close-icon-btn:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
  transform: scale(1.1);
}

/* ガチャマシン外観 */
.gacha-machine-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 16px 0;
}

.gacha-machine-body {
  width: 220px;
  height: 250px;
  background: linear-gradient(135deg, #ff6b6b, #ee5253);
  border-radius: 110px 110px 30px 30px;
  border: 6px solid #d63031;
  position: relative;
  box-shadow: 0 10px 25px rgba(238, 82, 83, 0.4), inset 0 -10px 0 rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gacha-dome {
  width: 170px;
  height: 140px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 85px 85px 20px 20px;
  border: 4px solid #ffffff;
  margin-top: 15px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.08);
}

.gacha-mini-capsules {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  padding: 10px;
  gap: 6px;
}

.mini-cap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  animation: shakeSmall 3s ease-in-out infinite alternate;
}

.cap-red { background: linear-gradient(to bottom, #ff4757 50%, #ffffff 50%); }
.cap-blue { background: linear-gradient(to bottom, #2ed573 50%, #ffffff 50%); }
.cap-yellow { background: linear-gradient(to bottom, #ffa502 50%, #ffffff 50%); }
.cap-purple { background: linear-gradient(to bottom, #70a1ff 50%, #ffffff 50%); }
.cap-pink { background: linear-gradient(to bottom, #ff6b81 50%, #ffffff 50%); }

@keyframes shakeSmall {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(5deg); }
  100% { transform: translateY(0) rotate(-5deg); }
}

.gacha-handle-area {
  margin-top: 15px;
  position: relative;
}

.gacha-handle {
  width: 54px;
  height: 54px;
  background: #ffffff;
  border-radius: 50%;
  border: 4px solid #747d8c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gacha-handle.rotating {
  animation: spinHandle 0.8s ease-in-out;
}

@keyframes spinHandle {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.gacha-outlet {
  width: 70px;
  height: 35px;
  background: #2f3542;
  border-radius: 15px 15px 0 0;
  position: absolute;
  bottom: 0;
  border: 3px solid #d63031;
  border-bottom: none;
}

/* 排出カプセル演出 */
.gacha-dispensed-capsule {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin: 15px auto;
  border: 4px solid #ffffff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  cursor: pointer;
  animation: capsuleDrop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes capsuleDrop {
  0% { transform: translateY(-40px) scale(0.3) rotate(-90deg); opacity: 0; }
  70% { transform: translateY(10px) scale(1.1) rotate(15deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0deg); }
}

.capsule-open-effect {
  animation: capsuleBurst 0.5s ease-out forwards;
}

@keyframes capsuleBurst {
  0% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(15deg); filter: brightness(1.5); }
  100% { transform: scale(0); opacity: 0; }
}

/* シール獲得カード */
.sticker-reward-card {
  background: linear-gradient(135deg, #fef9c3, #fef08a);
  border: 3px solid #facc15;
  border-radius: 20px;
  padding: 16px;
  margin: 12px auto;
  max-width: 320px;
  box-shadow: 0 10px 20px rgba(250, 204, 21, 0.3);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sticker-emoji-display {
  font-size: 68px;
  margin: 8px 0;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.15));
  animation: floatSlow 2s ease-in-out infinite alternate;
}

.sticker-rarity-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  background: #3b82f6;
  margin-bottom: 6px;
}

.rarity-ssr { background: linear-gradient(45deg, #ec4899, #8b5cf6, #f59e0b); }
.rarity-sr { background: linear-gradient(45deg, #f59e0b, #eab308); }
.rarity-r { background: linear-gradient(45deg, #3b82f6, #06b6d4); }
.rarity-n { background: #64748b; }

/* シール帳モーダル・台紙 */
.sticker-book-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
}

.sticker-tab-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 14px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s;
}

.sticker-tab-btn.active {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

/* シール図鑑グリッド */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

.sticker-item {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  cursor: pointer;
}

.sticker-item.collected {
  background: #ffffff;
  border-color: #fde047;
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
}

.sticker-item.collected:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 16px rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
}

.sticker-item.locked {
  filter: grayscale(1) opacity(0.4);
  background: #f1f5f9;
  cursor: not-allowed;
}

.sticker-item-icon {
  font-size: 34px;
  margin-bottom: 4px;
}

.sticker-item-name {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* シール貼り絵台紙 */
.sticker-board-area {
  position: relative;
  width: 100%;
  height: 320px;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid #cbd5e1;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
  background-size: cover;
  background-position: center;
  touch-action: none;
}

.bg-meadow {
  background: linear-gradient(180deg, #7dd3fc 0%, #bae6fd 60%, #86efac 60%, #4ade80 100%);
}
.bg-space {
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
}
.bg-room {
  background: linear-gradient(180deg, #fef3c7 0%, #fed7aa 70%, #fdba74 70%, #fb923c 100%);
}

.placed-sticker {
  position: absolute;
  font-size: 46px;
  cursor: move;
  user-select: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.placed-sticker:hover {
  transform: translate(-50%, -50%) scale(1.15);
}

.placed-sticker.selected {
  outline: 3px dashed #f59e0b;
  border-radius: 50%;
}

.placed-sticker.is-selected {
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.9));
}

.sticker-del-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  z-index: 60;
  padding: 0;
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease;
}

.sticker-del-btn:hover {
  background: #dc2626;
  transform: scale(1.2);
}

.placed-sticker.is-selected .sticker-del-btn,
.sticker-board-area.eraser-mode .placed-sticker .sticker-del-btn {
  display: flex !important;
  animation: modalPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sticker-board-area.eraser-mode {
  cursor: crosshair;
}

.sticker-board-area.eraser-mode .placed-sticker {
  cursor: pointer !important;
  animation: jiggle 0.6s infinite alternate ease-in-out;
}

@keyframes jiggle {
  0% { transform: translate(-50%, -50%) rotate(-4deg) scale(1.05); }
  100% { transform: translate(-50%, -50%) rotate(4deg) scale(1.05); }
}

.sticker-palette-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 4px;
  margin-top: 10px;
}

.palette-sticker-btn {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.palette-sticker-btn:hover {
  transform: scale(1.15);
  border-color: #f59e0b;
}

/* ==========================================================================
   🧩 えあわせゲーム (Memory Match)
   ========================================================================== */

.match-game-container {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px auto;
  perspective: 800px;
}

.match-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.match-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 280px;
}

.match-card {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  position: relative;
  cursor: pointer;
  perspective: 800px;
}

.match-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  border-radius: 18px;
}

.match-card.flipped .match-card-inner,
.match-card.matched .match-card-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.match-card-front, .match-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.match-card-back {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #ffffff;
  font-size: 32px;
  border: 3px solid #ffffff;
  z-index: 2;
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
}

.match-card-front {
  background: #ffffff;
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  border: 3px solid #fbbf24;
  padding: 6px;
  z-index: 1;
}

.match-card.matched .match-card-front {
  border: 3px solid #22c55e !important;
  background: #f0fdf4 !important;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.5) !important;
}

.match-card-icon {
  font-size: 36px;
}

.match-card-text {
  font-size: 13px;
  font-weight: 900;
  color: #1e293b;
  margin-top: 2px;
}

/* ==========================================================================
   📊 がんばりカード モーダル (Certificate Modal)
   ========================================================================== */

.report-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.report-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.report-modal-content {
  background: #ffffff !important;
  border: 4px solid #f59e0b;
  border-radius: 28px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  position: relative;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.report-modal-overlay.active .report-modal-content {
  transform: scale(1);
}

.report-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #fef08a;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.report-title-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-title-icon {
  font-size: 28px;
}

.report-main-title {
  font-size: 22px;
  font-weight: 900;
  color: #854d0e;
  margin: 0;
}

.cert-date-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.report-summary-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  background: #fffbeb;
  border: 2px solid #fed7aa;
  border-radius: 18px;
  padding: 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.summary-icon {
  font-size: 30px;
  flex-shrink: 0;
}

.summary-info {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 11px;
  font-weight: 800;
  color: #78350f;
}

.summary-value {
  font-size: 20px;
  font-weight: 900;
  color: #ea580c;
}

.cert-stamp {
  display: inline-block;
  background: rgba(239, 68, 68, 0.08);
  border: 3px dashed #ef4444;
  color: #ef4444;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 900;
  transform: rotate(-3deg);
  margin-bottom: 14px;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.12);
}

.cert-cheer-msg {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 14px;
  padding: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #166534;
  margin-bottom: 18px;
}

.cert-actions-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.cert-share-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: 900;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s;
}

.cert-share-btn:hover {
  transform: scale(1.05);
}

/* ==========================================================================
   ➕ くだもの合体たしざん (Visual Addition)
   ========================================================================== */

.addition-container {
  max-width: 580px;
  margin: 16px auto;
  background: #ffffff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-card);
  text-align: center;
  border: 4px solid #60a5fa;
}

.addition-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.fruit-plate {
  min-width: 110px;
  min-height: 110px;
  background: #f8fafc;
  border: 3px dashed #93c5fd;
  border-radius: 20px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
}

.fruit-plate-label {
  position: absolute;
  top: -12px;
  background: #3b82f6;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 12px;
}

.addition-fruit-item {
  font-size: 32px;
  animation: bounceSlow 2s ease-in-out infinite alternate;
}

.addition-sign {
  font-size: 32px;
  font-weight: 900;
  color: #3b82f6;
}

.fruit-plate-result {
  min-width: 130px;
  min-height: 110px;
  background: #eff6ff;
  border: 3px solid #3b82f6;
  border-radius: 20px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.addition-choices {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.addition-choice-btn {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  border: 3px solid #3b82f6;
  background: #ffffff;
  color: #1e3a8a;
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.addition-choice-btn:hover {
  transform: translateY(-4px) scale(1.08);
  background: #3b82f6;
  color: #ffffff;
}

/* ==========================================================================
   🖨️ A4なぞり書きプリント (Worksheet Print)
   ========================================================================== */

.print-modal-content {
  max-width: 680px;
}

.print-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
  text-align: left;
}

.print-preset-card {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.print-preset-card:hover, .print-preset-card.selected {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.print-preset-title {
  font-size: 14px;
  font-weight: 900;
  color: #1e293b;
}

.print-preset-desc {
  font-size: 11px;
  color: #64748b;
}

/* 実際の印刷用シート（非表示で待機、印刷時に全画面展開） */
#printWorksheetContainer {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm 8mm 10mm;
  }

  html, body {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  /* 印刷用コンテナ以外の全要素を高さごと完全に消去（白紙ページの発生を完全防止） */
  body > :not(#printWorksheetContainer) {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  #printWorksheetContainer {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: "UD デジタル 教科書体 N-R", "UD Digital Kyokasho-tai", "Yu Kyokasho", "游教科書体", "HG教科書体", "Klee One", sans-serif;
  }

  .worksheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #000000;
    padding-bottom: 4px;
    margin-bottom: 8px;
  }

  .worksheet-title {
    font-size: 19px;
    font-weight: bold;
    margin: 0;
    line-height: 1.3;
  }

  .worksheet-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    align-items: center;
  }

  .name-box {
    border-bottom: 1px solid #000000;
    min-width: 130px;
    display: inline-block;
  }

  .score-hanamaru-box {
    width: 50px;
    height: 50px;
    border: 2px solid #ff4757;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff4757;
    font-size: 11px;
    font-weight: bold;
  }

  .worksheet-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 8px;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .worksheet-cell {
    border: 2px solid #000000;
    aspect-ratio: 1 / 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  /* 十字リーダー線（十字点線） */
  .worksheet-cell::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 0;
    border-left: 1px dashed #94a3b8;
  }

  .worksheet-cell::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 0;
    border-top: 1px dashed #94a3b8;
  }

  /* なぞり書き文字ガイド: マス目（約138px）に最大限大きくフィットする特大サイズ (88px → 116px) */
  .worksheet-char-guide {
    font-size: 116px;
    line-height: 1;
    color: #64748b;
    font-weight: 700;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin-top: -2px;
  }

  .worksheet-word-info {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 10px;
    color: #334155;
    background: rgba(255, 255, 255, 0.88);
    padding: 1px 4px;
    border-radius: 3px;
    z-index: 3;
    line-height: 1.2;
  }

  .worksheet-footer {
    margin-top: 8px;
    text-align: center;
    font-size: 10px;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    padding-top: 4px;
    page-break-before: avoid !important;
    break-before: avoid !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}







/* ==========================================================================
   AIO / SEO ガイド＆FAQセクション
   ========================================================================== */
/* =============================================
   AIO / SEO ガイド＆FAQセクション
   ============================================= */
.aio-seo-section {
  max-width: 840px;
  margin: 36px auto 24px;
  padding: 28px 24px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  border: 2px solid #edf2f7;
  text-align: left;
  box-sizing: border-box;
}

.aio-seo-section h2 {
  font-size: 19px;
  font-weight: 800;
  color: #1a202c;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  border-bottom: 2px solid #edf2f7;
  padding-bottom: 12px;
}

.aio-seo-section h2:not(:first-child) {
  margin-top: 32px;
}

.aio-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .aio-feature-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .aio-seo-section {
    margin: 24px 12px 16px;
    padding: 20px 16px;
    border-radius: 20px;
  }
  .aio-seo-section h2 {
    font-size: 16.5px;
  }
}

.aio-feature-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.aio-feature-card h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.aio-feature-card p {
  font-size: 13px;
  color: #475569;
  line-height: 1.65;
  margin: 0;
}

.aio-faq-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aio-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.aio-faq-item summary {
  padding: 14px 48px 14px 18px;
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  background: #f8fafc;
  user-select: none;
  list-style: none;
  position: relative;
  line-height: 1.5;
}

.aio-faq-item summary::-webkit-details-marker {
  display: none;
}

.aio-faq-item summary::after {
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: bold;
  color: #64748b;
  line-height: 1;
}

.aio-faq-item[open] summary {
  background: #eff6ff;
  border-bottom: 1px solid #e2e8f0;
}

.aio-faq-item[open] summary::after {
  content: '−';
  color: #2563eb;
}

.aio-faq-answer {
  padding: 14px 18px;
  font-size: 13px;
  color: #334155;
  line-height: 1.7;
  background: #ffffff;
}

.breadcrumb-nav {
  max-width: 840px;
  margin: 10px auto 14px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.breadcrumb-nav a {
  color: #2563eb;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #eff6ff;
  transition: all 0.2s ease;
}

.breadcrumb-nav a:hover {
  background: #dbeafe;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.breadcrumb-nav span {
  color: #1e293b;
}

/* ==========================================================================
   🎨 SLUSH PORTAL STYLES
   ========================================================================== */

/* ヘッダーボタン群（ガチャ・プリント・がんばり） */
.gacha-badge-btn,
.print-badge-btn,
.report-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.gacha-badge-btn {
  background: #fff8e6;
  border: 1.5px solid #fed7aa;
  color: #92400e;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.print-badge-btn {
  background: #ffedf1;
  border: 1.5px solid #ffccd5;
  color: #ff5e7e;
  box-shadow: 0 2px 6px rgba(255, 94, 126, 0.2);
}

.report-badge-btn {
  background: #f0fff4;
  border: 1.5px solid #bbf7d0;
  color: #166534;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.15);
}

.gacha-badge-btn:hover,
.print-badge-btn:hover,
.report-badge-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 14px rgba(61, 41, 41, 0.12);
}

/* ===== ポータルメインレイアウト ===== */
.portal-main {
  flex: 1;
  padding: 0;
}

/* ===== ポータルヒーローセクション ===== */
/* ====================================================
   🍓 いちごドリル風 新世代知育デザインシステム
   ==================================================== */

/* ===== ポータルヒーローエリア ===== */
.portal-hero {
  background: linear-gradient(180deg, #fffbf5 0%, #faf7f2 100%);
  padding: 44px 20px 54px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* いちごドリル風 「1日5分」丸バッジ */
.ichigo-badge-5min {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ff5e7e;
  color: #ffffff;
  padding: 6px 18px 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(255, 94, 126, 0.35);
  margin-bottom: 18px;
  animation: bounceSlow 3s infinite ease-in-out;
}

.ichigo-badge-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  color: #ff5e7e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
}

.hero-badge {
  display: inline-block;
  background: #fff3c4;
  border: 1.5px solid #f6d365;
  border-radius: var(--radius-pill);
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 800;
  color: #92400e;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.portal-hero-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: clamp(28px, 5.5vw, 46px);
  font-weight: 900;
  color: #3d2929;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.portal-hero-sub {
  font-size: 15px;
  font-weight: 700;
  color: #786060;
  letter-spacing: 0.02em;
  max-width: 680px;
  margin: 0 auto;
}

/* ====================================================
   🍓 「01 ぴったりの学習をさがす」フローティングナビボックス
   （いちごドリル最大の目玉UIコンポーネント）
   ==================================================== */
.ichigo-search-box {
  max-width: 1040px;
  margin: -28px auto 44px;
  background: #ffffff;
  border-radius: 26px;
  box-shadow: 0 12px 36px rgba(61, 41, 41, 0.08);
  border: 2.5px solid #fcefe3;
  padding: 24px 28px 22px;
  position: relative;
  z-index: 10;
}

.ichigo-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid #ffeedb;
  border-radius: 18px;
  padding: 8px 16px;
  background: #fffdf9;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

/* 01 斜めリボンバッジ */
.ichigo-num-badge {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #ffffff;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 20px;
  font-weight: 900;
  padding: 4px 18px;
  border-radius: 10px;
  clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
  letter-spacing: -0.02em;
}

.ichigo-search-title {
  font-size: 19px;
  font-weight: 900;
  color: #3d2929;
  flex: 1;
  text-align: center;
  margin-right: 40px;
}

/* 年齢・学年切り替えタブ */
.ichigo-age-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 18px;
  scrollbar-width: none;
}

.ichigo-age-tabs::-webkit-scrollbar {
  display: none;
}

.ichigo-age-tab-btn {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1.5px solid #ebdcd0;
  background: #faf7f2;
  color: #6e5858;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.ichigo-age-tab-btn:hover {
  background: #f4ece4;
  color: #3d2929;
}

.ichigo-age-tab-btn.active {
  background: #ff5e7e;
  border-color: #ff5e7e;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 94, 126, 0.35);
  transform: scale(1.02);
}

/* 教科丸アイコンボタン（6大カテゴリ） */
.ichigo-subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ichigo-subject-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 8px 10px;
  border-radius: 18px;
  background: #ffffff;
  border: 1.5px solid #f5ede2;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ichigo-subject-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(61, 41, 41, 0.08);
  border-color: #ffccd5;
}

.ichigo-sub-icon-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 8px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ichigo-subject-btn:hover .ichigo-sub-icon-circle {
  transform: scale(1.12);
}

.sub-icon-hira    { background: #e6fffa; border: 1.5px solid #b2f5ea; }
.sub-icon-math    { background: #fff5f5; border: 1.5px solid #fed7d7; }
.sub-icon-english { background: #ebf8ff; border: 1.5px solid #bee3f8; }
.sub-icon-clock   { background: #fffaf0; border: 1.5px solid #feebc8; }
.sub-icon-game    { background: #faf5ff; border: 1.5px solid #e9d8fd; }
.sub-icon-print   { background: #f0fff4; border: 1.5px solid #c6f6d5; }

.ichigo-sub-name {
  font-size: 14px;
  font-weight: 900;
  color: #3d2929;
  line-height: 1.2;
}

.ichigo-sub-desc {
  font-size: 11px;
  font-weight: 600;
  color: #8c7878;
  margin-top: 3px;
}

/* 人気キーワードタグ一覧 */
.ichigo-keywords-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px dashed #eedfcb;
}

.ichigo-kw-label {
  font-size: 12px;
  font-weight: 800;
  color: #ff5e7e;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ichigo-kw-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: #6e5858;
  background: #faf7f2;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #ebdcd0;
  text-decoration: none;
  transition: all 0.15s;
}

.ichigo-kw-tag:hover {
  background: #ffedf1;
  color: #ff5e7e;
  border-color: #ffccd5;
}

/* ====================================================
   🍓 セクション見出し＆レイアウト
   ==================================================== */
.ichigo-section {
  max-width: 1040px;
  margin: 0 auto 50px;
  padding: 0 12px;
}

.ichigo-section-header {
  text-align: center;
  margin-bottom: 28px;
}

.ichigo-section-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffedf1;
  color: #ff5e7e;
  font-size: 12.5px;
  font-weight: 900;
  padding: 4px 16px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.ichigo-section-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 900;
  color: #3d2929;
  line-height: 1.3;
  margin-bottom: 8px;
}

.ichigo-section-sub {
  font-size: 14px;
  font-weight: 600;
  color: #786060;
}

/* ====================================================
   🍓 サムネイル付き教材カードグリッド
   ==================================================== */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 26px;
  margin-bottom: 40px;
}

.portal-choice-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 24px;
  padding: 20px;
  text-decoration: none;
  color: #3d2929;
  border: 2px solid #f6eee4;
  box-shadow: 0 8px 24px rgba(61, 41, 41, 0.07);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.portal-choice-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 36px rgba(61, 41, 41, 0.13);
}

.card-hira:hover    { border-color: #b2f5ea; }
.card-english:hover { border-color: #bee3f8; }
.card-numbers:hover { border-color: #fed7d7; }
.card-clock:hover   { border-color: #feebc8; }

/* 教材サムネイル・プレビュー画像エリア */
.portal-card-thumb {
  width: 100%;
  height: 140px;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
}

.thumb-hira    { background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%); }
.thumb-english { background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%); }
.thumb-numbers { background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%); }
.thumb-clock   { background: linear-gradient(135deg, #fffaf0 0%, #feebc8 100%); }

/* サムネイル内の装飾要素 */
.thumb-visual-content {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.thumb-main-icon {
  font-size: 58px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portal-choice-card:hover .thumb-main-icon {
  transform: scale(1.15) rotate(-3deg);
}

.thumb-badges-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.thumb-feature-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #3d2929;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  white-space: nowrap;
}

/* カードリボンバッジ（右上） */
.portal-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  background: #ff5e7e;
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 0 3px 8px rgba(255, 94, 126, 0.4);
}

.badge-blue   { background: #4cb1bf; box-shadow: 0 3px 8px rgba(76, 177, 191, 0.4); }
.badge-orange { background: #fda359; box-shadow: 0 3px 8px rgba(253, 163, 89, 0.4); }
.badge-purple { background: #9f7aea; box-shadow: 0 3px 8px rgba(159, 122, 234, 0.4); }

/* メタ情報（年齢・教科） */
.portal-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.meta-age-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: #faf7f2;
  color: #786060;
  border: 1px solid #ebdcd0;
}

.meta-subject-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: #ffedf1;
  color: #ff5e7e;
}

/* カードタイトル */
.portal-card-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: #3d2929;
  margin-bottom: 8px;
  line-height: 1.3;
}

/* カード説明文 */
.portal-card-desc {
  font-size: 13px;
  font-weight: 600;
  color: #6e5858;
  line-height: 1.6;
  margin-bottom: 14px;
  flex: 1;
}

/* カードタグ群 */
.portal-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.portal-tag {
  display: inline-block;
  border: 1px solid #f0eae1;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #554444;
  background: #faf7f2;
}

/* カードCTAボタン */
.portal-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff5e7e, #ff4767);
  color: #ffffff;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(255, 94, 126, 0.35);
  transition: all 0.25s ease;
}

.portal-choice-card:hover .portal-card-btn {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 94, 126, 0.5);
  background: linear-gradient(135deg, #ff4767, #e03254);
}

.card-hira .portal-card-btn    { background: linear-gradient(135deg, #38b2ac, #2c7a7b); box-shadow: 0 4px 14px rgba(56, 178, 172, 0.35); }
.card-english .portal-card-btn { background: linear-gradient(135deg, #3182ce, #2b6cb0); box-shadow: 0 4px 14px rgba(49, 130, 206, 0.35); }
.card-numbers .portal-card-btn { background: linear-gradient(135deg, #dd6b20, #c05621); box-shadow: 0 4px 14px rgba(221, 107, 32, 0.35); }
.card-clock .portal-card-btn   { background: linear-gradient(135deg, #d69e2e, #b7791f); box-shadow: 0 4px 14px rgba(214, 158, 46, 0.35); }

/* ====================================================
   🍓 「おうちで印刷！無料A4学習プリント」ギャラリー
   （いちごドリルの最大特色）
   ==================================================== */
.ichigo-print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.ichigo-print-card {
  background: #ffffff;
  border-radius: 20px;
  border: 2px solid #f6eee4;
  box-shadow: 0 6px 20px rgba(61, 41, 41, 0.06);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  color: #3d2929;
}

.ichigo-print-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(61, 41, 41, 0.12);
  border-color: #ffccd5;
}

/* A4用紙を模した縦長紙面プレビュー */
.ichigo-paper-sheet {
  width: 100%;
  aspect-ratio: 1 / 1.35;
  background: #fdfdfd;
  border: 1.5px solid #e8dfd3;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}

.paper-header-mock {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid #edd9c4;
  padding-bottom: 6px;
}

.paper-title-mock {
  font-size: 11px;
  font-weight: 900;
  color: #ff5e7e;
}

.paper-name-mock {
  font-size: 9px;
  color: #a89898;
  border-bottom: 1px solid #d8c8c8;
  padding: 0 8px;
}

.paper-body-mock {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  align-content: center;
  padding: 8px 0;
}

.paper-grid-cell {
  aspect-ratio: 1;
  border: 1px dashed #d8c8c8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #786060;
  background: #fafafa;
}

.paper-footer-mock {
  text-align: right;
  font-size: 8px;
  color: #b0a0a0;
  font-weight: 700;
}

.ichigo-print-title {
  font-size: 15px;
  font-weight: 900;
  color: #3d2929;
  line-height: 1.3;
  margin-bottom: 6px;
}

.ichigo-print-meta {
  font-size: 12px;
  font-weight: 600;
  color: #8c7878;
  margin-bottom: 12px;
}

.ichigo-print-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  background: #ff5e7e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255, 94, 126, 0.3);
  transition: all 0.2s;
}

.ichigo-print-btn:hover {
  background: #e04364;
  box-shadow: 0 5px 14px rgba(255, 94, 126, 0.45);
}

/* ===== 保護者向けガイドカード ===== */
.portal-guide-card {
  background: #fffdf9;
  border: 2px dashed #edd9c4;
  border-radius: 22px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 1040px;
  margin: 30px auto;
  box-shadow: 0 4px 16px rgba(61, 41, 41, 0.04);
}

.guide-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.guide-text h4 {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 17px;
  font-weight: 900;
  color: #3d2929;
  margin-bottom: 8px;
}

.guide-text p {
  font-size: 13.5px;
  line-height: 1.75;
  color: #6e5858;
  font-weight: 600;
}

/* ===== PWAバナー (Slush化) ===== */
.pwa-install-banner {
  background: var(--color-electric-blue);
  border-bottom: 1px solid var(--color-carbon);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pwa-banner-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-carbon);
}

.pwa-banner-btn {
  border: 1px solid var(--color-carbon);
  border-radius: var(--radius-pill);
  background: var(--color-carbon);
  color: var(--color-paper-white);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.pwa-banner-close-btn {
  background: transparent;
  border: 1px solid var(--color-carbon);
  border-radius: var(--radius-pill);
  width: 30px;
  height: 30px;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-carbon);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== SEOセクション (Slush化) ===== */
.aio-seo-section {
  background: var(--color-paper-white);
  border-top: 1px solid var(--color-carbon);
  padding: 40px 24px;
  max-width: 100%;
}

.aio-seo-section h2 {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--color-carbon);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-carbon);
}

.aio-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
  background: var(--color-paper-white);
  border: 1px solid var(--color-carbon);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 32px;
}

.aio-feature-card {
  background: var(--color-paper-white);
  padding: 20px;
  border-right: 1px solid var(--color-carbon);
  border-bottom: 1px solid var(--color-carbon);
}

/* パンくずリスト (Slush化) */
.breadcrumb-nav {
  max-width: 100%;
  margin: 12px 20px;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-carbon);
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.breadcrumb-nav a {
  color: var(--color-carbon);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-paper-white);
  border: 1px solid var(--color-carbon);
  transition: background 0.15s ease;
}

.breadcrumb-nav a:hover {
  background: var(--color-soft-mist);
  color: var(--color-carbon);
  transform: none;
}

.breadcrumb-nav span {
  color: var(--color-carbon);
}

/* ===== フッター ===== */
.app-footer {
  background: var(--color-carbon);
  color: var(--color-paper-white);
  border-top: 1px solid var(--color-carbon);
  padding: 20px 24px;
}

.footer-content {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.parent-tip {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.02em;
}

/* ===== back-home-link (Slush化) ===== */
.back-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--color-carbon);
  border-radius: var(--radius-pill);
  background: var(--color-paper-white);
  color: var(--color-carbon);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.back-home-link:hover {
  background: var(--color-soft-mist);
}

/* ===== レスポンシブ対応 ===== */
@media (max-width: 680px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .portal-choice-card {
    border-right: none;
  }

  .portal-hero {
    padding: 28px 16px 24px;
  }

  .portal-hero-title {
    font-size: 26px;
  }

  .portal-guide-card {
    flex-direction: column;
    gap: 10px;
  }

  .aio-seo-section {
    padding: 28px 16px;
  }
}

/* ====================================================
   ☁️ Firebase クラウド同期 UI
   ==================================================== */
.sync-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border: 2px solid #38bdf8;
  color: #0369a1;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(56, 189, 248, 0.2);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.sync-badge-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 12px rgba(56, 189, 248, 0.3);
  background: #bae6fd;
}

.sync-badge-btn:active {
  transform: scale(0.95);
}

.sync-badge-btn.synced {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border-color: #22c55e;
  color: #15803d;
  box-shadow: 0 3px 6px rgba(34, 197, 94, 0.2);
}

.sync-badge-btn.synced:hover {
  background: #bbf7d0;
  box-shadow: 0 6px 12px rgba(34, 197, 94, 0.3);
}

/* モーダル */
.sync-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInModal 0.2s ease-out;
}

.sync-modal-content {
  background: #ffffff;
  border: 4px solid #38bdf8;
  border-radius: 28px;
  padding: 28px 24px 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  position: relative;
}

.sync-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.sync-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  transform: scale(1.1);
}

/* トースト通知 */
.sync-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.sync-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ====================================================
   🎮 年齢別知育ゲームセンター UIスタイル
   ==================================================== */

/* トップページ用 ゲームカードグリッド */
.age-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.age-game-card {
  background: #ffffff;
  border-radius: 20px;
  border: 2px solid #f6eee4;
  padding: 18px 16px 16px;
  box-shadow: 0 4px 14px rgba(61, 41, 41, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  color: #3d2929;
  position: relative;
  overflow: hidden;
}

.age-game-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 28px rgba(61, 41, 41, 0.12);
  border-color: #ffccd5;
}

.age-game-card-icon {
  font-size: 52px;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.age-game-card:hover .age-game-card-icon {
  transform: scale(1.15) rotate(-4deg);
}

.age-game-card-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: #3d2929;
  margin-bottom: 6px;
  line-height: 1.3;
}

.age-game-card-desc {
  font-size: 12px;
  font-weight: 600;
  color: #786060;
  line-height: 1.5;
  margin-bottom: 14px;
  flex: 1;
}

.age-game-card-btn {
  width: 100%;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff5e7e, #ff4767);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 900;
  border: none;
  box-shadow: 0 3px 10px rgba(255, 94, 126, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.age-game-card:hover .age-game-card-btn {
  background: linear-gradient(135deg, #ff4767, #e03254);
  box-shadow: 0 5px 14px rgba(255, 94, 126, 0.5);
}

/* ゲームモーダル */
.age-game-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 20, 20, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInModal 0.2s ease-out;
}

.age-game-modal-overlay.active {
  display: flex;
}

.age-game-modal-content {
  background: #ffffff;
  border-radius: 28px;
  border: 3.5px solid #ffccd5;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.age-game-modal-header {
  padding: 16px 20px;
  border-bottom: 2px solid #f6eee4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffdf9;
  border-radius: 24px 24px 0 0;
}

.age-game-title {
  font-size: 19px;
  font-weight: 900;
  color: #3d2929;
  display: flex;
  align-items: center;
  gap: 8px;
}

.age-game-badge {
  font-size: 11px;
  font-weight: 800;
  background: #ffedf1;
  color: #ff5e7e;
  padding: 3px 10px;
  border-radius: 999px;
}

.age-game-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #ebdcd0;
  background: #faf7f2;
  color: #786060;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.age-game-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  transform: scale(1.1);
}

.age-game-body {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 340px;
  justify-content: center;
  position: relative;
}

.age-game-instruction {
  font-size: 16px;
  font-weight: 800;
  color: #3d2929;
  margin-bottom: 20px;
  background: #fff9ed;
  border: 1.5px solid #fed7aa;
  padding: 8px 20px;
  border-radius: 999px;
  display: inline-block;
}

.age-game-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* 選択肢ボタン */
.age-game-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 440px;
}

.age-game-opt-btn {
  background: #ffffff;
  border: 2.5px solid #f4e8dc;
  border-radius: 20px;
  padding: 16px 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(61, 41, 41, 0.06);
}

.age-game-opt-btn:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: #ff5e7e;
  box-shadow: 0 8px 20px rgba(255, 94, 126, 0.25);
  background: #fffdf9;
}

.age-game-opt-btn:active {
  transform: scale(0.95);
}

/* 文字タイル */
.age-game-char-tile {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #ffffff;
  border: 2.5px solid #f6d365;
  font-size: 28px;
  font-weight: 900;
  color: #92400e;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
  transition: all 0.2s;
}

.age-game-char-tile:hover {
  transform: scale(1.1);
  background: #fffbeb;
}

.word-char-placeholder {
  width: 48px;
  height: 48px;
  border-bottom: 3px solid #cbd5e1;
  font-size: 24px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
}

.word-char-filled {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #ff5e7e;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(255, 94, 126, 0.35);
  animation: popIn 0.2s ease-out;
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* あわせて10用数字ボックス */
.ten-num-box {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  border: 2.5px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 32px;
  font-weight: 900;
}

.question-box {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #e11d48;
  border-style: dashed;
}

.target-ten {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

/* 順番ゲームボタン */
.age-game-spatial-btn {
  background: #ffffff;
  border: 2px solid #ebdcd0;
  border-radius: 16px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s;
}

.age-game-spatial-btn:hover {
  border-color: #ff5e7e;
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(255, 94, 126, 0.2);
}

/* 正解はなまるオーバーレイ */
.age-hanamaru-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.96);
  border: 3px solid #ff5e7e;
  border-radius: 28px;
  padding: 24px 36px;
  box-shadow: 0 16px 40px rgba(255, 94, 126, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  pointer-events: none;
}

.age-hanamaru-mark {
  font-size: 74px;
  line-height: 1;
  color: #e11d48;
}

.age-hanamaru-text {
  font-size: 24px;
  font-weight: 900;
  color: #e11d48;
  margin-top: 6px;
}

.age-hanamaru-sub {
  font-size: 14px;
  font-weight: 800;
  color: #786060;
  margin-top: 4px;
}

/* クリア画面 */
.age-game-clear-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

.age-star-reward-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fef08a;
  border: 2px solid #facc15;
  color: #854d0e;
  padding: 8px 24px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.3);
}

.age-game-cta-btn {
  padding: 12px 24px;
  border-radius: 999px;
  background: #ff5e7e;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 94, 126, 0.35);
  transition: all 0.2s;
}

.age-game-cta-btn:hover {
  background: #e04364;
  transform: translateY(-2px);
}

.age-game-cta-btn.secondary {
  background: #f1f5f9;
  color: #475569;
  box-shadow: none;
  border: 1.5px solid #cbd5e1;
}

.age-game-cta-btn.secondary:hover {
  background: #e2e8f0;
}

/* ====================================================
   ✍️ お題イラストなぞり書きゲーム スタイル
   ==================================================== */
.trace-game-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto 14px;
  padding: 0 4px;
}

.game-progress-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-quiz-badge {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
  letter-spacing: 0.5px;
}

.game-star-badge {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
  font-size: 14px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.3);
}

.trace-filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab-btn {
  background: #ffffff;
  color: #475569;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.filter-tab-btn:hover {
  transform: translateY(-2px);
  border-color: #94a3b8;
}

.filter-tab-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.filter-tab-btn.random-btn {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  border-color: #e11d48;
}

.filter-tab-btn.random-btn:hover {
  transform: translateY(-2px) rotate(8deg);
}

/* お題イラスト出題カード */
.trace-question-card {
  width: 100%;
  max-width: 860px;
  margin: 0 auto 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 3px solid #e0e7ff;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12), 0 2px 6px rgba(0,0,0,0.04);
  overflow: hidden;
  position: relative;
  text-align: center;
}

.question-prompt-banner {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.5px;
}

.question-main-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.question-illust-wrap {
  width: 110px;
  height: 110px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 3px solid #f59e0b;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.25);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.question-illust-wrap:hover {
  transform: scale(1.08) rotate(3deg);
}

.question-illust-wrap:active {
  transform: scale(0.95);
}

.question-big-icon {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.question-hint-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.question-hint-balloon {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 800;
  color: #334155;
  box-shadow: 0 3px 6px rgba(0,0,0,0.05);
  position: relative;
  text-align: left;
}

.question-hint-balloon .hint-label {
  color: #f59e0b;
  font-weight: 900;
}

.question-audio-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hint-reveal-btn {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.hint-reveal-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.hint-reveal-btn.active {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #818cf8;
}

@media screen and (max-width: 600px) {
  .trace-game-header {
    justify-content: center;
  }
  .question-main-box {
    flex-direction: column;
    gap: 12px;
  }
  .question-illust-wrap {
    width: 90px;
    height: 90px;
  }
  .question-big-icon {
    font-size: 52px;
  }
  .question-hint-wrap {
    align-items: center;
  }
  .question-hint-balloon {
    font-size: 14px;
  }
}


