/* 単語パーク「対戦」（Web・ひとり用）2026-11-22 */
.bt {
  --bt-board: #17864c;
  --bt-board2: #2f8a62;
  --bt-wood: #d98c4a;
  --bt-wood2: #b86a2c;
  --bt-chalk: #fff;
  --bt-word: #ffe14d;
  --bt-red: #ff4d4d;
  --bt-bar-h: 52px;
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--mtp-bg); color: var(--mtp-ink);
  font-family: var(--mtp-font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
.bt *, .bt *::before, .bt *::after { box-sizing: border-box; }
.bt [hidden] { display: none !important; }
.bt button { font-family: inherit; }

/* 上の帯の音ボタン */
.bt-sound {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--mtp-ink);
}
.bt-sound:hover { background: var(--mtp-bg); }
.bt-sound i {
  width: 22px; height: 22px; display: block; background: currentColor;
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E");
          mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E");
}
.bt-sound[aria-pressed="false"] i {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.6 3 2.9-2.9-1.4-1.4-2.9 2.9-2.9-2.9-1.4 1.4 2.9 2.9-2.9 2.9 1.4 1.4 2.9-2.9 2.9 2.9 1.4-1.4z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.6 3 2.9-2.9-1.4-1.4-2.9 2.9-2.9-2.9-1.4 1.4 2.9 2.9-2.9 2.9 1.4 1.4 2.9-2.9 2.9 2.9 1.4-1.4z'/%3E%3C/svg%3E");
  opacity: .6;
}
.bt-sound:focus-visible { outline: 3px solid var(--mtp-sun); outline-offset: 2px; }

/* ================= 始める前 ================= */
.bt-intro {
  max-width: 1080px; margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: grid; gap: 20px;
}
@media (min-width: 900px) {
  .bt-intro { grid-template-columns: minmax(340px, 400px) 1fr; align-items: start; padding-top: 28px; gap: 28px; }
  .bt-intro__main { position: sticky; top: calc(var(--bt-bar-h) + 20px); }
}
.bt-intro__main {
  background: var(--mtp-card); border-radius: 20px; padding: 20px; border: 1px solid var(--mtp-line);
  display: flex; flex-direction: column; gap: 14px;
}
.bt-hero { display: flex; align-items: center; gap: 14px; }
.bt-hero__img { width: 92px; height: 92px; flex: none; object-fit: contain; }
.bt-hero__h { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: .04em; }
.bt-hero__lead { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--mtp-sub); font-weight: 700; }

.bt-course { display: flex; align-items: center; gap: 6px; background: var(--mtp-bg); border-radius: 14px; padding: 6px; }
.bt-course__step {
  flex: none; width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1; font-weight: 700; color: var(--mtp-ink); text-decoration: none; background: #fff; border: 1px solid var(--mtp-line);
}
.bt-course__step[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.bt-course__step:focus-visible, .bt-course__change:focus-visible { outline: 3px solid var(--mtp-sun); outline-offset: 2px; }
.bt-course__name { flex: 1; min-width: 0; text-align: center; line-height: 1.3; }
.bt-course__name b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-course__name span { font-size: 13px; color: var(--mtp-sub); font-weight: 700; }
.bt-course__change { align-self: center; display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; margin: -18px 0 -12px; font-size: 13px; color: var(--mtp-sub); }

.bt-rec { display: flex; align-items: center; justify-content: center; gap: 14px; }
.bt-rec__best { font-size: 14px; color: var(--mtp-sub); }
.bt-rec__best b { color: var(--mtp-ink); font-size: 20px; font-variant-numeric: tabular-nums; margin-left: 2px; }
.bt-stars { display: inline-flex; gap: 2px; }
.bt-stars i {
  width: 24px; height: 24px; display: block;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 1.8 3.1 6.6 7.2.9-5.3 5 1.4 7.1L12 17.9l-6.4 3.5L7 14.3l-5.3-5 7.2-.9z' fill='%23d5dbe3'/%3E%3C/svg%3E");
}
.bt-stars i.is-on { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 1.8 3.1 6.6 7.2.9-5.3 5 1.4 7.1L12 17.9l-6.4 3.5L7 14.3l-5.3-5 7.2-.9z' fill='%23ffb400' stroke='%23e09200' stroke-width='1'/%3E%3C/svg%3E"); }
.bt-stars--big i { width: 44px; height: 44px; }

.bt-start {
  width: 100%; min-height: 64px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--bt-board); color: var(--bt-word); font-size: 24px; font-weight: 900; letter-spacing: .12em;
  box-shadow: 0 5px 0 #0d5e33; transition: transform .08s, box-shadow .08s, filter .15s;
}
.bt-start:hover { filter: brightness(1.06); }
.bt-start:active { transform: translateY(4px); box-shadow: 0 1px 0 #0d5e33; }
.bt-start:disabled { opacity: .5; cursor: default; }
.bt-start:focus-visible { outline: 3px solid var(--mtp-sun); outline-offset: 3px; }
.bt-err { margin: 0; color: #c62828; font-size: 14px; text-align: center; }

.bt-keys { display: grid; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; background: var(--mtp-bg); }
.bt-keys__lane { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.bt-keys__lane small { flex-basis: 100%; text-align: center; font-size: 11px; color: var(--mtp-sub); }
.bt-keys__mid { display: none; }
.bt-keys { grid-template-columns: 1fr 1fr; }
.bt-keys__note { grid-column: 1 / -1; margin: 0; text-align: center; font-size: 12px; color: var(--mtp-sub); }
.bt-keys__cap {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 7px; background: #fff; border: 1px solid #cfd6df; box-shadow: 0 2px 0 #cfd6df;
  font-weight: 800; font-size: 14px; color: var(--mtp-ink);
}

.bt-intro__sub { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.bt-howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .bt-howto { grid-template-columns: repeat(3, 1fr); } }
.bt-howto li { background: #fff; border: 1px solid var(--mtp-line); border-radius: 16px; padding: 12px; display: flex; gap: 12px; }
@media (min-width: 640px) { .bt-howto li { flex-direction: column; } }
.bt-howto b { display: block; font-size: 15px; margin-bottom: 4px; }
.bt-howto p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--mtp-sub); }
.bt-howto__pic {
  flex: none; width: 96px; aspect-ratio: 300 / 350; border-radius: 10px; overflow: hidden; position: relative; background: var(--bt-board);
}
@media (min-width: 640px) { .bt-howto__pic { width: 100%; aspect-ratio: 300 / 340; } }
.bt-howto__pic img { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; }
.bt-howto__pic--stars { display: flex; align-items: center; justify-content: center; gap: 2px; color: #ffcf33; font-size: 30px; }
@media (min-width: 640px) { .bt-howto__pic--stars { font-size: 48px; } }
.bt-howto__pic--stars span:nth-child(2) { transform: translateY(-10px); }

.bt-words { background: #fff; border: 1px solid var(--mtp-line); border-radius: 16px; padding: 16px; }
.bt-words__h { margin: 0; font-size: 17px; }
.bt-words__h span { font-size: 13px; color: var(--mtp-sub); font-weight: 700; }
.bt-words__tip { margin: 2px 0 10px; font-size: 13px; color: var(--mtp-sub); }
.bt-words__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 24px; }
@media (min-width: 640px) { .bt-words__list { grid-template-columns: 1fr 1fr; } }
.bt-words__list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--mtp-line); min-width: 0; }
.bt-words__w { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.bt-words__t { font-size: 13px; color: var(--mtp-sub); overflow-wrap: anywhere; }
.bt-words__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.bt-words__x { flex: none; font-size: 12px; font-weight: 800; color: #c62828; }
.bt-say {
  position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--mtp-line); background: #fff; cursor: pointer; color: var(--mtp-sky);
  display: inline-flex; align-items: center; justify-content: center;
}
.bt-say::before {
  content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4z'/%3E%3C/svg%3E");
          mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4z'/%3E%3C/svg%3E");
}
.bt-say::after { content: ""; position: absolute; inset: -6px; }   /* 押せる範囲は 48px */
.bt-say:hover { background: var(--mtp-bg); }
.bt-say:focus-visible { outline: 3px solid var(--mtp-sun); outline-offset: 2px; }

/* ================= ゲーム ================= */
.bt.is-playing { overflow: hidden; overscroll-behavior: none; }
.bt-play {
  height: calc(100vh - var(--bt-bar-h)); height: calc(100dvh - var(--bt-bar-h));
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; padding: 12px 16px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
@media (max-width: 899px) {
  .bt.is-playing .mtp-bar { display: none; }
  .bt-play { height: 100vh; height: 100dvh; display: block; padding: 0; }
  .bt-side { display: none !important; }
}
.bt-stage {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  height: 100%; width: min(560px, calc((100dvh - var(--bt-bar-h) - 24px) * .64));
  border-radius: 18px; box-shadow: 0 10px 40px rgba(16, 40, 24, .22);
  background: var(--bt-board); touch-action: none; overscroll-behavior: none;
}
@media (max-width: 899px) {
  .bt-stage { width: 100%; width: min(100%, max(62dvh, 560px)); margin: 0 auto; border-radius: 0; box-shadow: none; }
}

.bt-hud {
  position: relative; z-index: 3; flex: none; display: flex; align-items: center; gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: linear-gradient(#e9a464, var(--bt-wood) 60%, var(--bt-wood2));
  box-shadow: 0 3px 0 rgba(0, 0, 0, .18); color: #fff;
}
.bt-hud__score {
  flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px;
  background: #3fb3dc; border: 2px solid #8ae0ff; border-radius: 8px; padding: 2px 12px; max-width: 210px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.bt-hud__score small { font-size: 12px; font-weight: 800; opacity: .9; }
.bt-hud__score b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; display: inline-block; transform-origin: left center; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.bt-hud__score b.is-bump { animation: bt-bump .2s ease-out; }
@keyframes bt-bump { 50% { transform: scale(1.3); } }
.bt-hud__time {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
  background: rgba(60, 30, 10, .55); border-radius: 999px; padding: 4px 12px 4px 8px;
}
.bt-hud__time i {
  width: 20px; height: 20px; background: #fff;
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2.2a7.8 7.8 0 1 1 0 15.6 7.8 7.8 0 0 1 0-15.6zM11 6v6.6l4.8 2.9 1-1.7-3.8-2.3V6z'/%3E%3C/svg%3E");
          mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2.2a7.8 7.8 0 1 1 0 15.6 7.8 7.8 0 0 1 0-15.6zM11 6v6.6l4.8 2.9 1-1.7-3.8-2.3V6z'/%3E%3C/svg%3E");
}
.bt-hud__time b { font-size: 24px; font-weight: 900; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.bt-hud__time.is-danger { background: var(--bt-red); animation: bt-danger .5s ease-in-out infinite alternate; }
.bt-hud__time.is-danger b { color: #fff; }
@keyframes bt-danger { from { box-shadow: 0 0 0 0 rgba(255, 77, 77, .9); transform: scale(1); } to { box-shadow: 0 0 0 8px rgba(255, 77, 77, 0); transform: scale(1.08); } }
.bt-hud__pause {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 rgba(0, 0, 0, .2);
}
.bt-hud__pause i { width: 14px; height: 16px; border-left: 5px solid #1b6fb3; border-right: 5px solid #1b6fb3; }
.bt-hud__pause:focus-visible { outline: 3px solid var(--mtp-sun); outline-offset: 2px; }

.bt-board {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(255, 255, 255, .06), transparent 60%),
    linear-gradient(200deg, #12844a 0%, #1f8a55 45%, #36896a 100%);
  --tray: 60px;
  container-type: size;
}
.bt-board.is-shake { animation: bt-shake .5s linear; }
@keyframes bt-shake {
  0% { transform: translate(0, 0); } 10% { transform: translate(-6px, 2px); } 20% { transform: translate(6px, -2px); }
  30% { transform: translate(-5px, -1px); } 40% { transform: translate(5px, 2px); } 55% { transform: translate(-3px, 0); }
  70% { transform: translate(3px, -1px); } 85% { transform: translate(-1px, 0); } 100% { transform: translate(0, 0); }
}
.bt-board.is-miss::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 6px rgba(255, 77, 77, .75);
  animation: bt-fadeout .5s ease-out forwards;
}
@keyframes bt-fadeout { to { opacity: 0; } }
.bt-tray { position: absolute; left: 0; bottom: 0; width: 100%; height: var(--tray); object-fit: cover; object-position: 0 100%; pointer-events: none; z-index: 1; }

.bt-lane { position: absolute; top: 0; bottom: var(--tray); width: 50%; }
.bt-lane[data-lane="0"] { left: 0; }
.bt-lane[data-lane="1"] { right: 0; }
.bt-lane + .bt-lane::before {
  content: ""; position: absolute; left: 0; top: 4%; bottom: 44%; width: 0; border-left: 2px dashed rgba(255, 255, 255, .08);
}
.bt-fall { position: absolute; inset: 0; pointer-events: none; }
.bt-word {
  position: absolute; left: 4px; right: 4px; top: 0; text-align: center;
  color: var(--bt-word); font-weight: 800; line-height: 1.1; letter-spacing: .01em;
  font-family: "Lato", "Helvetica Neue", Arial, system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .22), 0 0 14px rgba(255, 225, 77, .25);
  overflow-wrap: anywhere; will-change: transform, opacity;
}
.bt-word.is-frozen { color: #fff6c4; text-shadow: 0 0 0 transparent, 0 0 18px rgba(255, 90, 90, .9); }
.bt-word.is-ghost-ok { animation: bt-ghost-ok .4s ease-out forwards; }
.bt-word.is-ghost-out { transition: transform .5s cubic-bezier(.5, 0, .9, .6), opacity .5s; opacity: 0; }
@keyframes bt-ghost-ok { to { opacity: 0; filter: blur(2px); } }

.bt-opts {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--opts-h, 40%);
  display: grid; grid-template-rows: repeat(3, 1fr); gap: 6px; padding: 4px 8px 8px;
}
.bt-opt {
  position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0;
  border: 2px solid rgba(255, 255, 255, .22); border-radius: 12px; background: rgba(255, 255, 255, .07);
  color: var(--bt-chalk); font-weight: 800; line-height: 1.2; text-align: center; padding: 2px 8px;
  cursor: pointer; touch-action: none; will-change: transform; transition: background .12s, border-color .12s, opacity .25s;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.bt-opt span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
@media (hover: hover) { .bt-opt:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .45); } }
.bt-opt:focus-visible { outline: 3px solid var(--mtp-sun); outline-offset: 1px; }
/* 消えた選択肢は Tab でも選べないように visibility も消す（消える動きの .25 秒の後） */
.bt-opt.is-gone, .bt-opt.is-hidden { opacity: 0; pointer-events: none; visibility: hidden; transition: background .12s, border-color .12s, opacity .25s, visibility 0s linear .25s; }
.bt-opt.is-hidden { transition: none; }
.bt-opt.is-fly { background: transparent; border-color: transparent; transition: none; z-index: 2; }
.bt-opt.is-locked { cursor: default; }
.is-desktop .bt-opt { padding-left: 32px; padding-right: 32px; }
.bt-opt kbd {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px; font: 800 12px/22px var(--mtp-font);
  background: rgba(0, 0, 0, .22); color: rgba(255, 255, 255, .85); text-shadow: none;
}
.bt-opt.is-fly kbd { display: none; }

.bt-combo {
  position: absolute; left: 50%; top: 30%; z-index: 2; transform: translate(-50%, -50%);
  pointer-events: none; text-align: center; line-height: 1; opacity: 0;
}
.bt-combo b {
  display: block; font-size: 72px; font-size: clamp(56px, 18cqw, 110px); font-weight: 900; font-variant-numeric: tabular-nums;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px rgba(0, 40, 20, .25);
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .25));
}
.bt-combo small { display: block; margin-top: 2px; font-size: 18px; font-weight: 900; color: #fff; letter-spacing: .1em; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.bt-combo.t-green b { background-image: linear-gradient(160deg, #fff 10%, #94ffbd 40%, #5dffbc 65%, #22c592); }
.bt-combo.t-blue b { background-image: linear-gradient(160deg, #fff 10%, #b1f5ff 35%, #5dd8ff 70%, #8df0ff); }
.bt-combo.t-pink b { background-image: linear-gradient(160deg, #fff 5%, #ff88d1 40%, #ffdaf4 70%, #ffe8fd); }
.bt-combo.t-rainbow b { background-image: linear-gradient(100deg, #acffd7, #00ffa6, #5dd8ff, #f4dfff, #ff00ca, #ffe14d, #acffd7); background-size: 300% 100%; animation: bt-rainbow 1.2s linear infinite; }
@keyframes bt-rainbow { to { background-position: 300% 0; } }
.bt-combo.is-in { animation: bt-combo-in .28s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.bt-combo.is-in2 { animation: bt-combo-in2 .34s cubic-bezier(.2, 1.8, .4, 1) forwards; }
.bt-combo.is-out { animation: bt-combo-out .25s ease-in forwards; }
@keyframes bt-combo-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes bt-combo-in2 { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 60% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes bt-combo-out { from { opacity: 1; } to { opacity: 0; transform: translate(-50%, -60%) scale(.9); } }

.bt-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }

.bt-pop {
  position: absolute; z-index: 5; pointer-events: none; font-weight: 900; font-size: 22px; color: #fff; transform: translate(-50%, 0);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35); animation: bt-pop .8s ease-out forwards; white-space: nowrap;
}
.bt-pop.is-minus { color: #ffb3b3; }
@keyframes bt-pop { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -36px) scale(1); } }

/* 重ねる画面（カウントダウン・おしまい・一時停止） */
.bt-ov { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); }
.bt-ov--count b { font-size: clamp(90px, 30vmin, 180px); font-weight: 900; color: #fff; text-shadow: 0 6px 0 rgba(0, 0, 0, .3); }
.bt-ov--count b.is-start { font-size: clamp(54px, 15vmin, 96px); color: var(--bt-word); letter-spacing: .06em; }
.bt-ov--count b.is-pop { animation: bt-count .9s ease-out; }
@keyframes bt-count { 0% { transform: scale(1.8); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: .2; transform: scale(.9); } }
.bt-ov--finish b { font-size: clamp(54px, 14vmin, 90px); font-weight: 900; color: #fff; text-shadow: 0 6px 0 rgba(0, 0, 0, .3); animation: bt-combo-in2 .4s cubic-bezier(.2, 1.8, .4, 1) both; display: block; }
.bt-ov--finish b { position: static; transform: none; }
/* 開始のカウント中も、右上の一時停止は押せる（数字の幕は押しても何もしないので、指を通す） */
.bt-ov--count { pointer-events: none; }
.bt-stage.is-count .bt-hud { z-index: 11; }
.bt-ov--pause { z-index: 12; }
.bt-pause { width: min(320px, calc(100% - 32px)); background: #fff; border-radius: 20px; padding: 22px 18px 16px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.bt-pause h2 { margin: 0 0 4px; font-size: 20px; }
.bt-pause p { margin: 0; font-size: 12px; color: var(--mtp-sub); }

.bt-btn {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 16px; border-radius: 14px;
  border: 2px solid var(--mtp-line); background: #fff; color: var(--mtp-ink); font-size: 16px; font-weight: 800; text-decoration: none; cursor: pointer;
  transition: transform .08s, filter .15s;
}
.bt-btn:active { transform: scale(.98); }
.bt-btn:focus-visible { outline: 3px solid var(--mtp-sun); outline-offset: 2px; }
.bt-btn--main { background: var(--bt-board); border-color: var(--bt-board); color: #fff; box-shadow: 0 4px 0 #0d5e33; }
.bt-btn--sound { gap: 8px; }
.bt-btn--sound i {
  width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E");
          mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E");
}
.bt-btn--sound[aria-pressed="false"] { color: var(--mtp-sub); }
.bt-btn--sound[aria-pressed="false"] i {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.6 3 2.9-2.9-1.4-1.4-2.9 2.9-2.9-2.9-1.4 1.4 2.9 2.9-2.9 2.9 1.4 1.4 2.9-2.9 2.9 2.9 1.4-1.4z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 4V5L7 9H3zm13.6 3 2.9-2.9-1.4-1.4-2.9 2.9-2.9-2.9-1.4 1.4 2.9 2.9-2.9 2.9 1.4 1.4 2.9-2.9 2.9 2.9 1.4-1.4z'/%3E%3C/svg%3E");
}
.bt-btn--next { background: var(--mtp-sun); border-color: var(--mtp-sun); color: #3a2600; box-shadow: 0 4px 0 #d18f00; }

/* PC の横の欄 */
.bt-side { display: flex; flex-direction: column; justify-content: center; gap: 16px; min-width: 0; }
.bt-side--l { align-items: flex-end; }
.bt-side--r { align-items: flex-start; }
.bt-side__box { width: min(220px, 100%); background: #fff; border: 1px solid var(--mtp-line); border-radius: 16px; padding: 14px 16px; }
.bt-side__label { font-size: 12px; font-weight: 800; color: var(--mtp-sub); }
.bt-side__combo { font-size: 56px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--mtp-ink); }
.bt-side__combo.is-hot { color: #16a34a; }
.bt-side__bar { height: 6px; border-radius: 3px; background: var(--mtp-bg); overflow: hidden; margin: 6px 0 10px; }
.bt-side__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c592, #5dd8ff); }
.bt-side__row { display: flex; justify-content: space-between; font-size: 14px; color: var(--mtp-sub); padding: 3px 0; }
.bt-side__row b { color: var(--mtp-ink); font-variant-numeric: tabular-nums; }
.bt-side__keys { width: min(220px, 100%); display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.bt-side__touch { display: none; width: min(220px, 100%); margin: 0; font-size: 13px; text-align: center; color: var(--mtp-sub); }
@media (hover: none), (pointer: coarse) {
  .bt-side__keys { display: none; }
  .bt-side__touch { display: block; }
}
.bt-side__keys small { flex-basis: 100%; text-align: center; font-size: 12px; color: var(--mtp-sub); }
.bt-side__box--log { max-height: 60vh; display: flex; flex-direction: column; }
.bt-log { list-style: none; margin: 6px 0 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.bt-log li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--mtp-line); animation: bt-log-in .25s ease-out; }
.bt-log li b { font-size: 14px; overflow-wrap: anywhere; }
.bt-log li span { color: var(--mtp-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.bt-log li::before { content: "○"; flex: none; color: #16a34a; font-weight: 900; }
.bt-log li.is-ng::before { content: "×"; color: #dc2626; }
@keyframes bt-log-in { from { opacity: 0; transform: translateY(-6px); } }

/* ================= 結果 ================= */
.bt-result { padding: 20px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.bt-res { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.bt-res__head { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--mtp-line); border-radius: 20px; padding: 18px; }
.bt-res__bear { width: 110px; height: 110px; object-fit: contain; flex: none; }
@media (min-width: 640px) { .bt-res__bear { width: 150px; height: 150px; } }
.bt-res__label { margin: 0; font-size: 18px; font-weight: 900; color: #16a34a; }
.bt-res__label.is-miss { color: var(--mtp-sub); }
.bt-res__score { line-height: 1; margin: 4px 0 8px; }
.bt-res__score b { font-size: clamp(48px, 14vw, 72px); font-weight: 900; font-variant-numeric: tabular-nums; }
.bt-res__score small { font-size: 18px; font-weight: 800; margin-left: 4px; }
.bt-res__best { margin: 8px 0 0; font-size: 14px; color: var(--mtp-sub); }
.bt-res__best .is-new { display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 6px; background: var(--mtp-heart); color: #fff; font-weight: 900; animation: bt-combo-in2 .4s .9s both; }
.bt-res__best .is-new { animation-name: bt-newbest; }
@keyframes bt-newbest { from { opacity: 0; transform: scale(.5); } 60% { transform: scale(1.2); opacity: 1; } to { transform: scale(1); opacity: 1; } }
.bt-res__stats { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bt-res__stats div { background: #fff; border: 1px solid var(--mtp-line); border-radius: 14px; padding: 10px; text-align: center; }
.bt-res__stats dt { font-size: 12px; color: var(--mtp-sub); font-weight: 700; }
.bt-res__stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.bt-res__btns { display: grid; gap: 10px; }
@media (min-width: 640px) { .bt-res__btns { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.bt-res__wrong { background: #fff; border: 1px solid var(--mtp-line); border-radius: 16px; padding: 16px; }
.bt-res__wrong h2 { margin: 0 0 6px; font-size: 16px; }
.bt-res__none { padding: 8px 0; color: var(--mtp-sub); font-size: 14px; }
.bt-res__app { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--mtp-line); background: #fff; color: var(--mtp-ink); text-decoration: none; }
.bt-res__app img { border-radius: 10px; flex: none; }
.bt-res__app span { display: flex; flex-direction: column; line-height: 1.35; }
.bt-res__app b { font-size: 15px; }
.bt-res__app small { font-size: 12px; color: var(--mtp-sub); }
.bt-res__app:hover { background: var(--mtp-bg); }
.bt-res__app:focus-visible { outline: 3px solid var(--mtp-sun); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .bt-board.is-shake { animation: none; }
  .bt-hud__time.is-danger { animation: none; }
  .bt-combo.t-rainbow b { animation: none; }
  .bt-combo.is-in, .bt-combo.is-in2 { animation-duration: .01s; }
}
