
  .drill-wrap {
    font-family: 'M PLUS Rounded 1c', 'Kiwi Maru', sans-serif;
    background-color: #fdfbf7;
    color: #4a3e3d;
    min-height: auto;
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    max-width: 900px;
    margin: 0 auto;
  }
  .drill-wrap * { box-sizing: border-box; }

  .drill-card {
    width: 100%;
    background-color: #ffffff;
    border-radius: 24px;
    border: 4px solid #ffedd5;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    overflow: hidden;
  }
  .bounce-in { animation: bounceIn 0.5s ease forwards; }
  @keyframes bounceIn {
    0% { transform: scale(0.9); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
  }

  .drill-header {
    background: linear-gradient(to right, #fef08a, #fde047);
    padding: 32px 24px;
    text-align: center;
  }
  .drill-badge {
    font-size: 14px; font-weight: 700; color: #b45309;
    letter-spacing: 0.1em;
    background-color: rgba(255,255,255,0.75);
    padding: 6px 16px; border-radius: 9999px;
    display: inline-block; margin-bottom: 12px;
  }
  .drill-title { font-size: 28px; font-weight: 900; color: #78350f; margin: 0; line-height: 1.2; }
  @media (min-width: 768px) { .drill-title { font-size: 36px; } }
  .drill-subtitle { font-size: 16px; color: #92400e; margin: 8px 0 0 0; font-weight: 700; }
  @media (min-width: 768px) { .drill-subtitle { font-size: 18px; } }

  .drill-body { padding: 24px; }
  @media (min-width: 640px) { .drill-body { padding: 40px; } }

  /* レベル・パターン トグル */
  .toggle-row {
    margin-bottom: 16px;
    background-color: #f1f5f9;
    padding: 8px; border-radius: 16px;
    display: inline-flex; gap: 8px;
    max-width: 560px; width: 100%;
    margin-left: auto; margin-right: auto;
    border: 1px solid #e2e8f0;
  }
  .btn-toggle {
    flex: 1; padding: 10px 12px; border-radius: 12px;
    font-size: 13px; font-weight: 900; border: none; cursor: pointer;
    transition: all 0.2s; background: transparent; color: #64748b;
    line-height: 1.3;
  }
  .btn-toggle.active {
    background-color: #ffffff; color: #78350f;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
  }

  /* パターントグル（きりのいい数） */
  .pattern-toggle {
    margin-bottom: 32px;
    background-color: #f0fdf4;
    padding: 8px; border-radius: 16px;
    display: inline-flex; gap: 8px;
    max-width: 560px; width: 100%;
    margin-left: auto; margin-right: auto;
    border: 1px solid #bbf7d0;
  }
  .btn-pattern {
    flex: 1; padding: 10px 12px; border-radius: 12px;
    font-size: 13px; font-weight: 900; border: none; cursor: pointer;
    transition: all 0.2s; background: transparent; color: #166534;
    line-height: 1.3;
  }
  .btn-pattern.active {
    background-color: #ffffff; color: #166534;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #bbf7d0;
  }

  .mode-headline { font-size: 20px; font-weight: 900; margin-bottom: 24px; color: #78350f; }
  @media (min-width: 768px) { .mode-headline { font-size: 24px; } }

  .mode-grid {
    display: grid; grid-template-columns: 1fr;
    gap: 16px; max-width: 768px; margin: 0 auto 40px auto;
  }
  @media (min-width: 768px) { .mode-grid { grid-template-columns: repeat(3, 1fr); } }

  .btn-mode {
    padding: 16px 24px; border-radius: 16px;
    border-width: 2px; border-style: solid;
    font-size: 18px; font-weight: 900;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    cursor: pointer; transition: all 0.2s;
  }
  .btn-mode:active { transform: scale(0.95); }
  #btn-mode-addition { border-color: #fef08a; background-color: #fef9c3; color: #854d0e; }
  #btn-mode-addition:hover { background-color: #fef08a; }
  #btn-mode-subtraction { border-color: #fed7aa; background-color: #ffedd5; color: #9a3412; }
  #btn-mode-subtraction:hover { background-color: #fed7aa; }
  #btn-mode-mixed { border-color: #bbf7d0; background-color: #dcfce7; color: #166534; }
  #btn-mode-mixed:hover { background-color: #bbf7d0; }

  .rule-box {
    background-color: #eff6ff; border: 2px solid #dbeafe;
    border-radius: 16px; padding: 20px; text-align: left;
    max-width: 640px; margin: 0 auto;
    font-size: 16px; color: #1e40af;
  }
  .rule-title { font-weight: 900; margin: 0 0 8px 0; font-size: 18px; }
  .rule-list { list-style-type: disc; padding-left: 20px; margin: 0; }
  .rule-list li { margin-bottom: 8px; font-weight: 700; }
  .rule-list li:last-child { margin-bottom: 0; }

  /* きりのいい数モード用ルール */
  .rule-box.complement {
    background-color: #f0fdf4; border-color: #bbf7d0; color: #166534;
  }

  .hidden { display: none !important; }

  .play-info-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 32px; background-color: #f8fafc;
    padding: 16px; border-radius: 16px; border: 1px solid #f1f5f9;
  }
  .play-status-labels { text-align: left; display: flex; flex-direction: column; }
  .lbl-mode { font-size: 18px; font-weight: 900; color: #0284c7; }
  .lbl-lvl { font-size: 12px; font-weight: 700; color: #94a3b8; margin-top: 2px; }
  .play-count-display { font-size: 18px; font-weight: 900; color: #1e293b; }
  .play-count-display span.sub { font-size: 14px; color: #94a3b8; font-weight: 700; }
  .play-count-display span.num { font-size: 24px; color: #10b981; font-family: sans-serif; }

  .questions-container {
    display: flex; flex-direction: column; gap: 32px;
    max-height: 70vh; overflow-y: auto;
    padding-right: 8px; padding-bottom: 16px;
  }
  .question-row {
    display: flex; flex-direction: column;
    align-items: center; justify-content: space-between;
    padding: 20px; background-color: #f8fafc;
    border-radius: 16px; border: 2px solid #f1f5f9;
    gap: 16px; transition: border-color 0.2s;
  }
  /* きりのいい数の問題は緑枠でヒント */
  .question-row.complement-hint { border-color: #bbf7d0; background-color: #f0fdf4; }
  .question-row:hover { border-color: #ffedd5; }
  .question-row.complement-hint:hover { border-color: #86efac; }

  @media (min-width: 640px) { .question-row { flex-direction: row; } }

  .formula-text {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 12px; font-size: 24px; font-weight: 900;
    color: #475569; font-family: sans-serif;
    width: 100%; justify-content: center;
  }
  @media (min-width: 640px) {
    .formula-text { justify-content: flex-start; font-size: 30px; }
  }
  .q-id {
    font-size: 14px; background-color: #e2e8f0; color: #475569;
    border-radius: 9999px; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; flex-shrink: 0;
  }
  .formula-text span.op { padding: 0 4px; }

  /* きりのいい数ヒントバッジ */
  .complement-badge {
    font-size: 11px; font-weight: 700; color: #166534;
    background-color: #dcfce7; border: 1px solid #86efac;
    padding: 2px 8px; border-radius: 9999px;
    white-space: nowrap;
  }

  .ans-input {
    display: inline-block; width: 96px; text-align: center;
    font-size: 24px; font-weight: 900; padding: 8px;
    border-radius: 12px; border: 2px solid #fbbf24;
    background-color: #ffffff; color: #1e293b;
    font-family: sans-serif; transition: all 0.2s;
  }
  .ans-input:focus { outline: none; border-color: #f59e0b; box-shadow: 0 0 0 3px #fef3c7; }
  .ans-input::placeholder { color: #fde68a; }

  .action-bar {
    margin-top: 32px; border-top: 2px solid #e2e8f0;
    padding-top: 24px; display: flex;
    justify-content: space-between; align-items: center; gap: 16px;
  }
  .btn-back {
    padding: 16px 24px; border-radius: 12px;
    border: 1px solid #e2e8f0; color: #64748b;
    background-color: #ffffff; font-size: 16px;
    font-weight: 700; cursor: pointer; transition: all 0.2s;
  }
  .btn-back:hover { background-color: #f8fafc; }
  .btn-submit {
    flex: 1;
    background: linear-gradient(to right, #10b981, #14b8a6);
    color: #ffffff; font-size: 20px; font-weight: 900;
    padding: 16px 24px; border-radius: 16px; border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); cursor: pointer;
    text-align: center; transition: all 0.2s;
  }
  .btn-submit:hover { background: linear-gradient(to right, #059669, #0d9488); }
  .btn-submit:active { transform: scale(0.95); }

  /* 結果画面 */
  .score-section { display: inline-block; margin-bottom: 24px; position: relative; }
  .perfect-crown {
    position: absolute; top: -40px; right: -40px;
    font-size: 40px; animation: crownBounce 0.5s ease infinite alternate;
  }
  @keyframes crownBounce { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }

  .score-circle {
    width: 160px; height: 160px; border-radius: 9999px;
    border: 4px solid #ffedd5;
    background: linear-gradient(to bottom right, #fffbeb, #ffedd5);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); margin: 0 auto;
  }
  .score-title { font-size: 12px; font-weight: 900; color: #b45309; letter-spacing: 0.1em; margin-bottom: 4px; }
  .score-num { font-size: 48px; font-weight: 900; color: #f43f5e; font-family: sans-serif; line-height: 1; }
  .score-max { font-size: 12px; font-weight: 700; color: #94a3b8; margin-top: 4px; }

  .result-msg { font-size: 24px; font-weight: 900; color: #78350f; margin: 24px 0; }

  .review-box {
    background-color: #fcf8f2; border-radius: 16px; padding: 20px;
    text-align: left; border: 2px solid #fae8ff;
    max-height: 45vh; overflow-y: auto; margin-bottom: 32px;
  }
  .review-header {
    font-size: 16px; font-weight: 900; color: #86198f;
    margin: 0 0 16px 0; padding-bottom: 8px;
    border-bottom: 1px solid rgba(250,232,255,0.6);
    display: flex; justify-content: space-between; align-items: center;
  }
  .review-sub { font-size: 12px; font-weight: 400; color: #94a3b8; }
  .review-list-items { display: flex; flex-direction: column; gap: 12px; font-size: 18px; font-weight: 900; }
  .review-item {
    padding: 12px 16px; border-radius: 8px;
    display: flex; flex-direction: column;
    border-width: 1px; border-style: solid; gap: 12px;
  }
  @media (min-width: 1024px) {
    .review-item { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  }
  .review-item.correct { background-color: #ecfdf5; border-color: #d1fae5; color: #065f46; }
  .review-item.incorrect { background-color: #fff1f2; border-color: #ffe4e6; color: #9f1239; }

  .review-formula { display: flex; align-items: center; gap: 8px; font-family: sans-serif; flex-wrap: wrap; }
  .review-badge-id {
    font-size: 12px; padding: 2px 8px; border-radius: 4px;
    background-color: #ffffff; font-family: sans-serif;
    flex-shrink: 0; color: #475569; border: 1px solid #e2e8f0;
  }
  .review-user-ans {
    font-size: 14px; font-family: sans-serif;
    display: flex; align-items: flex-start; flex-direction: column; gap: 4px;
  }
  .review-user-ans strong { font-size: 16px; text-decoration: underline; }

  /* ヒントボックス（振り返り内） */
  .review-hint {
    font-size: 12px; color: #166534;
    background-color: #dcfce7; border-radius: 6px;
    padding: 4px 8px; margin-top: 4px;
    display: inline-block;
  }

  .result-actions { display: flex; flex-direction: column; gap: 12px; justify-content: center; }
  @media (min-width: 640px) { .result-actions { flex-direction: row; } }
  .btn-retry {
    flex: 1; background-color: #f0fdf4; border: 2px solid #bbf7d0;
    color: #166534; font-size: 16px; font-weight: 900;
    padding: 16px 24px; border-radius: 16px; cursor: pointer; transition: all 0.2s;
  }
  .btn-retry:hover { background-color: #dcfce7; }
  .btn-retry:active { transform: scale(0.95); }
  .btn-home {
    flex: 1; background-color: #f1f5f9; border: none; color: #334155;
    font-size: 16px; font-weight: 900; padding: 16px 24px;
    border-radius: 16px; cursor: pointer; transition: all 0.2s;
  }
  .btn-home:hover { background-color: #e2e8f0; }
  .btn-home:active { transform: scale(0.95); }

  .drill-footer { margin-top: 24px; font-size: 12px; color: #94a3b8; font-weight: 500; }
  
  .separator{
  	text-align: center;
  }

