/* ボード全体 */
h1{
    text-align: center;
    margin-top: 0px;
    margin-bottom: 10px;
}
#wrapper {
    display: flex;         /* 横並びにする */
    gap: 40px;             /* メインと補助の間の余白 */
    align-items: flex-start;
    width: fit-content;
    margin: 0 auto;        /* 中央寄せ（任意） */
}

#main-wrapper {
    /* display: flex;         横並びにする */
    gap: 40px;             /* メインと補助の間の余白 */
    align-items: flex-start;
    width: fit-content;
    margin: 0 auto;        /* 中央寄せ（任意） */
}

#board-container {
    width: 300px;
    height: 300px;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    border: 3px solid #333;
    box-sizing: border-box;
}

/* 各セルの基本 */
.cell {
    border: 1px solid #bbb;     /* 通常の細線 */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    user-select: none;
    box-sizing: border-box;
    cursor:pointer
}

/* 太線：縦のブロック区切り（列インデックスが 0,3,6 の左側を太くする） */
.cell[data-col="0"]  { border-left: 3px solid #333; } /* 左外枠 */
.cell[data-col="3"]  { border-left: 3px solid #333; } /* 3列目の右(=4列目の左) */
.cell[data-col="6"]  { border-left: 3px solid #333; }

/* 右外枠（最後の列の右側） */
.cell[data-col="8"]  { border-right: 3px solid #333; }

/* 太線：横のブロック区切り（行インデックスが 0,3,6 の上側を太くする） */
.cell[data-row="0"] { border-top: 3px solid #333; } /* 上外枠 */
.cell[data-row="3"] { border-top: 3px solid #333; } /* 3行目の下(=4行目の上) */
.cell[data-row="6"] { border-top: 3px solid #333; }

/* 下外枠（最後の行の下側） */
.cell[data-row="8"] { border-bottom: 3px solid #333; }

/* 背景：3x3 ブロックごとに薄いグリーンと白を交互に塗る */
/* ブロックの行番号（0..2）と列番号（0..2）の和が偶数なら薄緑、奇数なら白 */
.cell[data-row][data-col] {
    /* デフォルト白 */
    background: #ffffff;
}

/* 左上からブロック座標 (br=0..2, bc=0..2) を計算して奇偶で色分け */
/* CSSだけで表現するため、ブロックの範囲を直接指定します */

/* ブロック (0,0) : rows 0-2, cols 0-2 */
.cell[data-row="0"][data-col="0"],
.cell[data-row="0"][data-col="1"],
.cell[data-row="0"][data-col="2"],
.cell[data-row="1"][data-col="0"],
.cell[data-row="1"][data-col="1"],
.cell[data-row="1"][data-col="2"],
.cell[data-row="2"][data-col="0"],
.cell[data-row="2"][data-col="1"],
.cell[data-row="2"][data-col="2"],
/* ブロック (0,2) : rows 0-2, cols 6-8 */
.cell[data-row="0"][data-col="6"],
.cell[data-row="0"][data-col="7"],
.cell[data-row="0"][data-col="8"],
.cell[data-row="1"][data-col="6"],
.cell[data-row="1"][data-col="7"],
.cell[data-row="1"][data-col="8"],
.cell[data-row="2"][data-col="6"],
.cell[data-row="2"][data-col="7"],
.cell[data-row="2"][data-col="8"],
/* ブロック (1,1) : rows 3-5, cols 3-5 */
.cell[data-row="3"][data-col="3"],
.cell[data-row="3"][data-col="4"],
.cell[data-row="3"][data-col="5"],
.cell[data-row="4"][data-col="3"],
.cell[data-row="4"][data-col="4"],
.cell[data-row="4"][data-col="5"],
.cell[data-row="5"][data-col="3"],
.cell[data-row="5"][data-col="4"],
.cell[data-row="5"][data-col="5"],
/* ブロック (2,0) : rows 6-8, cols 0-2 */
.cell[data-row="6"][data-col="0"],
.cell[data-row="6"][data-col="1"],
.cell[data-row="6"][data-col="2"],
.cell[data-row="7"][data-col="0"],
.cell[data-row="7"][data-col="1"],
.cell[data-row="7"][data-col="2"],
.cell[data-row="8"][data-col="0"],
.cell[data-row="8"][data-col="1"],
.cell[data-row="8"][data-col="2"],
/* ブロック (2,2) : rows 6-8, cols 6-8 */
.cell[data-row="6"][data-col="6"],
.cell[data-row="6"][data-col="7"],
.cell[data-row="6"][data-col="8"],
.cell[data-row="7"][data-col="6"],
.cell[data-row="7"][data-col="7"],
.cell[data-row="7"][data-col="8"],
.cell[data-row="8"][data-col="6"],
.cell[data-row="8"][data-col="7"],
.cell[data-row="8"][data-col="8"]
{
    background: #e8ffe8; /* 薄いグリーン */
}

/* 選択や固定セルの装飾例 */
.cell.fixed { background: #dfe7f1; font-weight:600; }
.cell.selected {
    outline: none;
    background: #d2ffda;  /* 薄い緑色 */
}

/* ================================
   テンキーパネル（ボード右隣 → 下端揃え）
================================ */
/* PC用テンキー */
@media (min-width: 769px) {
  #numpad {
    position: absolute;
    left: 50%;
    top: 150px;              /* ← PCではこれを復活させてOK */

    width: auto;
    grid-template-columns: repeat(3, 50px);
    gap: 8px;
    padding: 12px;

    background: #fafafa;
    border: 2px solid #444;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  }

  #numpad div {
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 22px;
  }
}

.numpad.hidden {
    display: none;
}

.numpad div {
    /* width: 50px;
    height: 50px;
    line-height: 50px; */
    text-align: center;
    /* font-size: 22px; */
    cursor: pointer;
    background: #e6f5e6;
    border-radius: 8px;
    border: 1px solid #7bb47b;
    user-select: none;
}

.numpad div:hover {
    background: #f0f090;
}

.numpad div:active {
    background: #bce5bc;
}

/* 消去ボタン */
.numpad div[data-num="0"] {
    background: #ffe6e6;
    border-color: #cc5555;
}

.numpad div[data-num="0"]:hover {
    background: #ffcccc;
}

/* ================================
   Number Panel（1〜9 + CL）
   → ボード真下に揃える
================================ */
#number-panel {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin: 0;
}
#info-area {
    width: 100%;
    margin: 0;
}

/* 数字ボタン */
.num-btn {
    width: 25px;
    height: 62px; /* ←高さUP（残数を入れるため） */

    background: #f0f6ff;
    border: 2px solid #4a90e2;
    border-radius: 8px;

    display: flex;
    flex-direction: column;    /* ←縦に並べる */
    justify-content: center;
    align-items: center;

    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;

    transition: 0.1s;
    padding: 3px;
}

.num-btn:hover {
    background: #d9eaff;
}

.num-btn:active {
    background: #bcd9ff;
}
/* ================================
   数字ボタンと残数表示
================================ */
.num-btn .remain {
    display: block;

    /* 少し大きく */
    font-size: 20px;       
    font-weight: bold;
    margin-top: -5px;
    color: #d9534f;
}

/* CL ボタン */
.clear-btn {
    background: #ffe5e5;
    border-color: #d9534f;
}

.clear-btn:hover {
    background: #ffd2d2;
}

.num-red {
    background-color: #ff6666 !important;
}

/* 選択中セル（テンキー表示中） */
.cell.active {
    background: #d8f5d0;      /* 薄い緑色など */
    outline: 3px solid #66bb6a;
    z-index: 10;
}

/* 行・列・ブロックの淡色ハイライト */
.cell.related {
    background: #f1ffe9;   /* 淡い緑（薄め） */
}

/* 選択セル */
.cell.selected {
    background-color: #c9e8ff !important;
}

/* 行と列ハイライト */
.cell.highlight-line {
    background-color: #eef9ff !important;
}

/* ブロックハイライト */
.cell.highlight-block {
    background-color: #f3ffe6 !important;
}

/* クリックした単一セルの強調（最前面の濃色） */
.cell.selected {
    background-color: #b2f2ff !important;  /* 明るい水色など目立つ色 */
    z-index: 10;
}

/* もし全体の調和を取るなら　おすすめの色組み合わせ */
.cell.selected {
    background-color: #a5d8ff !important;   /* 単一セル：濃い水色 */
}

.cell.highlight-line {
    background-color: #dbefff;              /* 行・列：薄い青 */
}

.cell.highlight-block {
    background-color: #e8f7ff;              /* ブロック：もっと薄い青 */
}

.cell.related {
    background-color: #f4faff;              /* 淡色ハイライト：超薄い青 */
}
/* ＝＝＝＝＝＝ */

/* 数字ハイライト（赤背景） */
.cell.highlight-value {
    background-color: rgb(255, 120, 120) !important;
}

/* ================================
   補助パネル（全体）
================================ */
/* 補助パネル（サイズを完全に同じにする） */
#assist-container {
    width: 300px;
    height: 300px; /* ← 必須：高さを固定 */
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    border: 3px solid #444;
    box-sizing: border-box;
}

/* ================================
   補助セル（確定か候補かで切り替わる）
================================ */
/* 補助セル（全て均等に） */
.assist-cell {
    border: 1px solid #bbb;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden; /* ←候補セルがはみ出さない */
}

/* 確定数字（大きい文字） */
.assist-fixed {
    font-size: 22px;
    font-weight: bold;
}

/* 9候補の 3×3 グリッド */
.assist-cands {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

/* 候補数字 */
.assist-cand {
    font-size: 13px;
    color: red;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ブロックの太枠 */
.assist-cell[data-col="0"] { border-left: 3px solid #444; }
.assist-cell[data-col="3"] { border-left: 3px solid #444; }
.assist-cell[data-col="6"] { border-left: 3px solid #444; }
.assist-cell[data-col="8"] { border-right: 3px solid #444; }

.assist-cell[data-row="0"] { border-top: 3px solid #444; }
.assist-cell[data-row="3"] { border-top: 3px solid #444; }
.assist-cell[data-row="6"] { border-top: 3px solid #444; }
.assist-cell[data-row="8"] { border-bottom: 3px solid #444; }

/* =====================================
   メッセージ表示領域（info-area）
===================================== */
#info-area {
    margin-top: 50px ;
    margin-left: 0px;
    width: 350px;        /* Sudoku パネルと幅を揃える */
    padding: 10px 15px;
    border: 2px solid #666;
    border-radius: 8px;
    background: #f9f9f9;
    font-size: 16px;
    color: #333;
    text-align: center;
    min-height: 30px;
    box-sizing: border-box;
}

/* 空白セル数入力用テンキー */
/* info-area を基準位置にする */
#info-area {
  position: relative;
}

/* 空白セル数入力用テンキー：info-area の「上」に表示 */
.numpad-empty {
  position: absolute;

  /* ★ info-area の 35% 上位置（＝真上） */
  bottom: 48%;

  /* 少し余白を入れて浮かせる */
  margin-bottom: 10px;

  /* 横方向中央寄せ */
  left: 60%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 56px);
  gap: 8px;
  padding: 10px;
  background: #ffffff;
  border: 2px solid #666;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  z-index: 1500;
} 

/* ボタンデザイン */
.numpad-empty div {
  width: 56px;
  height: 46px;
  line-height: 46px;
  text-align: center;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  background: #f3f7ff;
  border: 1px solid #7aa7ff;
}

.numpad-empty div[data-num="cl"] {
  background:#ffecec;
  border-color:#e06a6a;
}

.numpad-empty div[data-num="enter"] {
  background:#e6ffe6;
  border-color:#76c776;
}

.numpad-empty div:hover {
    background: #f6f671;
}

/* 非表示 */
.numpad-empty.hidden {
  display: none;
}

/* 全体 */
.top-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px 0 10px 0;
}

/* ボタン共通 */
.menu-btn {
    padding: 6px 16px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #666;
}

/* 個別色 */
.exit-btn {
    background:#ffe2e2;
}
.btn-new {
    background:rgb(179, 240, 241);
    /* background:#efffe2; */
}
.help-btn {
    background:#e6ffe6;
}

/* ラベル */
.label-text {
    font-size: 18px;
    padding: 0 4px;
}

/* 入力欄 */
.num-input {
    width: 50px;
    height: 25px;
    font-size: 20px;
    text-align: center;
}

/* レベル表示（★は JS で更新予定） */
.level-stars {
    font-size: 22px;
    color: #f0a000;
}

/* カスタムアラート設定 */
.custom-alert {
    position: fixed;
    top: 180px;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: rgba(0,0,0,0.4); */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.custom-alert.hidden {
    display: none;
}
.alert-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    border: 2px solid #666;
    border-radius: 8px;

}

/* 紙吹雪 */
.kami {
  width: 15px;
  height: 10px;
  position: fixed;
}

/* チェック判定表示 */
/* ★ 完了メッセージエリア（中央に表示） ★ */
#clear-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    text-align: center;
    background: rgba(255,255,255,0.93);
    border-radius: 20px;
    padding: 40px 20px;
    box-shadow: 0 0 25px rgba(0,0,0,0.3);
    z-index: 99999;
}

/* 非表示用 */
.hide {
    display: none;
}

/* 見出し */
#clear-message h1 {
    font-size: 48px;
    font-weight: bold;
    color: #d10000;
    margin: 0 0 20px;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.4);
}

/* メッセージ */
#clear-message p {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin: 0 0 40px;
}

/* ボタン */
#exit2 {
    margin-left: 20px;
    padding: 15px 30px;
    font-size: 22px;
    font-weight: bold;
    color: white;
    background: #666;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}
#exit2:hover {
    background: #333;
}

#reset2 {
    display: inline-block;
    padding: 15px 30px;
    font-size: 22px;
    font-weight: bold;
    color: white;
    background: #0088ff;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0px 3px 6px rgba(0,0,0,0.3);
    transition: 0.2s;
}

/* ホバー効果 */
#reset2:hover {
    background: #005bbb;
}

/* ================================
   盤面下 全体ラッパー
================================ */
#sub-wrapper {
    /* display: flex; */
    justify-content: center;
    gap: 40px;
    margin-top: 0px;
}

/* ================================
   左側パネル（残数 + info）
================================ */
#aside {
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#number-panel {
    width: 330px;
    display: flex;
    justify-content: space-between;
    margin: 5px;
    padding: 3px;
}
#info-area {
    width: 100%;
    margin-top: 20px;
}


/* ================================
   右側：攻略ボタンパネル
================================ */
.control-panel {
    width: 330px;
    padding: 10px; /* 外枠とボタンの間隔 */
    border: 2px solid #666;
    border-radius: 12px;
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 10px; /* ボタン縦間隔 */
    align-items: center;
    justify-content: center;
  }

.control-panel button,
.control-panel input[type="button"] {
    padding: 10px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    border: 1px solid #4a90e2;
    background: #e8f1ff;
    cursor: pointer;
    transition: 0.15s;
}

.control-panel button:hover,
.control-panel input[type="button"]:hover {
    background: #d4e6ff;
}

#btn-check { background:#ffecec; border-color:#d9534f; }
#btn-hint  { background:#fff6d6; border-color:#f0ad4e; }
#btn-solve { background:#e6ffe6; border-color:#5cb85c; }

#btn-check:hover { background:#ffdada; }
#btn-hint:hover  { background:#ffedb8; }
#btn-solve:hover { background:#d0f5d0; }

.grup8, .grup9, .grup10 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* ================================
   上部3ボタン 横一列固定
================================ */
#top-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    flex-wrap: nowrap;      /* 折り返し禁止 */
    white-space: nowrap;

    margin-bottom: 0px;
}

/* ボタンを横並び用に圧縮 */
#top-buttons button {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: bold;

    min-width: unset;       /* 幅固定解除 */
    flex: 0 0 auto;         /* 勝手に伸びない */
}

#btn-solve.active {
    background: #ffcccc;
    font-weight: bold;
}


/* ================================
   📱 スマホ縦型レイアウト（完成版）
================================ */
@media (max-width: 768px) {

  body {
    margin: 0;
    padding: 8px;
  }

  h1 {
    font-size: 22px;
    margin: 6px 0;
  }

  /* ================================
     上部操作ボタン
  ================================ */
  .top-controls {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .menu-btn {
    font-size: 14px;
    padding: 6px 10px;
  }

  /* ================================
     メイン盤面・補助盤面 → 縦並び
  ================================ */
  #main-wrapper {
    flex-direction: column;
    gap: 12px;
    margin: 0 auto;
  }

  #sub-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  #board-container,
  #assist-container {
    width: 90vw;
    height: 90vw;
    max-width: 360px;
    max-height: 360px;
  }

  /* ================================
     残数パネル + info
  ================================ */
  #aside {
    margin: 0 auto;
  }

  #number-panel {
    width: 100vw;
    max-width: 300px;
    margin: 10px auto;
    justify-content: space-around;
  }

  .num-btn {
    width: 32px;
    height: 56px;
    font-size: 18px;
  }

  #info-area {
    width: 90vw;
    max-width: 360px;
    margin: 10px auto;
    font-size: 14px;
  }

  /* ================================
     攻略ボタンパネル
  ================================ */
  .control-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
  }

  .control-panel button,
  .control-panel input {
    font-size: 14px;
    padding: 6px 8px;
  }

  .grup8,
  .grup9,
  .grup10 {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }

  /* ================================
     🔢 セル入力用テンキー
     ・hidden 制御を優先
     ・画面下固定
  ================================ */
/* @media (max-width: 768px) { */
  #numpad {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 10px;

    background: #f5f5f5;
    border-top: 2px solid #666;
  }

  #numpad div {
    height: 48px;
    line-height: 48px;
    font-size: 18px;
  }
}

  /* ================================
     🔢 空白セル数指定用テンキー
     ・中央寄せ transform 無効化
  ================================ */
@media (max-width: 768px) {

  /* 空白セル数指定用テンキー */
  #numpad-empty {
    position: fixed;
    bottom: 260px; 
    /* top: 30%; */
    left: 50%;
    transform: translateX(-50%);
    display: none;

    /* display: grid; */
    grid-template-columns: repeat(3, 56px);
    gap: 8px;

    padding: 12px;
    background: #ffffff;
    border: 2px solid #666;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);

    /* ★重要 */
    box-sizing: border-box;
    min-height: 200px;             /* ← はみ出し防止の決定打 */

    z-index: 15000;
  }

  #numpad-empty div {
    width: 56px;
    height: 46px;
    line-height: 46px;
    font-size: 18px;
    text-align: center;
    user-select: none;
    border-radius: 6px;
  }

/* } */

#numpad-empty:not(.hidden) {
  display: grid;
}

  /* ================================
     クリアメッセージ
  ================================ */
  #clear-message {
    width: 90%;
    padding: 20px;
  }

  #clear-message h1 {
    font-size: 32px;
  }

  #clear-message p {
    font-size: 20px;
  }

  #reset2,
  #exit2 {
    font-size: 18px;
    padding: 10px 20px;
  }
}

/* 表示用 */
#numpad:not(.hidden) {
  display: grid;
}

#numpad.hidden {
  display: none;
}


/* =====================================================
   💻 PC用 横並びレイアウト（強制上書き）
===================================================== */
@media screen and (min-width: 900px) {

  /* ===== 全体 ===== */
  body {
    display: flex;
    justify-content: center;
  }

  .layout {
    width: 1000px;
  }

  /* ===== 上段：2列固定 ===== */
  #main-wrapper {
  display: flex;
  /* flex-direction: column;   ★ 常に縦 */
  gap: 20px;
  align-items: flex-start;
}

  /* #main-wrapper {
    display: grid !important;
    grid-template-columns: 300px 340px !important;
    gap: 24px;
    align-items: start;
  } */

  /* ===== メインボード ===== */
  #board-container {
    width: 300px;
    height: 300px;
  }

  /* ===== 右側まとめエリア ===== */
  #aside {
    width: 300px;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
  }

  /* ===== コントロールパネル ===== */
  .control-panel {
    width: 100%;
  }

  /* 上部3ボタン */
  #top-buttons {
    display: flex;
    gap: 6px;
  }

  #top-buttons button {
    flex: 1;
  }

  /* 攻略ボタン：横一列 */
  .grup8,
  .grup9,
  .grup10 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  /* ===== 残数表示パネル（←重要） ===== */
  #number-panel {
    display: flex !important;
    justify-content: space-between;
    gap: 4px;
  }

  .num-btn {
    width: 25px;
    height: 44px;
    font-size: 20px;
  }

  /* ===== info-area ===== */
  #info-area {
    width: 100%;
    min-height: 70px;
  }

  /* ===== 操作説明エリア ===== */
  #guide-area {
    width: 100%;
    padding: 10px;
    border: 2px solid #666;
    border-radius: 10px;
    background: #f8fbff;
    font-size: 13px;
  }

  /* ===== 補助パネル（左寄せに修正） ===== */
  #assist-container {
    width: 300px;
    height: 300px;
    margin: 20px 0 0 0 !important; /* ←中央寄せ解除 */
  }
}

/* ===============================
   補助パネル＋操作説明 共通
================================ */
#assist-wrapper {
  /* display: flex; */
  gap: 40px;
  margin-top: 0px;
}

/* 補助パネル */
#assist-container {
  width: 300px;
  height: 300px;
  border: 2px solid #444;
}

/* 操作説明枠 */
#assist-help {
  margin-top: 15px;
  width: 330px;
  height: 205px;                 /* control-panel に合わせる */
  padding: 12px;
  border: 2px solid #666;
  background: #f9f9f9;
  font-size: 14px;
}

#assist-help h3 {
  margin-top: 0;
  font-size: 16px;
  border-bottom: 1px solid #aaa;
}

#assist-help ul {
  padding-left: 18px;
}

/* ===============================
   📱 スマホ：縦配置
================================ */
@media (max-width: 768px) {
  #assist-wrapper {
    flex-direction: column;
    align-items: center;
  }

  #assist-help {
    width: 100%;
    max-width: 300px;
  }
}

/* パネル等の幅統一
「右側パネル共通の基準幅」を 1 つ決める */
:root {
  --side-panel-width: 350px;
}

/* 右側まとめ */
#aside,
.control-panel,
#info-area,
#assist-help {
  width: var(--side-panel-width);
  box-sizing: border-box;
}

/* control-panel 内の上部3ボタンを「幅いっぱい」にする */
#top-buttons {
  display: flex;
  gap: 8px;
}

#top-buttons button {
  flex: 1;                 /* ← これが最重要 */
  padding: 10px 0;
  font-size: 14px;
  text-align: center;
}

/* 残数表示パネル
横幅を「均等」にしたい場合（おすすめ */
#number-panel {
  display: grid;
  grid-template-columns: repeat(10, 1fr); /* 1〜9 + CL */
  gap: 6px;
}

.num-btn {
  width: 100%;
  height: 56px;
}
