/* バトルえんぴつ — モバイルファースト。
   ベース（メディアクエリの外）はスマートフォン幅。広い画面は min-width で拡張する。 */

:root {
  --ink: #2b1d14;
  --paper: #fbf3dc;
  --paper-2: #f3e6bd;
  --yellow: #f2c230;
  --yellow-d: #c99a10;
  --pink: #ee8fa5;
  --red: #d8472f;
  --green: #3aa76d;
  --blue: #2f7fd0;
  --shadow: 0 3px 0 rgba(43, 29, 20, 0.9);
  --font: 'Nunito', 'Hiragino Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-title: 'Dela Gothic One', 'Nunito', 'Hiragino Sans', 'Segoe UI', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* 言語（文字の種類）ごとのフォント。html の data-font は js/i18n.js が付ける。
   中国語・日本語・韓国語は同じ漢字でも字形が違うので、言語ごとに専用のフォントを先頭に置く。
   読み込めなくても、端末に入っている標準フォントで表示される */
html[data-font='ja'] {
  --font: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', sans-serif;
  --font-title: 'Dela Gothic One', 'Zen Maru Gothic', 'Hiragino Sans', sans-serif;
}
html[data-font='ko'] {
  --font: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-title: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
html[data-font='zh-Hans'] {
  --font: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-title: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
html[data-font='zh-Hant'] {
  --font: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --font-title: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}
html[data-font='th'] {
  --font: 'Noto Sans Thai', 'Thonburi', 'Leelawadee UI', sans-serif;
  --font-title: 'Noto Sans Thai', 'Thonburi', 'Leelawadee UI', sans-serif;
}
html[data-font='hi'] {
  --font: 'Noto Sans Devanagari', 'Kohinoor Devanagari', 'Nirmala UI', sans-serif;
  --font-title: 'Noto Sans Devanagari', 'Kohinoor Devanagari', 'Nirmala UI', sans-serif;
}
html[data-font='bn'] {
  --font: 'Noto Sans Bengali', 'Kohinoor Bangla', 'Nirmala UI', sans-serif;
  --font-title: 'Noto Sans Bengali', 'Kohinoor Bangla', 'Nirmala UI', sans-serif;
}
html[data-font='ar'] {
  --font: 'Noto Sans Arabic', 'Geeza Pro', 'Segoe UI', Tahoma, sans-serif;
  --font-title: 'Noto Sans Arabic', 'Geeza Pro', 'Segoe UI', Tahoma, sans-serif;
}
html[data-font='he'] {
  --font: 'Noto Sans Hebrew', 'Arial Hebrew', 'Segoe UI', Arial, sans-serif;
  --font-title: 'Noto Sans Hebrew', 'Arial Hebrew', 'Segoe UI', Arial, sans-serif;
}
/* タイトル用の書体が単一太さ（Dela Gothic One）でない言語は、見出しを太字にする */
html[data-font='ko'] :is(h1, h2, .banner .b-main, .timer-num, .vs),
html[data-font='zh-Hans'] :is(h1, h2, .banner .b-main, .timer-num, .vs),
html[data-font='zh-Hant'] :is(h1, h2, .banner .b-main, .timer-num, .vs),
html[data-font='th'] :is(h1, h2, .banner .b-main, .timer-num, .vs),
html[data-font='hi'] :is(h1, h2, .banner .b-main, .timer-num, .vs),
html[data-font='bn'] :is(h1, h2, .banner .b-main, .timer-num, .vs),
html[data-font='ar'] :is(h1, h2, .banner .b-main, .timer-num, .vs),
html[data-font='he'] :is(h1, h2, .banner .b-main, .timer-num, .vs) {
  font-weight: 900;
}
/* つなげて書く文字・上下に記号がつく文字は、字間をあけたり行を詰めたりすると崩れる */
html[data-font='ar'] *,
html[data-font='he'] *,
html[data-font='hi'] *,
html[data-font='bn'] *,
html[data-font='th'] * {
  letter-spacing: 0 !important;
}
html[data-font='ar'] :is(h1, h2, .banner .b-main),
html[data-font='he'] :is(h1, h2, .banner .b-main),
html[data-font='hi'] :is(h1, h2, .banner .b-main),
html[data-font='bn'] :is(h1, h2, .banner .b-main),
html[data-font='th'] :is(h1, h2, .banner .b-main) {
  line-height: 1.45;
}
/* 大きな演出の文字（縁取りつき）は、上下に記号がつく文字では縁取りを細くして、つぶれないようにする */
html[data-font='hi'] .banner .b-main,
html[data-font='bn'] .banner .b-main,
html[data-font='th'] .banner .b-main,
html[data-font='ar'] .banner .b-main {
  -webkit-text-stroke-width: 5px;
}
/* 韓国語は単語の途中で改行しない。長い単語（ドイツ語など）は、はみ出す前に折り返す */
html[data-font='ko'] {
  word-break: keep-all;
}
body {
  overflow-wrap: break-word;
}
/* 狭い枠（鉛筆のカード・ボタン）に収まらない長い単語は、枠からはみ出して切れるより、途中で折り返す */
.pk-name,
.pencil-chip span,
.slot span,
.face-chip small,
.opt b,
.opt small,
.tag,
.pd-title b,
.fc-pencil,
.badge {
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* 最初の文言の差し込みが済むまで画面を隠す（元の言語の文字が一瞬見えるのを防ぐ） */
html:not([data-ready]) :is(.screen, .modal, .icon-btn, .lang-btn) {
  visibility: hidden;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #2a1b12;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

[hidden] {
  display: none !important;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(20, 8, 0, 0.55) 100%);
}

/* ---------- 右から左に書く言語（アラビア語・ヘブライ語） ----------
   3D の机は左右を反転しない（自分の鉛筆は左、相手は右）ので、画面の部品の置き場所（HUD・横長の右パネル・
   ボタン）は、どの言語でも同じ。文字の流れ（右から左）と行頭・行末だけを言語に合わせる。
   部品の入れ物は direction: ltr で置き場所を固定し、中の文字を持つ箱だけ rtl に戻す。 */
.screen,
.hud,
.hud > *,
.icon-btn,
.lang-btn {
  direction: ltr;
}
html[dir='rtl'] :is(.title-card, .sheet, .modal-card, .hud > *, .toast, .banner, .lang-btn) {
  direction: rtl;
}
/* 数値・ゲージ・記号まじりの表示は、どの言語でも左から右 */
.hp,
.timer,
#cpu-hp-text,
#player-hp-text,
.float-num,
.janken-vs .vs {
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- 共通パーツ ---------- */
.screen {
  position: fixed;
  inset: 0;
  pointer-events: none; /* 3D をスワイプできるように、中身だけ有効化する */
}
.screen > * {
  pointer-events: auto;
}

.btn {
  font: inherit;
  font-weight: 900;
  font-size: 1.05rem;
  min-height: 48px;
  padding: 0 1.4rem;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.btn-primary {
  background: var(--yellow);
}
.btn-ghost {
  background: var(--paper);
}
.btn-small {
  padding: 0 1rem;
  font-size: 0.95rem;
}
.btn:focus-visible,
.hand:focus-visible,
.roll-btn:focus-visible,
.pencil-chip:focus-visible,
.icon-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.icon-btn {
  position: fixed;
  right: 12px;
  top: calc(var(--safe-t) + 12px);
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  font-size: 1.4rem;
  cursor: pointer;
}

/* 言語ボタン：ミュートボタンの隣。地球儀＋いまの言語の名前。戦闘中は隠す（途中で言葉が変わらないように） */
.lang-btn {
  position: fixed;
  right: 64px;
  top: calc(var(--safe-t) + 12px);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  max-width: calc(100vw - 64px - 12px - 12px);
  padding: 0 14px 0 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.lang-btn .ic {
  width: 1.5em;
  height: 1.5em;
  vertical-align: 0;
}
.lang-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.5; /* 省略のために overflow: hidden なので、行の高さを十分に取って、はみ出す文字（下に突き出る記号など）が切れないようにする */
}
/* アラビア文字の上下の記号まで、省略用の枠内に収める。 */
html[data-font='ar'] .lang-btn span {
  line-height: 2.4;
}
.lang-btn:focus-visible,
.lang-opt:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
body[data-mode='battle'] .lang-btn {
  display: none;
}

/* 言語の選択シート：各言語を、その言語での名前で並べる（読めない言語の人でも自分の言語を見つけられる） */
.lang-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 8px);
  max-width: 460px;
}
.lang-card h2 {
  flex: none;
}
.lang-list {
  flex: 1 1 auto;
  min-height: 0;
  list-style: none;
  margin: 8px 0 14px;
  padding: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.lang-opt {
  width: 100%;
  min-height: 48px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
  text-align: start;
}
.lang-opt[aria-checked='true'] {
  background: var(--yellow);
  box-shadow: var(--shadow);
}
.lang-opt .ic {
  width: 1.2em;
  height: 1.2em;
  vertical-align: 0;
}
/* 各言語の名前は、その言語のフォントで出す */
.lang-opt[lang='ja'] { font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif; }
.lang-opt[lang='ko'] { font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }
.lang-opt[lang='zh-Hans'] { font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
.lang-opt[lang='zh-Hant'] { font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif; }
.lang-opt[lang='th'] { font-family: 'Noto Sans Thai', 'Thonburi', 'Leelawadee UI', sans-serif; }
.lang-opt[lang='hi'] { font-family: 'Noto Sans Devanagari', 'Kohinoor Devanagari', 'Nirmala UI', sans-serif; }
.lang-opt[lang='bn'] { font-family: 'Noto Sans Bengali', 'Kohinoor Bangla', 'Nirmala UI', sans-serif; }
.lang-opt[lang='ar'], .lang-opt[lang='fa'] { font-family: 'Noto Sans Arabic', 'Geeza Pro', 'Segoe UI', Tahoma, sans-serif; }
.lang-opt[lang='he'] { font-family: 'Noto Sans Hebrew', 'Arial Hebrew', 'Segoe UI', Arial, sans-serif; }
/* 上以外（ラテン文字・キリル文字・ギリシャ文字）は Nunito 系 */
.lang-opt:not([lang='ja'], [lang='ko'], [lang='zh-Hans'], [lang='zh-Hant'], [lang='th'], [lang='hi'], [lang='bn'], [lang='ar'], [lang='fa'], [lang='he']) {
  font-family: 'Nunito', 'Hiragino Sans', 'Segoe UI', Arial, sans-serif;
}

/* ---------- SVG アイコン（img/icons.svg）。大きさは文字に合わせる ---------- */
.ic {
  display: inline-block;
  flex: none;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* アイコンを文字と並べる箱は、横に並べて中央をそろえる */
.badge,
.tap-hint,
.btn-line,
.legend .fi,
.face-chip .fi,
.opt-icon,
.hand-icon,
.janken-vs b,
.match-spin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
}
.badge .ic,
.tap-hint .ic {
  width: 1.15em;
  height: 1.15em;
  vertical-align: 0;
}
.opt-icon .ic,
.hand-icon .ic,
.janken-vs b .ic,
.match-spin .ic,
.legend .fi .ic,
.face-chip .fi .ic {
  width: 1em;
  height: 1em;
  vertical-align: 0;
}
.janken-vs b {
  display: flex;
}
.janken-vs b .ic {
  margin: 0 auto;
}
.btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
}

/* ---------- タイトル ---------- */
#title {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(var(--safe-b) + 24px);
}
.title-card {
  width: 100%;
  max-width: 460px;
  text-align: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 rgba(43, 29, 20, 0.9);
  padding: 20px 18px 22px;
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(70, 130, 200, 0.18) 27px 28px);
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #7a5a3a;
}
h1 {
  margin: 0 0 8px;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.05;
  letter-spacing: 0.02em;
}
/* 題名は 2 つの語（1 行目は赤）。語ごとにまとめて折り返し、語の途中では折らない。
   長い言語・狭い画面では js（fitTitle）が文字を縮めて 1 語を 1 行に収める */
h1 span {
  display: inline-block;
  white-space: nowrap;
}
h1 span:first-child {
  color: var(--red);
}
h1 span + span {
  margin-inline-start: 0.22em;
}
html[data-font='ja'] h1 span + span,
html[data-font='ko'] h1 span + span,
html[data-font='zh-Hans'] h1 span + span,
html[data-font='zh-Hant'] h1 span + span {
  margin-inline-start: 0.12em;
}
.lead {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  text-wrap: balance;
}
/* 紹介文は、句ごとのまとまりで折り返す（句の途中で改行しない）。日本語・中国語は語の間に空白を入れない */
.lead span {
  display: inline-block;
}
.lead span + span {
  margin-inline-start: 0.3em;
}
html[data-font='ja'] .lead span + span,
html[data-font='zh-Hans'] .lead span + span,
html[data-font='zh-Hant'] .lead span + span {
  margin-inline-start: 0;
}
.title-actions {
  display: grid;
  gap: 12px;
}

/* ---------- 鉛筆選択 ---------- */
#select {
  display: flex;
  align-items: flex-end;
}
.sheet {
  width: 100%;
  max-height: 62%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -4px 0 rgba(43, 29, 20, 0.35);
  padding-top: 14px;
}
/* 中身だけスクロールし、下の操作ボタンは常に見える */
.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px 10px;
  touch-action: pan-y;
}
.sheet-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 900;
}
.pencil-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pencil-chip {
  width: 100%;
  min-height: 56px;
  padding: 6px 4px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pencil-chip .swatch {
  width: 100%;
  height: 10px;
  border-radius: 5px;
  border: 1.5px solid rgba(0, 0, 0, 0.5);
}
.pencil-chip[aria-selected='true'] {
  background: var(--yellow);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.pencil-detail h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}
.tag.tag-hp {
  background: #ffd9d9;
}
.detail-desc {
  margin: 0 0 10px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.face-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.face-chip {
  border: 2px solid rgba(0, 0, 0, 0.55);
  border-radius: 10px;
  padding: 4px 2px;
  text-align: center;
  line-height: 1.15;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.face-chip .fi {
  font-size: 1.3rem;
}
.face-chip b {
  font-size: 1.05rem;
  font-weight: 900;
}
.face-chip small {
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.85;
}
.sheet-actions {
  flex: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 10px 14px calc(var(--safe-b) + 14px);
  border-top: 2px solid rgba(43, 29, 20, 0.14);
}

/* ---------- バトル HUD ---------- */
.hud {
  position: fixed;
  left: 0;
  right: 0;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.hud > * {
  pointer-events: auto;
}
.hud-top {
  top: calc(var(--safe-t) + 12px);
  padding-right: 64px; /* ミュートボタンを避ける */
}
.hud-bottom {
  bottom: calc(var(--safe-b) + 12px);
}

.fighter-card {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px 12px 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.fighter-card.active {
  box-shadow: 0 3px 0 var(--ink), 0 0 0 4px var(--yellow);
}
.fighter-card.shake {
  animation: shake 0.4s;
}
.fc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.fc-name {
  font-weight: 900;
  font-size: 0.95rem;
}
.fc-name {
  min-width: 0;
}
.fc-pencil {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b4d33;
  text-align: end;
}
.hp {
  position: relative;
  height: 16px;
  margin: 4px 0 2px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.hp-fill,
.hp-ghost {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
}
.hp-fill {
  background: linear-gradient(#7be0a2, #3aa76d);
  transition: width 0.5s ease-out, background 0.3s;
  z-index: 1;
}
.hp-fill.mid {
  background: linear-gradient(#ffe27a, #f2b830);
}
.hp-fill.low {
  background: linear-gradient(#ff9b8a, #d8472f);
}
.hp-ghost {
  background: #f7f7f7;
  transition: width 1s ease-out 0.35s;
}
.fc-foot {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 900;
}
.badge {
  padding: 0 8px;
  border-radius: 999px;
  background: #cfe3ff;
  border: 1.5px solid var(--ink);
  font-size: 0.7rem;
}

.badge-charge {
  background: #ffd9a0;
}

.float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.float-num {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--red);
  -webkit-text-stroke: 4px #fff;
  paint-order: stroke fill;
  animation: floatup 1.1s ease-out forwards;
}
.float-num.heal {
  color: var(--green);
}

.action {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 8px 12px 10px;
}
.action.waiting .roll-btn {
  opacity: 0.45;
  pointer-events: none;
}
.turn-msg {
  margin: 0 0 6px;
  font-weight: 900;
  font-size: 0.9rem;
}
.roll-btn {
  position: relative;
  width: 100%;
  min-height: 60px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  touch-action: none;
}
.roll-btn:disabled {
  color: var(--ink);
}
.action.flick .roll-btn {
  background: var(--yellow);
  animation: pulse 0.9s ease-in-out infinite;
}
.tap-hint {
  position: fixed;
  z-index: 6;
  transform: translate(-50%, -190%);
  pointer-events: none;
  padding: 4px 12px;
  font-weight: 900;
  font-size: 0.95rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: bob 0.9s ease-in-out infinite;
}
.roll-label {
  position: relative;
  font-weight: 900;
  font-size: 1.15rem;
}
.hint {
  margin: 6px 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: #6b4d33;
}

.banner {
  position: fixed;
  left: 0;
  right: 0;
  top: 38%;
  text-align: center;
  pointer-events: none;
  padding: 0 12px;
  z-index: 5;
}
.banner .b-main {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 2.3rem;
  line-height: 1.15;
  color: #fff;
  -webkit-text-stroke: 8px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.35);
  animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.banner .b-main.good {
  color: #ffe45c;
}
.banner .b-main.bad {
  color: #ff9d8f;
}
.banner .b-sub {
  margin-top: 6px;
  display: inline-block;
  padding: 3px 14px;
  font-weight: 900;
  font-size: 0.95rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: pop 0.35s 0.08s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.banner > div {
  display: block;
}

/* スワイプの矢印 */
.swipe-arrow {
  position: fixed;
  z-index: 8;
  width: 10px;
  transform-origin: 50% 100%;
  border-radius: 6px;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(255, 226, 122, 0.1), rgba(255, 226, 122, 0.95));
  box-shadow: 0 0 12px rgba(255, 210, 90, 0.9);
}

/* ---------- モーダル ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 8, 0, 0.55);
}
.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 rgba(43, 29, 20, 0.9);
  padding: 20px 18px;
  text-align: center;
  animation: pop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.modal-card h2 {
  margin: 0 0 6px;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 1.7rem;
}
.modal-scroll {
  max-height: 86%;
  overflow-y: auto;
  text-align: start;
  touch-action: pan-y;
}
.modal-scroll h2 {
  text-align: center;
}
.modal-scroll .btn {
  width: 100%;
  margin-top: 8px;
}
.howto-list {
  padding-inline-start: 1.3em;
  line-height: 1.65;
  font-size: 0.92rem;
}
.howto-list li {
  margin-bottom: 6px;
}
.modal-scroll h3 {
  margin: 12px 0 6px;
  font-size: 1rem;
}
.legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}
.legend li {
  display: flex;
  gap: 8px;
  align-items: center;
  line-height: 1.4;
}
.legend .fi {
  width: 28px;
  font-size: 1.3rem;
  text-align: center;
}
.note {
  font-size: 0.78rem;
  line-height: 1.6;
  color: #6b4d33;
  margin: 12px 0 0;
}

.janken-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.hand {
  font: inherit;
  font-weight: 900;
  min-height: 92px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.hand-icon {
  font-size: 2.2rem;
}
.hand:active {
  transform: translateY(3px);
  box-shadow: none;
}
.janken-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 14px;
}
.janken-vs b {
  display: block;
  font-size: 3.4rem;
}
.janken-vs small {
  font-weight: 900;
}
.janken-vs .vs {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--red);
}

.result-eyebrow {
  margin: 0;
  font-weight: 900;
  color: #7a5a3a;
}
.result-card h2 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 4px 0 8px;
}
.result-card.win h2 {
  color: var(--red);
}
.result-card.lose h2 {
  color: #3a4a7a;
}
.result-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}


/* ---------- モード選択 ---------- */
#mode {
  display: flex;
  align-items: flex-end;
}
.group-label {
  margin: 10px 0 6px;
  font-size: 0.85rem;
  font-weight: 900;
  color: #7a5a3a;
}
.opt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.opt {
  font: inherit;
  color: var(--ink);
  min-height: 92px;
  padding: 10px 8px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  line-height: 1.25;
}
.opt b {
  font-size: 0.95rem;
  font-weight: 900;
}
.opt small {
  font-size: 0.68rem;
  font-weight: 700;
  color: #6b4d33;
}
.opt-icon {
  font-size: 1.5rem;
}
.opt[aria-checked='true'] {
  background: var(--yellow);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.opt-hot[aria-checked='true'] {
  background: #ffb199;
}
.opt:focus-visible,
.pk-tile:focus-visible,
.slot:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.rule-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
  line-height: 1.55;
  min-height: 3.1em;
}
/* ---------- 筆箱（ガチバトルの選択） ---------- */
.loadout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px;
  border: 2px dashed rgba(43, 29, 20, 0.45);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}
.slot {
  font: inherit;
  color: var(--ink);
  min-height: 48px;
  padding: 4px 6px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.slot .swatch {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  border: 1.5px solid rgba(0, 0, 0, 0.5);
}
.slot.empty {
  border-style: dashed;
  border-color: rgba(43, 29, 20, 0.35);
  background: transparent;
  color: #9a7d5e;
  cursor: default;
}
.pencil-chip {
  position: relative;
}
.pencil-chip .order {
  position: absolute;
  top: -8px;
  inset-inline-end: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  line-height: 18px;
  text-align: center;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* ---------- 選出（あいての筆箱を見て、自分の筆箱から1本えらぶ） ---------- */
.modal-top {
  align-items: flex-start;
  padding-top: calc(var(--safe-t) + 64px); /* 上に制限時間を出す */
}
.pick-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 4px);
  padding: 12px 12px 12px;
  text-align: start;
}
.pick-head {
  flex: none;
  margin-bottom: 6px;
  text-align: center;
}
.pick-card h2 {
  margin: 0;
  font-size: 1.15rem;
}
.pick-sub {
  display: none; /* 高さに余裕があるときだけ（下の min-height）。状態は各筆箱の見出しにも出ている */
  margin: 1px 0 6px;
  font-size: 0.74rem;
  line-height: 1.4;
  color: #6b4d33;
}
/* 筆箱と6面は、ボタンを下に固定したまま、中だけスクロールできる */
.pick-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  margin: 0 -4px;
  padding: 0 4px 4px;
}
.pick-teams {
  display: grid;
  gap: 8px;
}
.pick-team {
  padding: 6px 8px 8px;
  border: 2px solid var(--ink);
  border-radius: 14px;
}
.pick-team-opp {
  background: #fde6e0;
}
.pick-team-mine {
  background: #fff2bd;
}
.pick-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.pick-team-head h3 {
  margin: 0;
  max-width: 55%;
  padding: 1px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-team-opp h3 {
  background: var(--red);
  color: #fff;
}
.pick-team-mine h3 {
  background: var(--yellow);
}
.pick-state {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.74rem;
  font-weight: 900;
  color: #6b4d33;
}
.pick-state.done {
  color: #1f7a48;
}
.pick-state.ready {
  color: var(--ink);
}
.pick-state.wait::after {
  content: '';
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: dots 1.4s steps(4) infinite;
}
.pick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.pk-tile {
  position: relative;
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 0 6px 6px;
  font: inherit;
  color: var(--ink);
  text-align: start;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}
.pk-color {
  display: block;
  height: 6px;
  margin: 0 -6px 2px;
  border-bottom: 2px solid var(--ink);
}
.pk-name {
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.2;
  min-height: 2.4em;
}
.pk-hp {
  font-size: 0.7rem;
  font-weight: 900;
  color: #6b4d33;
}
.pk-pips {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
}
.pk-pips i {
  display: block;
  height: 7px;
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: 2px;
}
/* 見ているものは太い枠、えらんだものは黄色＋チェック */
.pk-tile.viewing {
  box-shadow: 0 0 0 3px var(--blue);
}
.pk-tile[aria-selected='true'] {
  background: var(--yellow);
}
.pk-check {
  position: absolute;
  bottom: 17px;
  inset-inline-end: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}
.pk-check .ic {
  width: 14px;
  height: 14px;
  vertical-align: 0;
}
.pk-tile:disabled {
  cursor: default;
}

/* 見ている1本の6つの面（大きく） */
.pick-detail {
  margin-top: 8px;
  padding: 8px 10px 10px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
}
.pick-detail[data-side='opp'] {
  border-color: var(--red);
  box-shadow: inset 0 0 0 2px var(--red);
}
.pick-detail[data-side='mine'] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--yellow);
}
.pd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.pd-owner {
  font-size: 0.74rem;
  font-weight: 900;
  color: #6b4d33;
}
.pd-chosen {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}
.pd-chosen .ic {
  width: 12px;
  height: 12px;
  vertical-align: 0;
}
.pd-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.pd-title b {
  flex: 1 1 auto;
  font-size: 0.95rem;
  line-height: 1.3;
}
.pd-title {
  margin-bottom: 6px;
}
.pd-type {
  margin-inline-start: 6px;
  padding: 0 6px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}
/* 説明文は、画面の高さに余裕があるときだけ（6つの面を優先して、スクロールなしで見せるため） */
.pd-desc {
  display: none;
  margin: 6px 0 0;
  font-size: 0.76rem;
  line-height: 1.5;
}
@media (min-height: 760px) {
  .pd-desc,
  .pick-sub {
    display: block;
  }
}
.pick-detail .face-chip {
  min-height: 52px;
}
.pick-detail .face-grid {
  margin-bottom: 0;
}
.pick-foot {
  flex: none;
  padding-top: 8px;
}
.pick-foot .btn {
  width: 100%;
}

/* ---------- 制限時間・お知らせ ---------- */
.timer {
  position: fixed;
  z-index: 40;
  left: 50%;
  top: calc(var(--safe-t) + 96px);
  transform: translateX(-50%);
  min-width: 132px;
  padding: 4px 12px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
  pointer-events: none;
}
.timer.top {
  top: calc(var(--safe-t) + 8px);
}
.timer-num {
  font-family: var(--font-title);
  font-size: 1.3rem;
  line-height: 1.1;
}
.timer-unit {
  margin-inline-start: 0.2em;
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 900;
}
.timer-bar {
  display: block;
  height: 6px;
  margin-top: 2px;
  border-radius: 3px;
  background: rgba(43, 29, 20, 0.18);
  overflow: hidden;
}
.timer-bar b {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--green);
}
.timer.urgent .timer-bar b {
  background: var(--red);
}
.timer.urgent .timer-num {
  color: var(--red);
}
.toast {
  position: fixed;
  z-index: 45;
  left: 12px;
  right: 12px;
  top: calc(var(--safe-t) + 150px);
  margin: 0 auto;
  max-width: 420px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  animation: pop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.toast.warn {
  background: #ffe9b8;
}
.badge-warn {
  background: #ffd9a8;
}
.badge-dice {
  background: #e4d6ff;
}
.badge-dice.used {
  background: #e8e2d2;
  color: #8a7a62;
}
.fc-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

/* ---------- 振り直しの判断 ---------- */
.decide {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 8px 12px 10px;
}
.decide-msg {
  margin: 0 0 8px;
  font-weight: 900;
  font-size: 0.95rem;
  line-height: 1.4;
}
.decide-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.decide-row .btn {
  min-height: 56px;
  padding: 0 0.6rem;
  font-size: 0.95rem;
}
.btn-dice {
  background: #e4d6ff;
}
.decide-row .btn small {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
}
.hand.picked {
  background: var(--yellow);
  transform: translateY(-3px);
}
.hand:disabled:not(.picked) {
  opacity: 0.45;
}

/* ---------- アニメーション ---------- */
@keyframes pulse {
  50% {
    transform: scale(1.03);
  }
}
@keyframes bob {
  50% {
    margin-top: -8px;
  }
}
@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-14deg);
  }
  50% {
    transform: rotate(14deg) translateY(-4px);
  }
}
@keyframes dots {
  0% {
    content: '';
  }
  25% {
    content: '.';
  }
  50% {
    content: '..';
  }
  75% {
    content: '...';
  }
}
@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px) rotate(-1deg);
  }
  40% {
    transform: translateX(7px) rotate(1deg);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(3px);
  }
}
@keyframes floatup {
  from {
    transform: translate(-50%, 0) scale(0.6);
    opacity: 0;
  }
  15% {
    transform: translate(-50%, -6px) scale(1.2);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -46px) scale(1);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fighter-card.shake,
  .banner .b-main,
  .banner .b-sub,
  .toast,
  .modal-card {
    animation-duration: 0.01s;
  }
}

/* ---------- チュートリアル（スマホ幅が基準） ---------- */
.ob-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 92%;
  overflow-y: auto;
}
.ob-step {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 900;
  color: #6b4d33;
}
/* 実際のゲーム画面の写真。スマホ幅では横いっぱいに、5:4 に切り出して見せる */
.ob-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  margin: 8px 0 10px;
  background: #2a1b12;
  border: 2px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
}
.ob-shot {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.ob-shot.on {
  opacity: 1;
}
.ob-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ob-cap {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
  padding: 4px 12px 4px 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1.3;
}
.ob-cap .ic {
  width: 1.25em;
  height: 1.25em;
  vertical-align: 0;
}
.ob-card h2 {
  font-size: 1.3rem;
  line-height: 1.35;
}
.ob-text {
  margin: 4px 0 10px;
  font-size: 0.95rem;
  line-height: 1.7;
  text-align: start;
}
.ob-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ob-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d9c9a3;
  border: 1.5px solid var(--ink);
}
.ob-dots i.on {
  background: var(--yellow);
}
.ob-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}
.ob-actions .btn {
  min-height: 48px;
}
.ob-actions .btn-primary {
  flex: 1;
}
/* ---------- 広い画面（タブレット以上）：狭い画面を基準に拡張する ---------- */
@media (min-width: 700px) {
  h1 {
    font-size: 3.6rem;
  }
  .title-card {
    max-width: 520px;
    padding: 28px 28px 30px;
  }
  .title-actions {
    grid-template-columns: 1fr 1fr;
  }

  #select,
  #mode {
    justify-content: flex-end;
    align-items: stretch;
  }
  .sheet {
    width: 420px;
    max-height: none;
    height: 100%;
    border-radius: 0;
    border-top: 0;
    border-left: 2px solid var(--ink);
    padding-top: 24px;
  }
  .sheet-body {
    padding: 0 22px 12px;
  }
  .sheet-actions {
    padding: 12px 22px 22px;
  }

  .hud {
    left: 16px;
    right: 16px;
    padding: 0;
  }
  .hud-top {
    align-items: flex-start;
    padding-right: 0;
    top: 16px;
  }
  .hud-bottom {
    flex-direction: row;
    align-items: flex-end;
    bottom: 16px;
  }
  .fighter-card {
    width: 340px;
    padding: 10px 14px;
  }
  .action {
    margin-left: auto;
    width: 380px;
  }
  .banner .b-main {
    font-size: 3.6rem;
  }
  .decide {
    margin-left: auto;
    width: 380px;
  }
  .timer {
    top: 16px;
  }
  .toast {
    top: 76px;
  }
  .pick-card {
    max-width: 760px;
    padding: 16px;
  }
  .pick-card h2 {
    font-size: 1.6rem;
  }
  .pick-sub {
    font-size: 0.88rem;
  }
  /* 広い画面：左に2つの筆箱、右に6つの面 */
  .pick-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
  }
  .pick-detail {
    margin-top: 0;
  }
  .pk-name {
    font-size: 0.82rem;
  }
  .icon-btn {
    top: 16px;
    left: 16px;
    right: auto;
  }
  .lang-btn {
    top: 16px;
    left: 68px;
    right: auto;
    max-width: 240px;
  }
  .lang-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .lang-card {
    max-width: 560px;
  }
  .hud-top {
    padding-left: 60px;
  }
}

@media (min-width: 1000px) {
  .banner {
    top: 40%;
  }
}

/* 教室の貼り紙。日本語の画面でだけ、結果画面の下に出す。 */
.dojo-flyer { display: none; color: var(--ink); text-decoration: none; background: linear-gradient(115deg, rgba(255,255,255,.55), transparent 42%), #fffbea; border: 1px solid rgba(43,29,20,.25); border-radius: 2px 2px 3px 2px; box-shadow: 0 2px 2px rgba(0,0,0,.25), 0 6px 10px rgba(0,0,0,.3); transform: rotate(-2deg); transition: transform .16s ease, box-shadow .16s ease; -webkit-tap-highlight-color: transparent; }
html[lang='ja'] .dojo-flyer { display: flex; }
.dojo-flyer:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.dojo-flyer:active { transform: rotate(-2deg) translateY(2px); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.dojo-flyer img { display: block; flex: none; width: 56px; height: 56px; border: 1px solid rgba(43,29,20,.25); border-radius: 22%; object-fit: cover; }
#result { flex-direction: column; gap: 38px; overflow-y: auto; justify-content: safe center; }
.dojo-result { position: relative; width: min(300px, 100%); min-height: 174px; padding: 25px 16px 18px; flex: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.dojo-result-copy { max-width: 260px; white-space: pre-line; font-size: 15px; font-weight: 900; line-height: 1.35; }
.dojo-result-more { font-size: 12px; font-weight: 900; color: #79583c; }
.dojo-tape { position: absolute; top: -9px; left: calc(50% - 24px); width: 48px; height: 16px; background: rgba(240,222,160,.8); box-shadow: 0 1px 2px rgba(0,0,0,.25); transform: rotate(-4deg); }
@media (hover: hover) and (min-width: 700px) { .dojo-flyer:hover { transform: rotate(-2deg) translateY(-3px); box-shadow: 0 4px 3px rgba(0,0,0,.22), 0 9px 14px rgba(0,0,0,.3); } }
@media (prefers-reduced-motion: reduce) { .dojo-flyer { transition: none; } }

/* 黒板に書かれた案内のタップ領域。見た目は3Dの黒板に描いてあるので、ここは透明な当たり判定だけ（位置は main.js が黒板に合わせる） */
.board-ad { position: absolute; z-index: 1; display: block; border-radius: 6px; -webkit-tap-highlight-color: rgba(255,255,255,.18); }
.board-ad:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
