/* ==========================================================================
   マイダビ -MY DERBY-  style.css  v1
   「晴れた日の競馬場」。芝の緑に、白いラチ、金色、枠の8色。
   カードは白で読みやすく。電光掲示板だけは黒とオレンジの光。
   ========================================================================== */
:root {
  --turf: #3FAE56;        /* 芝 */
  --turf-2: #38A24E;
  --turf-d: #1F7A36;
  --turf-dd: #145A26;
  --sky: #5EC4FF;
  --sky-2: #CDEFFF;
  --gold: #FFC83D;
  --gold-d: #D9901A;
  --orange: #FF9A1F;
  --orange-d: #C96A00;
  --red: #E8453C;
  --red-d: #B8261F;
  --ticket: #EAF7E6;      /* 馬券の紙 */
  --ticket-line: #9CCB93;
  --panel: #FFFFFF;
  --panel-2: #F2F7F2;
  --line: #D6E6D4;
  --ink: #1F2D24;         /* カードの中の文字 */
  --muted: #5F6F63;
  --light: #FFFFFF;       /* 芝の上の文字 */
  --light-2: #E2F5E4;
  --plus: #13A15B;
  --minus: #D83A32;
  --adult: #FF4F8B;
  --adult-d: #C2195A;
  --led-bg: #0E1216;
  --led: #FFB22E;

  --radius-l: 20px;
  --radius-m: 14px;
  --font: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  --deco: 'Dela Gothic One', 'Hiragino Sans', 'Meiryo', sans-serif;
  --dot: 'DotGothic16', 'Osaka-Mono', 'MS Gothic', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--turf); }
body {
  background-color: var(--turf);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .22) 0, rgba(255, 255, 255, 0) 260px),
    repeating-linear-gradient(90deg, var(--turf) 0 64px, var(--turf-2) 64px 128px);
  color: var(--light);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: #fff; }

/* 文字が枠からはみ出さないように */
.question, .member__name, .rank__name, .overlay__sub, .overlay__word, .pay__name, .q-mini__text, .teaser__q,
.horse__name, .board__name, .recap__q, .talk p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 16px calc(40px + env(safe-area-inset-bottom));
}

/* ---------- 上の帯（白いラチ） ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px; padding: 5px 6px 5px 6px; border-radius: 999px;
  background: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .14);
}
.topbar__brand {
  font-weight: 900; font-size: 14px; text-decoration: none;
  color: #4A2A00; background: var(--gold);
  padding: 2px 12px; border-radius: 999px;
}
.topbar__logo {
  flex: 1; font-family: var(--deco); font-size: 18px; letter-spacing: .06em; color: var(--turf-d);
}
.watch-badge {
  font-size: 12px; font-weight: 900; color: #fff; background: var(--red);
  padding: 2px 10px; border-radius: 999px;
}
.sound-btn {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; padding: 0;
  background: var(--panel-2); font-size: 17px; line-height: 34px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- カード ---------- */
.card, .lead-box, .member, .rank, .dialog, .ticket, .teaser, .premium__list li, .q-card,
.horse, .pay, .host-options, .winner-card, .talk, .rule-card, .mine-box, .recap__item, .pay-parent {
  color: var(--ink);
}
.card {
  background: var(--panel);
  border-radius: var(--radius-l);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .12), 0 12px 24px rgba(0, 0, 0, .16);
}

/* ---------- トップ ---------- */
.hero { text-align: center; }
.hero__title { margin: 0; line-height: 1; }
.hero__logo {
  display: block; width: min(94%, 440px); height: auto; margin: 4px auto 0;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .14)) drop-shadow(0 10px 16px rgba(0, 0, 0, .22));
}
.hero__catch {
  margin: 14px 0 2px; font-family: var(--deco); font-size: 20px; letter-spacing: .02em; color: #fff;
  text-shadow: 0 3px 0 var(--turf-dd);
}

.howto { margin-top: 26px; padding: 0 0 18px; overflow: hidden; }
.howto__img { display: block; width: 100%; height: auto; }
.howto__title { margin: 14px 0 2px; font-size: 18px; text-align: center; letter-spacing: .2em; font-family: var(--deco); font-weight: 400; color: var(--turf-d); }
.howto__lead { margin: 4px 18px 6px; font-size: 14px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.8; }
.howto__lead b { color: var(--ink); }
.howto__steps { margin: 0 22px 0 18px; padding-left: 1.3em; }
.howto__steps li { margin: 10px 0; color: var(--muted); font-size: 14px; }
.howto__steps li::marker { color: var(--red); font-weight: 900; }
.howto__steps b { display: block; color: var(--ink); font-size: 15px; }
.howto__note { margin: 10px 18px 0; font-size: 13px; color: var(--muted); text-align: center; }
.howto__note b { color: var(--plus); }
.howto__tickets { margin: 14px 16px 0; padding: 10px 12px; border-radius: var(--radius-m); background: var(--ticket); text-align: center; }
.howto__tickets p { margin: 4px 0; font-size: 13px; color: var(--muted); }
.howto__tickets-title { font-weight: 900; color: var(--turf-d) !important; }
.howto__tickets-note b { color: var(--ink); }
.howto__premium { margin: 14px 16px 0; padding: 10px 14px; border-radius: var(--radius-m); background: #FFF0F6; }
.howto__premium p { margin: 4px 0; font-size: 13px; color: var(--muted); }
.howto__premium b { color: var(--adult-d); margin-right: 6px; }
.howto__premium-title { font-weight: 900; color: var(--adult-d) !important; text-align: center; }

.paytable { width: calc(100% - 32px); margin: 12px 16px 0; border-collapse: separate; border-spacing: 0 4px; font-size: 14px; }
.paytable caption { font-weight: 900; font-size: 13px; color: var(--muted); padding-bottom: 2px; }
.paytable th, .paytable td { background: var(--panel-2); padding: 6px 10px; }
.paytable th { text-align: left; border-radius: 10px 0 0 10px; font-weight: 900; color: var(--ink); line-height: 1.35; }
.paytable th small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.paytable td { text-align: right; border-radius: 0 10px 10px 0; font-family: var(--deco); font-size: 18px; color: var(--ink); white-space: nowrap; }
.paytable tr.is-gold th, .paytable tr.is-gold td { background: #FFF3C9; }
.paytable tr.is-gold td { color: var(--gold-d); font-size: 22px; }
.paytable tr.is-green td { color: var(--plus); }
.paytable tr.is-red th, .paytable tr.is-red td { background: #FFF0EF; }
.paytable tr.is-red td { color: var(--minus); font-size: 15px; }

.mini-ticket {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; vertical-align: middle;
  min-width: 62px; margin: 2px 3px; padding: 3px 8px; border-radius: 8px; line-height: 1.2;
  background: #fff; color: var(--turf-dd); font-weight: 900; font-size: 13px;
  box-shadow: inset 0 0 0 2px var(--ticket-line);
}
.mini-ticket small { font-size: 10px; }
.mini-ticket.is-shobu { background: linear-gradient(180deg, #FFF3C4, #FFD76A); color: #7A3E00; box-shadow: inset 0 0 0 2px #E0A21A; }

/* ---------- ボタン ---------- */
.btn {
  display: block; width: 100%; margin-top: 12px;
  border: 0; border-radius: 999px;
  font: inherit; font-weight: 900; font-size: 17px;
  padding: 15px 20px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s;
}
.btn:active { transform: translateY(2px); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.is-busy { opacity: .6; }
.btn--primary {
  background: linear-gradient(180deg, #FFE38A, var(--gold) 45%, var(--orange));
  color: #4A2400; box-shadow: 0 5px 0 var(--orange-d), 0 8px 16px rgba(0, 0, 0, .18);
}
.btn--primary:active { box-shadow: 0 2px 0 var(--orange-d); }
.btn--big { font-size: 20px; padding: 18px 20px; }
.btn--ghost { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.card .btn--ghost, .dialog .btn--ghost { background: #fff; color: var(--turf-d); box-shadow: inset 0 0 0 2px var(--turf-d); }
.btn--text {
  width: fit-content; margin: 8px auto 0; padding: 8px 12px;
  background: none; color: var(--light-2); font-size: 14px; font-weight: 700;
}
.card .btn--text, .dialog .btn--text { color: var(--muted); }
.btn--share {
  width: auto; margin: 0; padding: 12px 20px; font-size: 15px;
  background: #fff; color: var(--red-d); box-shadow: 0 4px 0 rgba(0, 0, 0, .18), inset 0 0 0 2px var(--red);
}
.btn--line { background: #06C755; color: #fff; box-shadow: 0 4px 0 #04A247; }
.btn--x { background: #000; color: #fff; box-shadow: 0 4px 0 #444; }
.btn--2line { line-height: 1.35; }
.btn--2line small { display: block; font-size: 12px; font-weight: 700; opacity: .85; margin-top: 2px; }
.btn--adult { background: linear-gradient(180deg, #FF77A6, var(--adult)); color: #fff; box-shadow: 0 4px 0 var(--adult-d); }
.subnav { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.subnav .btn--text { margin: 0; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-row .btn { font-size: 15px; padding: 13px 8px; }
.link-btn {
  background: none; border: 0; padding: 4px 6px; font: inherit; font-size: 13px; font-weight: 700;
  color: #fff; text-decoration: underline; cursor: pointer;
}
.card .link-btn, .q-card .link-btn, .mine-box .link-btn { color: var(--turf-d); }
.link-btn--center { display: block; margin: 14px auto 0; }
.result-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- 入力 ---------- */
.screen__title { font-size: 20px; margin: 10px 0 14px; font-weight: 900; letter-spacing: .04em; color: #fff; text-shadow: 0 2px 0 var(--turf-dd); }
.field { display: block; margin-bottom: 16px; }
.field__label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--light-2); }
.input {
  width: 100%; font: inherit; font-size: 18px;
  padding: 12px 16px; border-radius: var(--radius-m);
  border: 2px solid #fff; background: #fff; color: var(--ink);
}
.input::placeholder { color: #A9B8AC; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 61, .5); }
.input--code { font-size: 30px; font-weight: 900; letter-spacing: .4em; text-align: center; }
.avatars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.avatar-opt {
  display: flex; align-items: center; justify-content: center;
  min-width: 0; aspect-ratio: 1; padding: 0; overflow: visible;
  border-radius: 50%; border: 3px solid transparent;
  background: rgba(255, 255, 255, .18); cursor: pointer;
}
.avatar-opt.is-on { border-color: var(--gold); background: rgba(255, 255, 255, .4); box-shadow: 0 0 0 3px #fff; }
/* 絵のまわりに髪型のための余白があるので、1.3倍にして丸いところを枠いっぱいにする */
.avatar-opt img { display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(1.3); pointer-events: none; }

/* モードの選択（ふつうモード・大人モード） */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg__btn {
  position: relative; display: block; width: 100%; padding: 12px 6px 10px; border: 0; border-radius: var(--radius-m);
  font: inherit; font-weight: 900; font-size: 16px; line-height: 1.35; color: var(--ink); background: #fff; cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--line); -webkit-tap-highlight-color: transparent;
}
.seg__btn small { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; color: var(--muted); }
.seg__btn[aria-checked="true"] { background: #FFF8E0; box-shadow: inset 0 0 0 3px var(--gold-d); }
.seg__btn--adult[aria-checked="true"] { background: #FFF0F6; box-shadow: inset 0 0 0 3px var(--adult); }
.seg__btn:disabled { opacity: .6; }
.seg__tag {
  position: absolute; top: -9px; right: -2px; padding: 1px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 900; line-height: 1.6; color: #fff; background: var(--adult);
}

/* アイコン（丸い枠） */
.av { display: inline-flex; align-items: center; justify-content: center; line-height: 1; flex: none; border-radius: 50%; }
/* アイコンは、まるいステッカーの絵（背景は透明） */
/* 絵のまわりに髪型のための余白があるので、1.3倍にして丸いところを枠の大きさにそろえる */
.av img { display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(1.3); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.av--s { width: 32px; height: 32px; font-size: 20px; }
.av--m { width: 46px; height: 46px; font-size: 28px; }
.av--l { width: 76px; height: 76px; font-size: 46px; }

/* ---------- 待合室 ---------- */
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.member {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border-radius: var(--radius-m); padding: 8px 14px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .1);
}
.member__name { font-weight: 700; flex: 1; }
.member__badge { font-size: 12px; font-weight: 700; background: var(--gold); color: #4A2400; padding: 2px 8px; border-radius: 999px; }
.member__you { font-size: 12px; font-weight: 900; color: var(--red-d); }
.hint { font-size: 14px; color: var(--light-2); text-align: center; margin: 12px 0 0; }
.card .hint, .dialog .hint { color: var(--muted); }
.hint--left { text-align: left; margin: 0 0 14px; font-size: 14px; }
.mode-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0 0; }
.mode-badge {
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 900;
  background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6);
}
.mode-badge a { color: #FFE3EE; }
.mode-badge.is-adult { background: var(--adult); color: #fff; box-shadow: none; }
.mode-badge.is-normal { background: #fff; color: var(--turf-d); box-shadow: none; }
.host-options {
  margin: 16px 0 0; padding: 12px; border-radius: var(--radius-l);
  background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5);
}
.host-options__title { margin: 0 0 8px; font-size: 13px; font-weight: 900; color: #fff; text-align: center; }
.rule-card { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--radius-l); background: var(--ticket); text-align: center; box-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.rule-card p { margin: 2px 0; font-size: 13px; color: var(--muted); font-weight: 700; }
.rule-card b { color: var(--ink); }
.rule-card__title { font-size: 16px !important; font-weight: 900 !important; color: var(--turf-dd) !important; }
.rule-card__tickets { margin: 6px 0 !important; }
.rule-card__steps { margin: 6px auto 8px; padding: 0 0 0 1.4em; max-width: 340px; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink); }
.rule-card__steps li { margin: 2px 0; }
.rule-card__steps li::marker { color: var(--red); font-weight: 900; }
.rule-card__steps b { color: var(--red-d); }
.rule-card__pay { margin-top: 8px !important; padding: 6px 8px; border-radius: 10px; background: #fff; font-size: 12px !important; line-height: 1.6; }
.rule-card__pay b { color: var(--gold-d) !important; }
.rule-card__pay span { display: inline-block; }
.tickets-box__pay { margin: 4px 0 0; font-size: 11px; font-weight: 700; text-align: center; color: var(--light-2); }
.tickets-box__pay b { color: #FFE38A; }
.tickets-box__pay span { display: inline-block; }

/* ---------- 入場券（馬券風） ---------- */
.ticket {
  position: relative; overflow: hidden; text-align: center; padding: 18px 16px 16px; border-radius: 16px;
  background:
    repeating-linear-gradient(45deg, rgba(31, 122, 54, .05) 0 6px, rgba(31, 122, 54, 0) 6px 12px),
    var(--ticket);
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--ticket-line), 0 6px 0 rgba(0, 0, 0, .14), 0 12px 22px rgba(0, 0, 0, .18);
}
/* 切り取り線（左右の半円のくぼみつき） */
.ticket__cut { position: relative; margin: 8px -16px 0; border-top: 2px dashed var(--ticket-line); }
.ticket__cut::before, .ticket__cut::after {
  content: ''; position: absolute; top: -14px; width: 26px; height: 26px; border-radius: 50%; background: var(--turf);
}
.ticket__cut::before { left: -13px; }
.ticket__cut::after { right: -13px; }
.ticket__en { margin: 0; font-weight: 900; font-size: 11px; color: var(--turf-d); letter-spacing: .3em; }
.ticket__title { margin: 0 0 8px; font-family: var(--deco); font-size: 22px; color: var(--turf-dd); }
.ticket__label { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 10px; }
.ticket__code { display: block; font-size: 44px; font-weight: 900; letter-spacing: .25em; line-height: 1.2; color: var(--ink); }
.ticket__note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- レースの見出し（看板） ---------- */
.race-head {
  text-align: center; padding: 8px 12px 10px; border-radius: var(--radius-m);
  background: var(--turf-dd); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8), 0 4px 0 rgba(0, 0, 0, .18);
}
.race-head p { margin: 0; }
.race-head__date { font-size: 12px; font-weight: 700; color: #CFEBD4; }
.race-head__name { font-family: var(--deco); font-size: 26px; line-height: 1.3; color: #fff; letter-spacing: .04em; }
.race-head__sub { font-size: 13px; font-weight: 900; color: var(--gold); }
.race-head__sub:empty { display: none; }

.parent-chip {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: fit-content; max-width: 100%;
  margin: 10px auto 0; padding: 4px 16px 4px 10px; border-radius: 999px; background: #fff; color: var(--ink);
  font-weight: 700; box-shadow: 0 3px 0 rgba(0, 0, 0, .12);
}
.parent-chip b { font-size: 17px; }

/* ---------- お題 ---------- */
.q-card {
  position: relative; margin: 10px 0 0; padding: 12px 18px 14px; text-align: center;
  background: #fff; border-radius: var(--radius-l);
  box-shadow: 0 0 0 4px var(--gold), 0 6px 0 4px rgba(0, 0, 0, .12), 0 12px 24px rgba(0, 0, 0, .18);
}
.q-card__label { margin: 0; font-size: 12px; font-weight: 900; color: var(--gold-d); letter-spacing: .2em; }
.q-card__note { margin: 2px 0 0; font-size: 14px; font-weight: 900; color: var(--red-d); }
.q-card__change { margin-top: 4px; }
.question { font-size: 24px; line-height: 1.45; text-align: center; margin: 2px 0 0; font-weight: 900; color: var(--ink); }
/* お題のうしろの「ベスト3」 */
.best3 {
  display: inline-block; margin-left: .4em; padding: .1em .6em; border-radius: 999px; vertical-align: .15em;
  background: var(--gold); color: #4A2400; font-size: .58em; font-weight: 900; line-height: 1.4; letter-spacing: .04em; white-space: nowrap;
}
.lead-box {
  margin: 12px 0 0; padding: 10px 14px; border-radius: var(--radius-m);
  background: rgba(255, 255, 255, .95); text-align: center; font-weight: 700; font-size: 14px; line-height: 1.6;
}
.lead-box b { color: var(--red-d); }
.lead-box small { color: var(--muted); }
.progress { text-align: center; font-weight: 900; font-size: 15px; margin: 14px 0 0; color: #fff; text-shadow: 0 2px 0 var(--turf-dd); }
.sub-title { font-size: 16px; margin: 22px 0 8px; font-weight: 900; color: #fff; letter-spacing: .04em; text-shadow: 0 2px 0 var(--turf-dd); }

/* ---------- 枠の色（JRAと同じ8色） ---------- */
.waku {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 7px;
  font-family: var(--font); font-weight: 900; font-size: 18px; line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .22);
}
.waku--1, .bib--1 { background: #FFFFFF; color: #111; box-shadow: inset 0 0 0 2px #9AA3A6; }
.waku--2, .bib--2 { background: #222222; color: #fff; }
.waku--3, .bib--3 { background: #E8383D; color: #fff; }
.waku--4, .bib--4 { background: #1F6FD6; color: #fff; }
.waku--5, .bib--5 { background: #FFD400; color: #111; }
.waku--6, .bib--6 { background: #1E9E4A; color: #fff; }
.waku--7, .bib--7 { background: #FF8A00; color: #111; }
.waku--8, .bib--8 { background: #FF7FB0; color: #111; }
.waku--s { width: 22px; height: 22px; font-size: 13px; border-radius: 5px; margin: 0 1px; }

/* ---------- 8頭の出走表 ---------- */
.horses { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.horse {
  --mc: var(--red);
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px 8px 8px; border: 0; border-radius: var(--radius-m);
  background: #fff; font: inherit; font-weight: 900; font-size: 17px; line-height: 1.35; text-align: left;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .12);
  -webkit-tap-highlight-color: transparent;
}
button.horse { cursor: pointer; }
button.horse:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.horse__name { flex: 1; min-width: 0; }
.horse__mark {
  display: grid; place-items: center; flex: none; min-width: 42px; height: 34px; padding: 0 6px; border-radius: 10px;
  font-family: var(--deco); font-size: 22px; line-height: 1; color: #fff;
}
.horse__mark:empty { background: var(--panel-2); box-shadow: inset 0 0 0 2px var(--line); }
.horse.is-marked { background: #FFF9EC; box-shadow: inset 0 0 0 3px var(--mc), 0 3px 0 rgba(0, 0, 0, .12); }
.horse.is-marked .horse__mark { background: var(--mc); }
.horse.is-m1 { --mc: #E8453C; }
.horse.is-m2 { --mc: #1F6FD6; }
.horse.is-m3 { --mc: #1E9E4A; }
.horses.is-parent .horse__mark { font-family: var(--font); font-weight: 900; font-size: 15px; }
.horses.is-child .horse__mark { display: inline-flex; align-items: center; gap: 1px; font-family: var(--font); font-weight: 900; font-size: 14px; }
.horses.is-child .horse__mark i { font-style: normal; font-family: var(--deco); font-size: 19px; }
.horses.is-parent .horse.is-m1 { --mc: #D9901A; }
.horses.is-parent .horse.is-m2 { --mc: #7C8A96; }
.horses.is-parent .horse.is-m3 { --mc: #B26A2E; }
.horse.is-static { padding-right: 14px; }
.horse.is-static .horse__mark { display: none; }

/* ---------- 馬券をえらぶ ---------- */
.tickets-box { margin-top: 14px; padding: 12px; border-radius: var(--radius-l); background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.tickets-box__title { margin: 0 0 8px; font-weight: 900; text-align: center; color: #fff; }
.tickets-box__note { margin: 8px 0 0; font-size: 12px; font-weight: 700; text-align: center; color: var(--light-2); }
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tk {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 6px 9px; border: 0; border-radius: 10px; font: inherit; cursor: pointer;
  background: var(--ticket); color: var(--turf-dd);
  box-shadow: inset 0 0 0 2px var(--ticket-line), 0 3px 0 rgba(0, 0, 0, .18);
  -webkit-tap-highlight-color: transparent;
}
.tk__label { font-size: 11px; font-weight: 900; line-height: 1.3; }
.tk__amt { font-family: var(--deco); font-size: 22px; line-height: 1.2; }
.tk__amt small { font-family: var(--font); font-weight: 900; font-size: 12px; margin-left: 1px; }
.tk.is-shobu { background: linear-gradient(180deg, #FFF3C4, #FFD76A); color: #7A3E00; box-shadow: inset 0 0 0 2px #E0A21A, 0 3px 0 rgba(0, 0, 0, .18); }
.tk.is-on { outline: 4px solid var(--red); outline-offset: 1px; transform: translateY(-2px); }
.tk.is-used { opacity: .5; cursor: default; }
.tk__stamp {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-14deg);
  padding: 0 6px; border: 2px solid var(--red); border-radius: 6px;
  background: rgba(255, 255, 255, .8); color: var(--red); font-weight: 900; font-size: 13px; white-space: nowrap;
}

/* 親の答え（自分だけ） */
.mine-box { margin-top: 14px; padding: 8px 12px; border-radius: var(--radius-m); background: #fff; text-align: center; }
.mine-box__list { margin-top: 4px; text-align: left; }
.mine-box__list p { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-weight: 900; }
.mine-box__pos { width: 2.6em; color: var(--gold-d); }

/* みんなの様子 */
.status-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .92); border-radius: 999px; padding: 3px 10px 3px 8px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.status.is-done { color: var(--plus); box-shadow: inset 0 0 0 2px var(--plus); }
.status.is-parent { background: #FFF8E0; }
.status__shobu { margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; }
.host-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 14px; }

/* 下に固定のバー */
.pick-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px max(14px, calc(50% - 240px)) calc(10px + env(safe-area-inset-bottom));
  background: rgba(20, 90, 38, .95); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 -3px 0 #fff, 0 -8px 24px rgba(0, 0, 0, .25);
}
.pick-bar__marks { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 5px; min-width: 0; }
.mk {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #fff; font-weight: 900; font-size: 13px; line-height: 1.5;
}
.mk.is-set { background: #fff; color: var(--ink); }
.mk .waku { width: 22px; height: 22px; font-size: 13px; border-radius: 5px; }
.mk__empty { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: rgba(255, 255, 255, .2); font-size: 12px; }
.mk--amt { padding: 2px 10px; }
.pick-bar__btn { width: auto; margin: 0; padding: 12px 14px; font-size: 15px; flex: none; }
.bar-space { height: 100px; }

/* ---------- 電光掲示板 ---------- */
.board {
  margin: 12px 0 0; padding: 10px 12px 12px; border-radius: 12px;
  background: var(--led-bg); color: var(--led); font-family: var(--dot);
  box-shadow: 0 0 0 4px #3A4550, 0 0 0 7px #1E252C, 0 12px 24px rgba(0, 0, 0, .3);
}
.board__top { display: flex; justify-content: space-between; align-items: center; }
.board__race { font-size: 20px; letter-spacing: .1em; text-shadow: 0 0 8px rgba(255, 178, 46, .8); }
.board__lamp { padding: 2px 12px; border-radius: 6px; font-size: 20px; letter-spacing: .2em; color: #5A221D; background: #2A1210; }
.board.is-confirmed .board__lamp { color: #fff; background: #E8263A; box-shadow: 0 0 16px rgba(232, 38, 58, .9); }
.race-ov .board.is-confirmed .board__lamp { animation: lamp .5s linear 3; }
@keyframes lamp { 0%, 49.9% { color: #fff; background: #E8263A; } 50%, 100% { color: #5A221D; background: #2A1210; box-shadow: none; } }
.board__rows { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.board__row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 3px 6px; border-radius: 6px; background: rgba(255, 255, 255, .04); }
.board__row:not(.is-lit) > *:not(.board__pos) { visibility: hidden; }
.board__row:not(.is-lit) .board__pos { color: #4A3A1A; text-shadow: none; }
.board__row.is-lit { text-shadow: 0 0 8px rgba(255, 178, 46, .75); animation: lit .3s ease-out; }
@keyframes lit { from { background: rgba(255, 178, 46, .35); } }
.board__pos { width: 2.2em; font-size: 26px; text-align: center; line-height: 1; }
.board__pos::after { content: '着'; font-size: 13px; }
.board__name { flex: 1; font-size: 22px; line-height: 1.3; }
.board .waku { font-family: var(--font); }
.board .waku--2 { box-shadow: inset 0 0 0 2px #8A8F96; }
.board__rest { margin: 8px 0 0; font-size: 14px; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; color: #C08E3C; }

/* ---------- 結果 ---------- */
.q-mini { margin: 10px 0 0; padding: 10px 14px; border-radius: var(--radius-m); background: #fff; color: var(--ink); text-align: center; box-shadow: 0 0 0 3px var(--gold); }
.q-mini__label { display: block; font-size: 12px; font-weight: 900; color: var(--gold-d); }
.q-mini__text { display: block; font-size: 19px; font-weight: 900; line-height: 1.45; }
.q-mini__note { display: block; font-size: 13px; font-weight: 900; color: var(--red-d); }

.talk { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--radius-l); background: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.talk p { margin: 4px 0; font-size: 15px; font-weight: 700; }
.talk b { color: var(--red-d); }
.talk__big { font-size: 18px !important; font-weight: 900 !important; text-align: center; }
.talk__sorry { padding: 6px 10px; border-radius: 10px; background: #FFF0EF; }
.talk p.talk__label { display: inline-block; margin: 0 0 2px; padding: 1px 12px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 900; letter-spacing: .15em; }
.talk__best { color: var(--plus); }
.talk__best b { color: var(--plus); }

.pay-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pay { background: #fff; border-radius: var(--radius-m); padding: 10px 12px; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.pay--none { text-align: center; font-weight: 700; color: var(--muted); }
.pay__who { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-weight: 900; }
.pay__name { font-size: 16px; }
.pay__picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pk { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 5px; border-radius: 999px; background: var(--panel-2); font-weight: 900; }
.pk .waku { width: 24px; height: 24px; font-size: 14px; border-radius: 6px; }
.pk__mark { color: var(--muted); font-size: 14px; }
.pk__mark small { margin-left: 1px; font-size: 11px; }
.pk.is-exact { background: #FFF2C8; box-shadow: inset 0 0 0 2px var(--gold-d); }
.pk.is-exact .pk__mark { color: var(--gold-d); }
.pk.is-in { background: #E3F5E8; box-shadow: inset 0 0 0 2px var(--plus); }
.pk.is-in .pk__mark { color: var(--plus); }
.pk.is-out { opacity: .45; }
.pay__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-top: 6px; }
.pay__cat { font-weight: 900; font-size: 18px; line-height: 1.3; }
.pay__cat small { margin-left: 5px; font-size: 12px; color: var(--muted); }
.pay__money { font-size: 13px; font-weight: 700; text-align: right; color: var(--muted); line-height: 1.35; }
.pay__money b { font-size: 18px; color: var(--ink); }
.pay__money small { display: block; font-size: 14px; font-weight: 900; }
.is-plus { color: var(--plus) !important; }
.is-minus { color: var(--minus) !important; }
.pay--trifecta { background: linear-gradient(180deg, #FFF8DC, #fff); box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(255, 200, 61, .7); }
.pay--trifecta .pay__cat { color: var(--gold-d); }
.pay--trio .pay__cat { color: var(--plus); }
.pay--two .pay__cat { color: #1F6FD6; }
.pay--miss { background: #FFF3F2; }
.pay--miss .pay__cat { color: var(--minus); }
.pay-parent {
  display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-m);
  background: #FFF8E0; font-size: 14px; font-weight: 700; box-shadow: inset 0 0 0 2px var(--gold);
}
.pay-parent b { color: var(--ink); }

.tag { display: inline-block; font-size: 11px; font-weight: 900; padding: 1px 8px; border-radius: 999px; color: #fff; line-height: 1.6; }
.tag--you { background: var(--adult); }
.tag--shobu { background: var(--red); }
.tag--best { background: var(--plus); }

/* ---------- 順位 ---------- */
.ranks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.rank { display: flex; align-items: center; gap: 13px; background: #fff; border-radius: 12px; padding: 6px 12px; box-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.rank__no { font-weight: 900; width: 1.5em; text-align: center; color: var(--gold-d); font-size: 18px; }
.rank__name { flex: 1; min-width: 0; font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.rank__tickets { display: block; width: 100%; font-size: 11px; color: var(--muted); font-weight: 700; line-height: 1.3; }
.rank__pt { font-weight: 900; color: var(--ink); white-space: nowrap; }
.rank.is-first { box-shadow: inset 0 0 0 3px var(--gold), 0 3px 0 rgba(0, 0, 0, .1); }
.rank.is-last { background: #FFF1F0; }
.rank__win { font-size: 11px; font-weight: 900; color: #4A2400; background: var(--gold); padding: 1px 8px; border-radius: 999px; }
.rank__last { font-size: 11px; font-weight: 900; color: #fff; background: var(--red); padding: 1px 8px; border-radius: 999px; }
.ranks--mini .rank { padding: 4px 12px; }
.dialog .rank { box-shadow: inset 0 0 0 2px var(--panel-2); }

/* ---------- 最終結果 ---------- */
.winner-card {
  position: relative; margin: 14px 0 0; padding: 14px 12px 16px; border-radius: 22px; text-align: center;
  background: linear-gradient(180deg, #FFF8DC, #fff);
  box-shadow: 0 0 0 4px var(--gold), 0 0 30px rgba(255, 200, 61, .55), 0 12px 26px rgba(0, 0, 0, .25);
}
.winner-card__trophy { display: block; width: 160px; height: auto; margin: 0 auto; filter: drop-shadow(0 6px 10px rgba(120, 60, 0, .25)); }
.winner-card__label { margin: 4px 0 0; font-family: var(--deco); font-size: 30px; color: var(--gold-d); line-height: 1.2; }
.winner-card__who { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 8px; font-weight: 900; font-size: 22px; }
.winner-card__who > span { display: inline-flex; align-items: center; gap: 16px; }
.winner-card__pt { margin: 4px 0 0; font-family: var(--deco); font-size: 26px; color: var(--plus); }

.graph__card { padding: 14px 12px 12px; }
.graph__empty { margin: 0; padding: 12px; border-radius: var(--radius-m); background: #fff; color: var(--muted); text-align: center; font-weight: 700; }
.heat { display: grid; grid-template-columns: 70px repeat(var(--cols), minmax(0, 1fr)); gap: 3px; max-width: 520px; margin: 0 auto; font-size: 11px; }
.heat__corner { display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; font-size: 10px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.heat__col { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; font-weight: 900; }
.heat__row { display: flex; align-items: center; gap: 3px; min-width: 0; font-weight: 900; }
.heat__col span, .heat__row span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat .av--s { width: 24px; height: 24px; }
.heat .av img { transform: scale(1.2); }
.heat__cell { display: grid; place-items: center; aspect-ratio: 1; min-height: 28px; border-radius: 6px; font-weight: 900; font-size: 15px; }
.heat__cell.is-none { background: #F2F2F2; color: #B8B8B8; font-size: 11px; }
.h0 { background: #EEF3EF; color: #9AA59C; }
.h1 { background: #D8F0DC; color: var(--ink); }
.h2 { background: #B6E4BF; color: var(--ink); }
.h3 { background: #8DD39C; color: var(--ink); }
.h4 { background: #5DBE74; color: #fff; }
.h5 { background: #2FA352; color: #fff; }
.h6 { background: var(--gold); color: #5A3300; box-shadow: inset 0 0 0 2px var(--gold-d); }
.graph__note { margin: 6px 0 0; font-size: 11px; color: var(--muted); font-weight: 700; }
.graph__title { margin: 14px 0 4px; font-size: 15px; font-weight: 900; }
.graph__title small { font-size: 11px; color: var(--muted); margin-left: 4px; }
.bars { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.bars__item { display: grid; grid-template-columns: 116px 1fr 42px; align-items: center; gap: 8px; font-weight: 900; font-size: 13px; }
.bars__who { display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: 5px; white-space: nowrap; }
.bars__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bars__bar { height: 14px; border-radius: 999px; background: #EEF3EF; overflow: hidden; }
.bars__bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #8DD39C, var(--plus)); }
.bars__item.is-top .bars__bar i { background: linear-gradient(90deg, #FFE08A, var(--gold-d)); }
.bars__pct { text-align: right; }
.awards { display: grid; gap: 6px; margin-top: 12px; }
.award { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--panel-2); font-size: 12px; font-weight: 700; color: var(--muted); }
.award__icon { font-size: 22px; }
.award b { display: block; font-size: 16px; color: var(--ink); }
.award small { font-size: 11px; }

.recap { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recap__item { padding: 8px 12px 10px; border-radius: var(--radius-m); background: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.recap__item p { margin: 0; }
.recap__head { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.recap__no { font-weight: 900; color: var(--red-d); }
.recap__q { font-weight: 900; font-size: 15px; margin-top: 2px !important; }
.recap__top { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px !important; font-size: 13px; font-weight: 900; }
.recap__horse { display: inline-flex; align-items: center; gap: 4px; }
.recap__horse small { color: var(--gold-d); }
.recap__horse .waku { width: 22px; height: 22px; font-size: 13px; border-radius: 5px; }
.recap__skip { color: var(--muted); }

/* ---------- ダイアログ ---------- */
.dialog {
  border: 0; border-radius: var(--radius-l); padding: 20px;
  width: min(92vw, 420px); font-family: var(--font);
  max-height: 92vh; overflow-y: auto;
  background: #fff; box-shadow: 0 0 0 4px var(--gold), 0 20px 40px rgba(0, 0, 0, .35);
}
.dialog::backdrop { background: rgba(10, 40, 18, .7); }
.dialog__title { margin: 0; font-size: 19px; text-align: center; font-family: var(--deco); font-weight: 400; color: var(--turf-d); }
.share-preview { display: block; width: 100%; height: auto; border-radius: 10px; margin-top: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }

/* ---------- レース（ゴール前） ---------- */
.race-ov {
  position: fixed; inset: 0; z-index: 45; overflow-x: hidden; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  justify-content: center; justify-content: safe center;   /* 入りきらないときは上から */
  padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--sky) 0, var(--sky-2) 34%, #A8DDB3 34.2%, var(--turf) 60%, var(--turf-d) 100%);
}
.race-ov__head { text-align: center; }
.race-ov__name { margin: 0; font-family: var(--deco); font-size: clamp(24px, 7vw, 40px); line-height: 1.3; color: #fff; text-shadow: 0 3px 0 var(--turf-dd), 0 0 14px rgba(0, 0, 0, .2); }
.race-ov__sub { display: inline-block; margin: 4px 0 0; padding: 1px 16px; border-radius: 999px; background: var(--red); color: #fff; font-weight: 900; font-size: 16px; }
.race-ov__track { width: 100%; max-width: 1000px; }
.race-ov__board { width: 100%; max-width: 560px; transform: translateY(30px); opacity: 0; transition: transform .35s, opacity .35s; }
.race-ov__board:empty { display: none; }
.race-ov.is-board .race-ov__board { transform: none; opacity: 1; }
.race-ov__board .board { margin: 0; }

@property --lane { syntax: '<length>'; inherits: true; initial-value: 40px; }
.track {
  --lane: clamp(30px, calc((100vh - 360px) / 8.6), 60px);
  --lane: clamp(30px, calc((100dvh - 360px) / 8.6), 60px);
  transition: --lane .45s ease;
  position: relative; height: calc(var(--lane) * 8 + 34px); border-radius: 12px; overflow: hidden;
  background-color: var(--turf);
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, 0) 30%, rgba(255, 255, 255, .06)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .09) 0 70px, rgba(0, 0, 0, .05) 70px 140px);
  background-position: 0 0, var(--pan, 0px) 0;
  box-shadow: 0 0 0 3px #fff, 0 8px 18px rgba(0, 0, 0, .25);
}
.race-ov.is-board .track {
  --lane: clamp(24px, calc((100vh - 560px) / 8.6), 60px);
  --lane: clamp(24px, calc((100dvh - 560px) / 8.6), 60px);
}
.track__rail { position: absolute; left: 0; right: 0; height: 9px; z-index: 3; background: repeating-linear-gradient(90deg, #fff 0 46px, #D5DDE0 46px 50px); box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.track__rail--top { top: 0; }
.track__rail--bottom { bottom: 0; }
.track__goal { position: absolute; top: 0; bottom: 0; left: 80%; width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .9); z-index: 2; }
.track__goal-sign {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  padding: 1px 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .1em;
}
.lane { position: absolute; left: 0; right: 0; top: calc(13px + var(--lane) * var(--i)); height: var(--lane); z-index: calc(4 + var(--i)); }
.runner { position: absolute; left: 0; top: calc(var(--lane) * -0.64); height: calc(var(--lane) * 1.64); will-change: transform; }
.runner__body { position: relative; display: block; height: 100%; aspect-ratio: 698 / 504; }
.runner__frame { position: absolute; inset: 0; }
.runner__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.runner__f2 { opacity: 0; }
.track.is-running .runner__f1 { animation: frameA var(--rate) linear infinite; animation-delay: var(--delay); }
.track.is-running .runner__f2 { animation: frameB var(--rate) linear infinite; animation-delay: var(--delay); }
@keyframes frameA { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes frameB { 0%, 49.9% { opacity: 0; } 50%, 100% { opacity: 1; } }
/* ゼッケン：馬の絵の白い布だけに、枠の色をぬる（形の型＝cloth1・cloth2。かげは残す） */
.cloth { position: absolute; inset: 0; display: none; mix-blend-mode: multiply; }
@supports ((-webkit-mask-image: none) or (mask-image: none)) {
  .cloth {
    display: block;
    -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  }
}
.cloth--1 { -webkit-mask-image: url(../img/mydabi-cloth1.webp?v=2); mask-image: url(../img/mydabi-cloth1.webp?v=2); }
.cloth--2 { -webkit-mask-image: url(../img/mydabi-cloth2.webp?v=2); mask-image: url(../img/mydabi-cloth2.webp?v=2); }
.cloth.bib--1 { box-shadow: none; }
.cloth-no {
  position: absolute; transform: translate(-50%, -50%);
  font-family: var(--font); font-weight: 900; font-size: calc(var(--lane) * .3); line-height: 1;
}
.runner__f1 .cloth-no { left: 47.6%; top: 44%; }
.runner__f2 .cloth-no { left: 44%; top: 41.3%; }
/* 馬の名前（うしろに、枠の番号つき） */
.runner__name {
  position: absolute; right: calc(100% - 10px); top: 52%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 3px; max-width: 8.5em; padding: 1px 8px 1px 2px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: var(--ink); font-weight: 900; font-size: 12px; line-height: 1.5;
  white-space: nowrap; box-shadow: 0 1px 0 rgba(0, 0, 0, .2);
}
.runner__name .waku { width: 17px; height: 17px; font-size: 11px; border-radius: 4px; }
.runner__label { overflow: hidden; text-overflow: ellipsis; }
.track__flash {
  position: absolute; inset: 0; opacity: 0; pointer-events: none; z-index: 40;
  background: radial-gradient(ellipse 30% 70% at 80% 50%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 100%);
}
.track.is-photo .track__flash { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }

/* ---------- 演出の重ね板 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; overflow-x: hidden; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; justify-content: safe center;
  text-align: center; padding: 24px;
  background: radial-gradient(circle, rgba(63, 174, 86, .97), rgba(20, 90, 38, .98));
}
.overlay__art { position: relative; z-index: 1; width: min(72vw, 340px); }
.overlay__art img { display: block; width: 100%; height: auto; max-height: 40vh; object-fit: contain; margin: 0 auto; }
.overlay__art:empty { display: none; }
.overlay__art img.overlay__emblem { width: min(62vw, 250px); margin-bottom: 10px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.overlay--sorry .overlay__art { width: min(90vw, 560px); }
.overlay--sorry .overlay__art img { border-radius: 14px; box-shadow: 0 0 0 4px #fff, 0 12px 30px rgba(0, 0, 0, .5); }
.overlay--gold .overlay__art img { filter: drop-shadow(0 8px 16px rgba(120, 60, 0, .35)); }
.overlay__date { margin: 0; display: inline-block; padding: 2px 14px; border-radius: 999px; background: rgba(0, 0, 0, .25); color: #fff; font-weight: 900; font-size: 16px; }
.overlay__word {
  position: relative; z-index: 1;
  font-family: var(--deco); line-height: 1.2; margin: 12px 0 0;
  font-size: clamp(38px, 11vw, 72px); color: #fff;
  text-shadow: 0 4px 0 var(--turf-dd), 0 0 18px rgba(0, 0, 0, .2);
  opacity: 0;
}
.overlay__word.is-in { opacity: 1; animation: word .5s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes word { from { transform: scale(2.2) rotate(-6deg); opacity: 0; } }
.overlay__sub {
  position: relative; z-index: 1;
  margin: 14px 0 0; font-weight: 900; font-size: 17px; color: var(--ink);
  background: #fff; padding: 6px 18px; border-radius: 999px; max-width: 92vw;
}
.overlay__sub:empty { display: none; }
.overlay__sub b { color: var(--red-d); }
.overlay--intro { background: linear-gradient(180deg, var(--sky) 0, var(--sky-2) 45%, var(--turf) 45.3%, var(--turf-d) 100%); }
.overlay--intro .overlay__word { font-size: clamp(34px, 10vw, 64px); }
.overlay--gold { background: radial-gradient(circle, #FFE58F, #F2A922 70%, #C77A00); }
.overlay--gold .overlay__word { text-shadow: 0 4px 0 #8A4D00, 0 0 22px rgba(255, 255, 255, .6); }
.overlay--miss { background: radial-gradient(circle, #4A4F57, #16181C); }
.overlay--miss .overlay__word { color: #D5DCE2; text-shadow: 0 4px 0 #000; }
.overlay--miss .overlay__word.is-in { animation: word .5s cubic-bezier(.2, 1.5, .4, 1), shake .5s .5s; }
@keyframes shake { 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.overlay--sorry { background: radial-gradient(circle at 50% 35%, #6B1C1C, #220808); }
.overlay--sorry .overlay__word { font-size: clamp(28px, 8.4vw, 52px); text-shadow: 0 4px 0 #3A0000, 0 0 18px rgba(0, 0, 0, .4); }
.overlay--sorry::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(circle at 14% 30%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 9%),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 8%),
    radial-gradient(circle at 72% 78%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 10%),
    radial-gradient(circle at 24% 84%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 8%);
  opacity: 0; animation: flashes 1.1s linear infinite;
}
@keyframes flashes {
  0%, 6% { opacity: 1; } 6.1%, 38% { opacity: 0; } 38.1%, 44% { opacity: .9; } 44.1%, 70% { opacity: 0; }
  70.1%, 75% { opacity: 1; } 75.1%, 100% { opacity: 0; }
}

/* 紙ふぶき */
.confetti { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -24px; width: 10px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); animation: fall 2.6s linear forwards; }
@keyframes fall { to { top: 110vh; transform: rotate(720deg) translateX(40px); } }

/* 速報（勝負馬券） */
.news {
  position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); z-index: 90; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: 94vw;
  padding: 7px 14px 7px 7px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 900; font-size: 15px;
  box-shadow: 0 0 0 3px var(--red), 0 8px 20px rgba(0, 0, 0, .35);
}
.news__label { flex: none; padding: 2px 10px; border-radius: 999px; background: var(--red); color: #fff; font-size: 13px; letter-spacing: .1em; }
.news__text { overflow-wrap: anywhere; }
.news__text b { color: var(--red-d); }
.news.is-in { animation: newsIn .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes newsIn { from { transform: translate(-50%, -90px); } }

/* ---------- プレミアム ---------- */
.premium-banner {
  display: block; width: 100%; margin-top: 14px; padding: 12px 16px;
  border: 2px dashed #FFD0E1; border-radius: 999px;
  background: rgba(255, 79, 139, .22); color: #fff;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.premium-banner b { color: #FFE3EE; }
.teaser { margin: 18px 0 0; padding: 16px 20px 14px; text-align: center; }
.teaser__label { margin: 4px 0 0; font-size: 13px; font-weight: 900; color: var(--adult-d); }
.teaser__q { margin: 6px 0 0; font-size: 18px; font-weight: 900; line-height: 1.5; }
.teaser__note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.teaser .btn { margin-top: 10px; padding: 10px; font-size: 15px; }
.premium__list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.premium__list li { background: var(--panel-2); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.premium__list b { display: block; font-size: 15px; color: var(--ink); }
.premium__price { margin: 14px 0 0; text-align: center; font-size: 30px; font-weight: 900; color: var(--adult-d); }
.premium__price small { font-size: 13px; color: var(--muted); font-weight: 700; }
.premium__warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #FFE8EF; color: var(--adult-d); font-size: 13px; font-weight: 700; }
.premium__owned { margin: 14px 0 0; text-align: center; font-weight: 900; line-height: 1.8; }

/* ---------- そのほか ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 80;
  max-width: 90vw; padding: 10px 18px; border-radius: 999px;
  background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; text-align: center;
  box-shadow: 0 0 0 3px var(--gold), 0 6px 16px rgba(0, 0, 0, .3);
}
.foot { text-align: center; font-size: 12px; color: var(--light-2); margin-top: 36px; }
.foot a { color: #fff; font-weight: 700; }
.foot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.foot__links a { color: var(--light-2); font-weight: 500; }
.foot__credit { margin: 8px 0 0; }

/* ---------- 観戦画面（配信・テレビ）は大きく ---------- */
body.is-watch .app { max-width: 1100px; }
body.is-watch .question { font-size: 34px; }
body.is-watch [data-player-only] { display: none !important; }
body.is-watch .horses { grid-template-columns: 1fr 1fr; }
body.is-watch .horse { font-size: 22px; padding: 10px 14px; }
body.is-watch .horse .waku { width: 38px; height: 38px; font-size: 22px; }
body.is-watch .pay-list { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
body.is-watch .board { max-width: 760px; margin-left: auto; margin-right: auto; }
body.is-watch .board__name { font-size: 30px; }
body.is-watch .winner-card { max-width: 760px; margin-left: auto; margin-right: auto; }
body.is-watch .graph__card, body.is-watch .ranks, body.is-watch .recap { max-width: 760px; margin-left: auto; margin-right: auto; }
body.is-watch .heat { max-width: 640px; font-size: 13px; }
body.is-watch .race-head__name { font-size: 34px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
