* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 22px 24px 40px;
  font-family: "M PLUS Rounded 1c", -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: #5b4a4a;
  background: #fffdfb;
  line-height: 1.8;
  font-size: 14px;
}

h1 {
  font-size: 20px;
  font-weight: 800;
  color: #e85d84;
  margin: 0 0 10px;
}

h2 {
  font-size: 15px;
  font-weight: 700;
  color: #e85d84;
  margin: 26px 0 8px;
  border-bottom: 2px solid #ffe3ec;
  padding-bottom: 4px;
}

p {
  margin: 8px 0;
}

ul, ol {
  padding-left: 1.4em;
  margin: 8px 0;
}

li {
  margin: 4px 0;
}

a {
  color: #e85d84;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

th, td {
  border: 1px solid #ffe3ec;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #ffe3ec;
  width: 30%;
  white-space: nowrap;
}

hr {
  border: none;
  border-top: 2px solid #ffe3ec;
  margin: 22px 0;
}

.meta {
  color: #9c8d8d;
  font-size: 13px;
}

.disclaimer {
  background: #fff6ea;
  border: 2px solid #ffe9d1;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  color: #8a6d4a;
  margin-top: 22px;
}

/* 以下は遊び方ページ(rules.html)専用の図解パーツ。他の規約ページには影響しない。 */

.rules-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.rules-hero h1 {
  margin: 0 0 4px;
}

.figure-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 16px 0 6px;
  padding: 18px 14px;
  background: #fff6fa;
  border: 2px solid #ffe3ec;
  border-radius: 16px;
}

.figure-caption {
  text-align: center;
  color: #9c8d8d;
  font-size: 12px;
  margin: 0 0 18px;
}

.figure-arrow {
  font-size: 20px;
  color: #e85d84;
  flex-shrink: 0;
}

/* 遊び方ページに埋め込むミニ盤面。--size で 3x3 等を切り替える。
   .on = 表(クォッカの顔) / .off = 裏。 .target = タップした場所。 */
.mini-board {
  --size: 3;
  /* 1マスの大きさ。手順を何枚も並べる図では、生成側が --cell-base に小さい値を
     渡して横に並ぶようにする(10×10を何枚も並べても画面に収まるように)。 */
  --cell-base: 30px;
  --cell: var(--cell-base);
  display: grid;
  grid-template-columns: repeat(var(--size), var(--cell));
  grid-auto-rows: var(--cell);
  gap: 3px;
  padding: 6px;
  background: #ffffff;
  border: 2px solid #ffe3ec;
  border-radius: 10px;
  flex-shrink: 0;
}

.mini-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  /* マスの大きさに合わせて絵文字も縮める。 */
  font-size: calc(var(--cell) * 0.6);
  line-height: 1;
  border-radius: 5px;
  background: linear-gradient(155deg, #cbb59a 0%, #8a745c 100%);
}

.mini-cell.on {
  background: linear-gradient(155deg, #ffe6b0 0%, #f2b73f 100%);
}

.mini-cell.target {
  outline: 2px solid #4a9ad4;
  outline-offset: -2px;
}

/* 1手ずつの手順図。盤面の上に「何手目・どこを押すか」を出して、
   左から右へ追えるようにする。 */
.step-row {
  align-items: flex-start;
  gap: 8px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.step-label {
  font-size: 10px;
  line-height: 1.4;
  color: #9c8d8d;
  text-align: center;
  white-space: nowrap;
}

.step-press {
  color: #2f6f96;
  font-weight: 700;
}

.step-clear {
  color: #e85d84;
  font-weight: 800;
}

/* 手順図の矢印は、盤面の高さの真ん中あたりに来るよう少し下げる。 */
.step-row .figure-arrow {
  align-self: center;
  font-size: 14px;
}

.status-chip-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid #ffe3ec;
  font-weight: 700;
  font-size: 12px;
  color: #e85d84;
}

/* サイズごとのクリアボーナス表。 */
.bonus-table td, .bonus-table th {
  text-align: center;
}

/* スマホなど幅の狭い画面向け。参加画面から開くポップアップ(iframe)内でも、
   iframeの幅を基準にこの指定が効く。 */
@media (max-width: 480px) {
  body {
    padding: 18px 14px 32px;
  }

  th {
    width: 34%;
    white-space: normal;
  }

  .figure-row {
    gap: 10px;
    padding: 16px 10px;
  }

  /* 狭い画面では少しだけ詰める。--cell を直接上書きすると、手順図で
     生成側が指定した小さいサイズまで巻き戻してしまうので、掛け算で縮める。 */
  .mini-board {
    --cell: calc(var(--cell-base, 30px) * 0.87);
  }
}
