/* G1馬人生スロット — 深緑ターフ × 真鍮ゴールド × クリーム白 */
:root {
  --turf-950: #03100a;
  --turf-900: #061811;
  --turf-800: #0b281e;
  --turf-700: #0f3225;
  --turf-600: #133d2d;
  --turf-500: #1d5a40;
  --brass-200: #fff4c8;
  --brass-300: #f7e09b;
  --brass-400: #ecd083;
  --brass-500: #dfb860;
  --brass-600: #c99a3e;
  --brass-700: #8a6424;
  --brass-900: #3a2708;
  --cream: #f6f1e3;
  --cream-dim: rgba(246, 241, 227, 0.72);
  --crimson: #a3182a;
  --crimson-deep: #5c0b15;
  --t0: #6f7570;
  --t1: #f2ecdc;
  --t2: #4f9be8;
  --t3: #3fbf75;
  --t4: #e8463c;
  --t5: #f2c94c;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", Meiryo, sans-serif;
  --rainbow: linear-gradient(100deg, #ff5f6d, #ffc371, #fff17a, #7dffb0, #5ec8ff, #a17bff, #ff7de9);
  --gold-face: linear-gradient(180deg, #fff7d6 0%, #f7e09b 42%, #dfb860 62%, #a87a2a 100%);
  --frame-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Crect x='4.5' y='4.5' width='39' height='39' fill='none' stroke='%23dfb860' stroke-width='1.3'/%3E%3Crect x='8.5' y='8.5' width='31' height='31' fill='none' stroke='%23dfb860' stroke-opacity='.4' stroke-width='1'/%3E%3Cg fill='%23f7e09b'%3E%3Cpath d='M4.5 0.5 8.5 4.5 4.5 8.5 0.5 4.5Z'/%3E%3Cpath d='M43.5 0.5 47.5 4.5 43.5 8.5 39.5 4.5Z'/%3E%3Cpath d='M4.5 39.5 8.5 43.5 4.5 47.5 0.5 43.5Z'/%3E%3Cpath d='M43.5 39.5 47.5 43.5 43.5 47.5 39.5 43.5Z'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: #020a06; }
body {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(120% 80% at 50% 10%, #0d3022 0%, #03100a 60%, #010604 100%);
  color: var(--cream);
  font-family: var(--sans);
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
html.in-x body { align-items: flex-start; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--brass-300); outline-offset: 2px; }
svg { display: block; }

.phone {
  position: relative;
  width: min(100vw, 430px);
  height: min(100vh, 932px);
  height: min(100dvh, 932px);
  container-type: size;
  container-name: phone;
  overflow: hidden;
  overflow: clip;
  background: var(--turf-800);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  isolation: isolate;
}
html.in-x .phone { height: calc(100vh - 56px); height: calc(100dvh - 56px); max-height: 876px; }
/* 揺れ演出は .stage（固定・クリップ）の内側の .stage-in だけを動かす */
.stage { position: absolute; inset: 0; overflow: hidden; overflow: clip; }
.stage-in { position: absolute; inset: 0; }
input { user-select: text; -webkit-user-select: text; }

/* ---------- 背景（画像未配置でも成立するグラデーション） ---------- */
.bg, .bg > div { position: absolute; inset: 0; pointer-events: none; }
.bg { z-index: 0; }
.bg-turf {
  background:
    url("../assets/img/bg-turf.webp") center / cover no-repeat,
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0 7%, rgba(0, 0, 0, 0.05) 7% 14%),
    radial-gradient(120% 60% at 50% -5%, rgba(247, 224, 155, 0.28) 0%, rgba(247, 224, 155, 0) 55%),
    radial-gradient(140% 90% at 50% 0%, #1f5c42 0%, #133d2d 38%, #0b281e 70%, #061811 100%);
}
.bg-rush {
  opacity: 0;
  transition: opacity 0.6s ease;
  background:
    url("../assets/img/bg-rush.webp") center / cover no-repeat,
    conic-gradient(from 200deg at 50% 110%, rgba(255, 220, 140, 0) 0deg, rgba(255, 220, 140, 0.22) 20deg, rgba(255, 220, 140, 0) 40deg, rgba(255, 170, 220, 0.18) 70deg, rgba(255, 220, 140, 0) 95deg, rgba(150, 220, 255, 0.16) 125deg, rgba(255, 220, 140, 0) 150deg),
    linear-gradient(180deg, #2a0f1e 0%, #7a2d14 28%, #d48a2a 52%, #6b4a12 72%, #10301f 100%);
}
.phone.rush .bg-rush { opacity: 1; }
.bg-vignette { background: radial-gradient(110% 80% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%); }

/* ---------- 画面 ---------- */
.scr {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(6px, 1.4cqh, 14px);
  padding: max(env(safe-area-inset-top), clamp(10px, 2cqh, 20px)) 16px max(env(safe-area-inset-bottom), clamp(10px, 2cqh, 18px));
}
.scr.active { display: flex; animation: scrIn 0.32s ease both; }
.scr.scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@keyframes scrIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 共通部品 ---------- */
.frame { border: 12px solid transparent; border-image: var(--frame-svg) 12 / 12px stretch; }
.panel {
  background: linear-gradient(180deg, rgba(21, 66, 48, 0.94), rgba(8, 31, 22, 0.95));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(247, 224, 155, 0.08);
  border-radius: 4px;
}
.plate-head {
  align-self: center;
  position: relative;
  min-width: 62%;
  padding: 0 34px;
  height: clamp(44px, 6.4cqh, 58px);
  display: grid;
  place-items: center;
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%);
  background: linear-gradient(180deg, #f7e09b, #b88a36 50%, #f0d58c);
}
.plate-head::before {
  content: "";
  position: absolute;
  inset: 2px;
  clip-path: polygon(15px 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 15px 100%, 0 50%);
  background: linear-gradient(180deg, #1c573f, #0c2b20);
}
.plate-head span {
  position: relative;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(20px, 3.4cqh, 30px);
  letter-spacing: 0.12em;
  background: var(--gold-face);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}

.cta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: clamp(56px, 8.4cqh, 72px);
  padding: 8px 18px 8px 10px;
  border-radius: 6px;
  color: #2a1b05;
  background: linear-gradient(180deg, #fff3c4 0%, #f2d27c 42%, #cf9f45 58%, #ecc76d 100%);
  border: 1px solid #fff4c8;
  box-shadow: 0 0 0 2px #6b4a14, 0 0 0 3px rgba(247, 224, 155, 0.6), 0 10px 22px rgba(0, 0, 0, 0.5), inset 0 -3px 0 rgba(120, 80, 20, 0.35);
  transition: transform 0.08s ease, filter 0.2s ease;
}
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0) 60%);
  background-size: 250% 100%;
  animation: ctaSheen 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ctaSheen { 0%, 55% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.cta:active { transform: translateY(2px) scale(0.99); }
.cta:disabled { filter: grayscale(0.8) brightness(0.7); cursor: default; }
.cta:disabled::after { animation: none; }
.cta-slim { justify-content: center; min-height: 52px; }
.cta-medal {
  flex: none;
  width: clamp(44px, 6.4cqh, 54px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #e0485a 0%, #a3182a 45%, #5c0b15 100%);
  box-shadow: 0 0 0 3px #e8c46c, 0 0 0 5px #6b4a14, inset 0 2px 4px rgba(255, 255, 255, 0.35), inset 0 -4px 8px rgba(0, 0, 0, 0.45);
}
.cta-medal svg { width: 64%; height: 64%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
.cta-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.cta-slim .cta-text { align-items: center; }
.cta-text b { font-family: var(--serif); font-weight: 900; font-size: clamp(20px, 3.2cqh, 26px); letter-spacing: 0.06em; }
.cta-text small { font-size: clamp(12px, 1.7cqh, 14px); font-weight: 700; opacity: 0.8; }

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brass-300);
  background: rgba(3, 16, 10, 0.55);
  box-shadow: inset 0 0 0 1px rgba(223, 184, 96, 0.6);
}
.icon-btn svg { width: 22px; height: 22px; }

.foot-links {
  margin-top: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: clamp(12px, 1.7cqh, 14px);
}
.foot-links button, .foot-links .best {
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--cream-dim);
  border-bottom: 1px solid rgba(223, 184, 96, 0.35);
}
.foot-links b { color: var(--brass-300); font-weight: 700; }
.foot-links .best { border: 0; }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(max(env(safe-area-inset-bottom), 12px) + 90px);
  z-index: 60;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  color: #2a1b05;
  background: var(--gold-face);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 結果画面では下部のシェア・再挑戦ボタンに重ねず、上端に出す */
.phone:has(#scrResult.active) .toast { top: calc(max(env(safe-area-inset-top), 10px) + 44px); bottom: auto; transform: translate(-50%, -12px); }
.phone:has(#scrResult.active) .toast.show { transform: translate(-50%, 0); }

/* ---------- 1. タイトル ---------- */
#scrTitle { justify-content: flex-start; }
.t-head { text-align: center; padding-top: clamp(0px, 1.5cqh, 18px); }
.wordmark { font-style: italic; font-weight: 900; letter-spacing: 0.04em; font-size: clamp(14px, 2.2cqh, 18px); color: var(--cream); }
.wordmark b { color: var(--brass-400); }
.t-logo { margin: clamp(2px, 1cqh, 10px) 0 0; line-height: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.t-logo-g1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(54px, 10.5cqh, 92px);
  letter-spacing: 0.02em;
  background: var(--gold-face);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #3a2708) drop-shadow(0 0 18px rgba(247, 224, 155, 0.35));
}
.t-logo-main {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(28px, min(5.2cqh, 9.6cqw), 46px);
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
  padding: 0 18px 4px;
  border-bottom: 2px solid rgba(223, 184, 96, 0.6);
}
.t-catch { margin: clamp(6px, 1.4cqh, 14px) 0 0; font-size: clamp(13px, 2cqh, 16px); color: var(--cream-dim); }
.t-catch b { color: var(--brass-300); font-weight: 900; }
.t-catch .nw { white-space: nowrap; }
.t-form { display: flex; flex-direction: column; gap: clamp(6px, 1.3cqh, 12px); padding: clamp(6px, 1.2cqh, 12px) 8px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field-label { font-size: 12px; font-weight: 700; color: var(--brass-300); letter-spacing: 0.1em; }
.name-row { display: flex; gap: 8px; }
.name-row input {
  flex: 1;
  min-width: 0;
  height: clamp(44px, 6cqh, 50px);
  padding: 0 12px;
  font-size: 17px;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--cream);
  background: rgba(3, 16, 10, 0.7);
  border: 1px solid rgba(223, 184, 96, 0.55);
  border-radius: 4px;
}
.name-row input::placeholder { color: rgba(246, 241, 227, 0.4); font-weight: 400; }
.dice { width: 48px; flex: none; border-radius: 4px; color: var(--brass-300); background: rgba(3, 16, 10, 0.7); border: 1px solid rgba(223, 184, 96, 0.55); display: grid; place-items: center; }
.dice svg { width: 24px; height: 24px; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.seg4 { grid-template-columns: repeat(4, 1fr); }
.seg button {
  min-height: 44px;
  border-radius: 4px;
  font-weight: 700;
  font-size: clamp(13px, 1.9cqh, 15px);
  color: var(--cream-dim);
  background: rgba(3, 16, 10, 0.55);
  border: 1px solid rgba(223, 184, 96, 0.3);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg button[aria-checked="true"] {
  color: #2a1b05;
  background: linear-gradient(180deg, #fff3c4, #e9c56a 55%, #c99a3e);
  border-color: #fff4c8;
  box-shadow: 0 0 12px rgba(247, 224, 155, 0.35);
}

/* ---------- 2. スロット ---------- */
#scrSlot { gap: clamp(5px, 1cqh, 10px); }
.hud { display: flex; align-items: center; gap: 10px; }
.hud-age { flex: 1; display: flex; flex-direction: column; line-height: 1.15; }
.hud-age b { font-family: var(--serif); font-size: clamp(22px, 3.6cqh, 30px); font-weight: 900; color: var(--cream); }
.hud-age span { font-size: clamp(12px, 1.7cqh, 14px); color: var(--brass-300); }
.cls-badge {
  min-width: 92px;
  height: 44px;
  padding: 0 14px 4px;
  display: grid;
  place-items: center;
  clip-path: polygon(0 0, 100% 0, 100% 64%, 50% 100%, 0 64%);
  background: linear-gradient(180deg, #8f9a93, #4c5651);
  font-weight: 900;
  font-size: 15px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.cls-badge[data-cls="1"] { background: linear-gradient(180deg, #7a6f62, #3d352c); }
.cls-badge[data-cls="2"], .cls-badge[data-cls="3"], .cls-badge[data-cls="4"] { background: linear-gradient(180deg, #d79a6a, #8a4b25); }
.cls-badge[data-cls="5"] { background: linear-gradient(180deg, #e9eef2, #8a98a4); color: #1b2530; text-shadow: none; }
.cls-badge[data-cls="6"] { background: linear-gradient(180deg, #fff3c4, #c99a3e); color: #2a1b05; text-shadow: none; }
.cls-badge[data-cls="7"] { background: var(--rainbow); color: #1a1030; text-shadow: 0 0 6px rgba(255, 255, 255, 0.8); }
.cls-badge.bump { animation: bump 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

.lamps { display: flex; gap: 4px; align-items: center; justify-content: center; }
.lamps i { width: clamp(14px, 4cqw, 20px); height: 8px; border-radius: 4px; background: rgba(3, 16, 10, 0.7); box-shadow: inset 0 0 0 1px rgba(223, 184, 96, 0.35); }
.lamps i.done { background: linear-gradient(180deg, #fff3c4, #dfb860); box-shadow: 0 0 6px rgba(247, 224, 155, 0.6); }
.lamps i.now { background: var(--crimson); box-shadow: 0 0 8px rgba(232, 70, 60, 0.9); animation: lampBlink 0.9s ease-in-out infinite alternate; }
.lamps i.extra { opacity: 0.35; }
.lamps i.extra.on { opacity: 1; }
.lamps .gap { width: 8px; }
@keyframes lampBlink { to { opacity: 0.45; } }

.marquee { background: rgba(3, 16, 10, 0.78); min-height: 48px; display: flex; align-items: center; overflow: hidden; }
.marquee-in { width: 100%; text-align: center; font-family: var(--serif); font-weight: 700; font-size: clamp(14px, 2.1cqh, 17px); color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marquee-in.flash { animation: mqFlash 0.5s ease; }
@keyframes mqFlash { 0% { color: #fff; text-shadow: 0 0 12px #fff; } 100% { color: var(--cream); } }
.phone.rush .marquee { background: linear-gradient(90deg, rgba(90, 20, 10, 0.85), rgba(160, 90, 20, 0.85), rgba(90, 20, 10, 0.85)); }

.board { position: relative; flex: 1; min-height: 0; display: flex; }
.board-frame {
  position: absolute;
  inset: -4px;
  border-radius: 10px;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(223, 184, 96, 0.55), 0 0 0 5px rgba(3, 16, 10, 0.8), 0 0 0 6px rgba(223, 184, 96, 0.3);
  transition: box-shadow 0.25s;
}
.board[data-preview="blue"] .board-frame { box-shadow: 0 0 0 2px #8cc8ff, 0 0 26px 6px rgba(79, 155, 232, 0.85); animation: pv 0.4s ease-in-out 3 alternate; }
.board[data-preview="green"] .board-frame { box-shadow: 0 0 0 2px #95ffbf, 0 0 26px 6px rgba(63, 191, 117, 0.85); animation: pv 0.4s ease-in-out 3 alternate; }
.board[data-preview="red"] .board-frame { box-shadow: 0 0 0 3px #ff8a7a, 0 0 34px 10px rgba(232, 70, 60, 0.95); animation: pv 0.28s ease-in-out 5 alternate; }
.board[data-preview="gold"] .board-frame { box-shadow: 0 0 0 3px #fff4c8, 0 0 40px 12px rgba(242, 201, 76, 1); animation: pv 0.22s ease-in-out 7 alternate; }
.board[data-preview="rainbow"] .board-frame { box-shadow: 0 0 0 3px #fff, 0 0 46px 14px rgba(255, 140, 220, 0.9); animation: pvRainbow 0.6s linear infinite; }
@keyframes pv { from { opacity: 1; } to { opacity: 0.45; } }
@keyframes pvRainbow { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
.phone.rush .board-frame { box-shadow: 0 0 0 2px #fff4c8, 0 0 22px 4px rgba(255, 190, 90, 0.75); }

.reels { position: relative; flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: clamp(6px, 1.1cqh, 10px); }
.reel {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 6px 7px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(21, 66, 48, 0.95), rgba(6, 26, 18, 0.96));
  box-shadow: inset 0 0 0 1px rgba(223, 184, 96, 0.55), inset 0 0 0 3px rgba(3, 16, 10, 0.85), inset 0 0 0 4px rgba(223, 184, 96, 0.2);
}
.reel.fav::before { content: "得意"; position: absolute; top: -7px; right: 6px; z-index: 2; font-size: 10px; font-weight: 900; padding: 1px 6px; border-radius: 3px; color: #2a1b05; background: var(--gold-face); }
.reel-name { text-align: center; font-size: clamp(11px, 1.6cqh, 13px); font-weight: 700; color: var(--brass-300); letter-spacing: 0.08em; }
.reel-win {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(180deg, #020b07, #0a2a1d 50%, #020b07);
  box-shadow: inset 0 6px 10px rgba(0, 0, 0, 0.75), inset 0 -6px 10px rgba(0, 0, 0, 0.75);
}
.strip { position: absolute; left: 6%; right: 6%; top: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.reel.spinning .strip { animation: stripRun 0.36s linear infinite; filter: blur(1.2px); }
.reel.slow .strip { animation-duration: 1.1s; filter: blur(0.3px); }
@keyframes stripRun { from { transform: translateY(-50%); } to { transform: translateY(0); } }
.reel.spinning .reel-face, .reel.slow .reel-face { opacity: 0; }
.reel:not(.spinning):not(.slow) .strip { opacity: 0; }
.reel-face { position: absolute; inset: 5px; display: grid; place-items: center; }
.plate {
  position: relative;
  width: 100%;
  height: clamp(30px, 5cqh, 46px);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(16px, 2.6cqh, 22px);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.5);
}
.plate.t0 { background: linear-gradient(180deg, #9aa09b, #545a56); color: #e6e6e2; }
.plate.t1 { background: linear-gradient(180deg, #ffffff, #d7cfb9); color: #3a3426; text-shadow: none; }
.plate.t2 { background: linear-gradient(180deg, #9fd0ff, #2b6fbf); }
.plate.t3 { background: linear-gradient(180deg, #9cf0c0, #1f8a4c); }
.plate.t4 { background: linear-gradient(180deg, #ff9a8c, #b81f1a); }
.plate.t5 { background: linear-gradient(180deg, #fff7d0, #f2c94c 45%, #a8781f); color: #3a2708; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.plate.t6 { background: linear-gradient(110deg, #ff5f6d, #ffc371, #fff17a, #7dffb0, #5ec8ff, #a17bff, #ff7de9, #ff5f6d); background-size: 200% 100%; animation: rainbowSlide 1.2s linear infinite; color: #fff; }
@keyframes rainbowSlide { to { background-position: -200% 0; } }
.reel-face .plate { height: 100%; font-size: clamp(22px, 4.2cqh, 36px); border-radius: 6px; }
.reel-face .plate.t0 { filter: saturate(0.4); }
.reel.landed .reel-face .plate { animation: land 0.42s cubic-bezier(0.2, 1.8, 0.4, 1); }
.reel.landed.hot .reel-face .plate { animation: landHot 0.7s cubic-bezier(0.2, 1.8, 0.4, 1); }
.reel.landed .reel-face .plate.t5, .reel.landed .reel-face .plate.t6 { box-shadow: 0 0 18px 4px rgba(255, 230, 150, 0.85), inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.reel.landed .reel-face .plate.t4 { box-shadow: 0 0 14px 2px rgba(255, 110, 90, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.4); }
@keyframes land { 0% { transform: translateY(-30%) scale(1.06); } 100% { transform: none; } }
@keyframes landHot { 0% { transform: scale(1.6); filter: brightness(2.2); } 100% { transform: none; filter: none; } }
.reel.reach .reel-win { box-shadow: inset 0 0 0 2px #fff4c8, 0 0 18px 4px rgba(242, 201, 76, 0.9); }
.reel.reach-rainbow .reel-win { box-shadow: inset 0 0 0 2px #fff, 0 0 22px 6px rgba(255, 140, 220, 0.95); animation: pvRainbow 0.5s linear infinite; }
.reel.pulse .reel-win { animation: revivePulse 0.43s ease-in-out infinite; }
@keyframes revivePulse { 0%, 100% { box-shadow: inset 0 0 0 2px #3b0008, inset 0 0 26px rgba(120, 0, 10, 0.9); filter: brightness(0.7); } 50% { box-shadow: inset 0 0 0 2px #ff2a3a, inset 0 0 40px rgba(220, 0, 20, 0.95), 0 0 24px rgba(200, 0, 20, 0.8); filter: brightness(1.1); } }
.reel-foot { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px; }
.reel-foot .val { font-family: var(--serif); font-weight: 900; font-size: clamp(16px, 2.6cqh, 22px); color: var(--cream); }
.reel-foot .grade { font-family: var(--serif); font-weight: 900; font-size: clamp(16px, 2.6cqh, 22px); color: var(--brass-300); }
.reel-foot .grade.up { animation: gradeUp 0.9s ease; }
@keyframes gradeUp { 0% { transform: scale(2); color: #fff; text-shadow: 0 0 14px #fff; } 100% { transform: none; } }
.gauge { height: 5px; border-radius: 3px; background: rgba(3, 16, 10, 0.85); overflow: hidden; }
.gauge i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a6424, #f7e09b); transition: width 0.5s ease; }
.gain-pop {
  position: absolute;
  right: 8px;
  bottom: 22px;
  left: auto;
  top: auto;
  z-index: 3;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(13px, 2cqh, 16px);
  color: var(--brass-200);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  animation: gainPop 0.9s ease-out forwards;
}
@keyframes gainPop { 0% { opacity: 0; transform: translateY(6px) scale(0.6); } 25% { opacity: 1; transform: translateY(-4px) scale(1.15); } 100% { opacity: 0; transform: translateY(-22px) scale(1); } }

.ticker { min-height: clamp(30px, 4.4cqh, 40px); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.tick-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 4px; font-size: clamp(12px, 1.7cqh, 14px); background: rgba(3, 16, 10, 0.6); animation: tickIn 0.25s ease both; }
.tick-row b { font-family: var(--serif); font-weight: 900; }
.tick-row.win { background: linear-gradient(90deg, rgba(223, 184, 96, 0.35), rgba(3, 16, 10, 0.6)); }
.tick-row.win b { color: var(--brass-300); }
.tick-row .up { color: #fff; font-weight: 900; background: var(--crimson); padding: 1px 6px; border-radius: 3px; font-size: 11px; }
@keyframes tickIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.console { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding-bottom: 2px; }
.stat { display: flex; flex-direction: column; line-height: 1.1; }
.stat small { font-size: 11px; color: var(--brass-300); letter-spacing: 0.06em; }
.stat b { font-family: var(--serif); font-weight: 900; font-size: clamp(26px, 4.4cqh, 36px); background: var(--gold-face); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat.rank { align-items: flex-end; text-align: right; }
.stat b { white-space: nowrap; }
.stat.rank b i { font-style: normal; font-size: 0.5em; }
.stat b.tick { animation: numTick 0.2s ease; }
@keyframes numTick { 50% { transform: scale(1.12); } }
.spin-btn { position: relative; width: clamp(96px, 14.5cqh, 128px); aspect-ratio: 1; border-radius: 50%; }
.spin-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 20deg, #fff4c8, #b8862f, #f7e09b, #8a6424, #fff1b8, #b8862f, #fff4c8);
  box-shadow: 0 0 0 2px #3a2708, 0 10px 24px rgba(0, 0, 0, 0.6), 0 0 26px rgba(247, 224, 155, 0.35);
}
.spin-disc {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 38% 28%, #f0606f 0%, #b01b2e 38%, #6a0c18 78%, #3e050d 100%);
  box-shadow: inset 0 3px 6px rgba(255, 255, 255, 0.35), inset 0 -8px 14px rgba(0, 0, 0, 0.55), 0 0 0 2px #5a3d0c;
  transition: transform 0.08s ease, filter 0.2s;
}
.spin-shoe { width: 50%; height: 50%; margin-top: -6%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); }
.spin-label { font-family: var(--serif); font-weight: 900; font-size: clamp(15px, 2.4cqh, 20px); letter-spacing: 0.1em; color: var(--brass-200); text-shadow: 0 1px 2px #000; margin-top: -2px; }
.spin-btn.ready .spin-ring { animation: ringGlow 1.6s ease-in-out infinite; }
@keyframes ringGlow { 50% { box-shadow: 0 0 0 2px #3a2708, 0 10px 24px rgba(0, 0, 0, 0.6), 0 0 40px rgba(247, 224, 155, 0.8); } }
.spin-btn:active .spin-disc, .spin-btn.pressed .spin-disc { transform: scale(0.92); box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.6), 0 0 0 2px #5a3d0c; }
.spin-btn.busy .spin-disc { filter: brightness(0.75) saturate(0.7); }
.spin-btn.locked .spin-disc { filter: brightness(0.55) saturate(0.4); }

/* ---------- 3. 新馬戦 / 5. 大舞台 ---------- */
#scrDebut, #scrRace { justify-content: flex-start; }
.race-card { padding: 8px 10px; display: flex; flex-direction: column; gap: 10px; }
.rc-top { display: flex; align-items: center; gap: 12px; }
.rc-top b { display: block; font-family: var(--serif); font-size: clamp(22px, 3.6cqh, 30px); font-weight: 900; }
.rc-top small { color: var(--brass-300); font-size: 13px; }
.zekken { flex: none; width: 48px; height: 56px; display: grid; place-items: center; font-family: var(--serif); font-weight: 900; font-size: 28px; color: #111; background: #f6f1e3; border-radius: 4px; box-shadow: inset 0 0 0 3px #111, 0 4px 10px rgba(0, 0, 0, 0.5); }
.odds-board { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.odds-cell { background: #020b07; border-radius: 6px; padding: 6px 10px; box-shadow: inset 0 0 0 1px rgba(223, 184, 96, 0.4); text-align: center; }
.odds-cell small { display: block; font-size: 12px; color: var(--brass-300); }
.drum { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-weight: 900; font-size: clamp(28px, min(5.6cqh, 10cqw), 46px); line-height: 1.15; white-space: nowrap; color: #ffd36b; text-shadow: 0 0 10px rgba(255, 190, 70, 0.7); height: 1.15em; overflow: hidden; }
.drum .unit { font-family: var(--serif); font-style: normal; font-size: 0.5em; line-height: 1; margin-left: 0.12em; }
.drum.rolling span { display: inline-block; animation: drumRoll 0.07s linear infinite; }
.drum.landed span { display: inline-block; animation: drumLand 0.5s cubic-bezier(0.2, 1.8, 0.4, 1); color: #fff4c8; }
@keyframes drumRoll { from { transform: translateY(-40%); opacity: 0.6; } to { transform: translateY(40%); opacity: 1; } }
@keyframes drumLand { 0% { transform: scale(1.6); } 100% { transform: none; } }

.lf-track:empty { visibility: hidden; }
.lf-track { position: relative; background: rgba(3, 16, 10, 0.82); padding: 4px 6px 8px; transition: filter 0.3s; }
.lf-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--serif); font-weight: 900; color: var(--brass-300); font-size: 14px; padding: 0 2px 4px; }
.lf-head .lf-dist { font-size: clamp(22px, 3.6cqh, 30px); color: var(--cream); }
.lf-lanes { position: relative; display: flex; flex-direction: column; gap: 6px; padding-right: 8px; }
.lane { position: relative; height: clamp(22px, 3.4cqh, 30px); border-radius: 3px; background: repeating-linear-gradient(90deg, rgba(40, 110, 70, 0.55) 0 22px, rgba(30, 90, 58, 0.55) 22px 44px); overflow: visible; }
.lane-name { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: rgba(246, 241, 227, 0.75); z-index: 1; white-space: nowrap; }
.lane .runner { position: absolute; top: 50%; left: 0; width: 26px; height: 18px; transform: translate(-100%, -50%); border-radius: 50% 40% 40% 50%; background: radial-gradient(circle at 60% 40%, #c9cfd6, #5b6470); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); z-index: 2; }
.lane.me { box-shadow: inset 0 0 0 1px rgba(247, 224, 155, 0.7); }
.lane.me .lane-name { color: var(--brass-200); }
.lane.me .runner { background: radial-gradient(circle at 60% 40%, #fff4c8, #c99a3e); box-shadow: 0 0 0 2px #3a2708, 0 0 12px rgba(247, 224, 155, 0.9); }
.goal { position: absolute; top: -4px; bottom: -4px; right: 0; width: 6px; background: repeating-linear-gradient(180deg, #fff 0 6px, #111 6px 12px); box-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
.lf-track.photo { filter: grayscale(1) contrast(1.25) brightness(1.05); }
.photo-stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg) scale(2); opacity: 0; font-family: var(--serif); font-weight: 900; font-size: clamp(22px, 7cqw, 30px); letter-spacing: 0.14em; white-space: nowrap; color: #fff; padding: 4px 10px 4px calc(10px + 0.14em); border: 3px solid #fff; background: rgba(0, 0, 0, 0.55); pointer-events: none; z-index: 4; }
.lf-track.photo .photo-stamp { animation: stamp 0.35s ease-out forwards; }
@keyframes stamp { to { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); } }
.shutter { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 5; }
.shutter.go { animation: shutter 0.28s ease-out; }
@keyframes shutter { 0% { opacity: 0.95; } 100% { opacity: 0; } }

.race-result { min-height: clamp(60px, 9cqh, 90px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; }
.race-result .place { font-family: var(--serif); font-weight: 900; font-size: clamp(44px, 8cqh, 72px); line-height: 1; background: var(--gold-face); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #3a2708); animation: land 0.5s cubic-bezier(0.2, 1.8, 0.4, 1); }
.race-result .place.lose { background: linear-gradient(180deg, #e9e4d4, #8d958f); -webkit-background-clip: text; background-clip: text; }
.race-result .place.win1 { filter: drop-shadow(0 3px 0 #3a2708) drop-shadow(0 0 18px rgba(247, 224, 155, 0.8)); }
.race-result .sub { font-size: clamp(13px, 2cqh, 16px); color: var(--cream-dim); }
.race-result .sub b { color: var(--brass-300); }

.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ladder li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 4px; background: rgba(3, 16, 10, 0.6); font-size: clamp(12px, 1.8cqh, 14px); min-height: 32px; }
.ladder li img { width: 26px; height: 26px; }
.ladder li .g { flex: none; width: 36px; text-align: center; font-weight: 900; font-size: 11px; border-radius: 3px; padding: 2px 0; color: #fff; }
.ladder li .g.G1 { background: #2f6fd0; }
.ladder li .g.G2 { background: #c8413a; }
.ladder li .g.G3 { background: #2c9257; }
.ladder li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ladder li .st { flex: none; font-family: var(--serif); font-weight: 900; }
.ladder li.now { box-shadow: inset 0 0 0 1px var(--brass-300); background: rgba(223, 184, 96, 0.16); }
.ladder li.win .st { color: var(--brass-300); }
.ladder li.skip { opacity: 0.45; }
.race-now { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.race-emblem { width: 56px; height: 56px; flex: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.race-now-body { flex: 1; min-width: 0; }
.race-now-body b { display: block; font-family: var(--serif); font-weight: 900; font-size: clamp(17px, min(3cqh, 5.4cqw), 24px); line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }
.race-now-body small { color: var(--brass-300); font-size: 12px; }
.race-pop { text-align: right; font-family: var(--serif); font-weight: 900; font-size: 15px; color: var(--cream); white-space: nowrap; }
.race-pop b { color: #ffd36b; font-size: 20px; }

/* ---------- 4. 分かれ道 ---------- */
#scrFork { justify-content: flex-start; }
.fork-heading { margin: 0; text-align: center; font-family: var(--serif); font-size: clamp(18px, 3cqh, 24px); color: var(--cream); }
.fork-cards { flex: 1; min-height: 0; display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.fork-card {
  position: relative;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(223, 184, 96, 0.6), 0 8px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.fork-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3, 16, 10, 0) 20%, rgba(3, 16, 10, 0.9) 85%); }
.fork-card > * { position: relative; }
.fork-card b { font-family: var(--serif); font-size: clamp(22px, 3.6cqh, 30px); font-weight: 900; color: var(--cream); text-shadow: 0 2px 4px #000; }
.fork-card .pros { font-size: 14px; font-weight: 700; color: #a9ffcb; }
.fork-card .cons { font-size: 13px; color: #ffb4a8; }
.fork-card[aria-checked="true"] { transform: scale(1.02); box-shadow: inset 0 0 0 3px var(--brass-300), 0 0 28px rgba(247, 224, 155, 0.6); }
.fork-cards.picked .fork-card:not([aria-checked="true"]) { filter: brightness(0.55) saturate(0.6); }
.fork-card .check { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #2a1b05; background: var(--gold-face); opacity: 0; transform: scale(0.5); transition: 0.2s; }
.fork-card[aria-checked="true"] .check { opacity: 1; transform: none; }
.fork-elite { background-image: url("../assets/img/fork-elite.webp"), linear-gradient(160deg, #3a2a10, #0b281e 70%); }
.fork-steady { background-image: url("../assets/img/fork-steady.webp"), linear-gradient(160deg, #1f4a35, #0b281e 70%); }
.fork-overseas { background-image: url("../assets/img/fork-overseas.webp"), linear-gradient(160deg, #1d2c5a, #0b281e 70%); }
.fork-domestic { background-image: url("../assets/img/fork-domestic.webp"), linear-gradient(160deg, #2d5a2a, #0b281e 70%); }

/* ---------- 6. 現役続行判定 ---------- */
#scrPath { justify-content: center; align-items: center; }
.path-medal { position: relative; width: min(62cqw, 260px); aspect-ratio: 1; }
.path-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #fff4c8, #b8862f, #f7e09b, #8a6424, #fff1b8, #b8862f, #fff4c8); box-shadow: 0 0 40px rgba(247, 224, 155, 0.45); }
.path-medal.spin .path-ring { animation: spinRing 0.6s linear infinite; }
@keyframes spinRing { to { transform: rotate(360deg); } }
.path-face { position: absolute; inset: 9%; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 38% 28%, #1f5c42, #0b281e 70%); box-shadow: inset 0 0 0 2px #5a3d0c, inset 0 -10px 20px rgba(0, 0, 0, 0.6); text-align: center; }
.path-face span { font-family: var(--serif); font-weight: 900; font-size: clamp(30px, 6cqh, 46px); line-height: 1.15; background: var(--gold-face); -webkit-background-clip: text; background-clip: text; color: transparent; }
.path-reason { margin: 0; min-height: 3em; text-align: center; font-family: var(--serif); font-weight: 700; font-size: clamp(15px, 2.3cqh, 18px); color: var(--cream); }
#scrPath .cta { width: 100%; }

/* ---------- 7. 結果 ---------- */
#scrResult { padding-bottom: max(env(safe-area-inset-bottom), 16px); }
.res-inner { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.res-top { display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.res-retire { font-family: var(--serif); font-weight: 900; color: var(--brass-300); letter-spacing: 0.1em; }
.res-rating { margin-left: auto; margin-right: 8px; font-size: 12px; font-weight: 700; color: var(--cream-dim); white-space: nowrap; }
.res-rating b { font-family: var(--serif); font-size: 17px; font-weight: 900; color: var(--brass-200); margin-left: 2px; }
.res-new { font-size: 12px; font-weight: 900; color: #2a1b05; background: var(--gold-face); padding: 4px 10px; border-radius: 999px; animation: bump 0.6s ease; }
.card-wrap { position: relative; width: 100%; aspect-ratio: 1080 / 1350; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #1d5a40, #0b281e); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6); transform-style: preserve-3d; transition: transform 0.2s ease; }
.card-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.card-wrap.ready img { opacity: 1; }
.card-sheen { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; background: linear-gradient(115deg, rgba(255, 255, 255, 0) 35%, rgba(255, 248, 220, 0.38) 47%, rgba(255, 255, 255, 0) 58%); background-size: 260% 100%; animation: foil 3.2s ease-in-out infinite; }
.card-wrap[data-tier="ssr"] .card-sheen, .card-wrap[data-tier="ur"] .card-sheen { background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 120, 200, 0.3) 40%, rgba(255, 245, 160, 0.42) 47%, rgba(120, 220, 255, 0.3) 54%, rgba(255, 255, 255, 0) 64%); background-size: 260% 100%; }
@keyframes foil { 0% { background-position: 130% 0; } 60%, 100% { background-position: -130% 0; } }
.card-loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; color: var(--brass-300); }
.card-wrap.ready .card-loading { display: none; }
.afterlife { margin: 0; padding: 10px 14px; border-left: 3px solid var(--brass-500); background: rgba(3, 16, 10, 0.6); font-family: var(--serif); font-size: 15px; line-height: 1.6; color: var(--cream); }
.dl-banner { display: flex; align-items: center; gap: 12px; padding: 6px 8px; text-decoration: none; color: var(--cream); background: linear-gradient(135deg, rgba(31, 92, 66, 0.96), rgba(6, 26, 18, 0.97)); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); transition: transform 0.1s; }
.dl-banner:active { transform: scale(0.99); }
.dl-icon { width: 64px; height: 64px; flex: none; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 4px 10px rgba(0, 0, 0, 0.5); object-fit: cover; background: #0b281e; }
.dl-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dl-copy b { font-family: var(--serif); font-weight: 900; font-size: clamp(15px, min(2.3cqh, 4.3cqw), 18px); line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.dl-name { font-size: 13px; font-weight: 700; color: var(--brass-300); }
.dl-pills { display: flex; gap: 6px; }
.dl-pills i { font-style: normal; font-size: 11px; font-weight: 900; padding: 2px 10px; border-radius: 999px; color: #2a1b05; background: var(--gold-face); }
.dl-pills i + i { color: #fff; background: #111; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.android-note { margin: -6px 0 0; text-align: center; font-size: 12px; color: var(--cream-dim); }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-share, .btn-save { min-height: 52px; border-radius: 6px; font-weight: 900; font-size: 15px; }
.btn-share { color: #fff; background: linear-gradient(180deg, #222, #000); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 6px 14px rgba(0, 0, 0, 0.5); }
.btn-save { color: var(--brass-200); background: rgba(3, 16, 10, 0.75); box-shadow: inset 0 0 0 1px rgba(223, 184, 96, 0.7), 0 6px 14px rgba(0, 0, 0, 0.5); }
#scrResult .foot-links { margin-top: 0; }

/* ---------- 演出オーバーレイ ---------- */
.fx { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.ov { position: absolute; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.ov-flash { position: absolute; inset: 0; opacity: 0; background: #fff; }
.ov-flash.go { animation: flash 0.7s ease-out; }
.ov-flash.gold { background: radial-gradient(circle at 50% 45%, #fffbe6, #f7e09b 40%, rgba(223, 184, 96, 0) 80%); }
.ov-flash.rainbow { background: conic-gradient(from 0deg, #ff5f6d, #ffc371, #fff17a, #7dffb0, #5ec8ff, #a17bff, #ff7de9, #ff5f6d); }
.ov-flash.red { background: radial-gradient(circle, rgba(255, 90, 70, 0.9), rgba(120, 0, 0, 0)); }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.ov-black { position: absolute; inset: 0; background: #000; opacity: 0; }
.ov-black.on { opacity: 1; }
.ov-black.fade { transition: opacity 0.5s; }
.ov-crt { position: absolute; inset: 0; background: #000; opacity: 0; }
.ov-crt.on { opacity: 1; }
.ov-crt::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%) scaleX(0); background: #fff; box-shadow: 0 0 20px 6px rgba(255, 255, 255, 0.9); }
.ov-crt.line::after { animation: crtLine 0.42s ease-in forwards; }
@keyframes crtLine { 0% { transform: translateY(-50%) scaleX(1); opacity: 1; } 70% { transform: translateY(-50%) scaleX(0.02); opacity: 1; } 100% { transform: translateY(-50%) scaleX(0); opacity: 0; } }
.scr.crt-off { animation: crtOff 0.36s ease-in forwards; }
@keyframes crtOff { 0% { transform: none; filter: brightness(1); } 60% { transform: scaleY(0.006); filter: brightness(3); } 100% { transform: scale(0, 0.006); filter: brightness(4); } }

.cutin { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; }
.cutin.show { opacity: 1; }
.cutin-band {
  position: relative;
  width: 100%;
  height: 34cqh;
  transform: translateX(110%) skewY(-8deg);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 0 40px rgba(0, 0, 0, 0.8);
}
.cutin.show .cutin-band { animation: cutinIn 1.15s cubic-bezier(0.2, 0.9, 0.2, 1) forwards; }
@keyframes cutinIn { 0% { transform: translateX(110%) skewY(-8deg); } 18% { transform: translateX(0) skewY(-8deg); } 82% { transform: translateX(-2%) skewY(-8deg); } 100% { transform: translateX(-115%) skewY(-8deg); } }
.cutin-img { position: absolute; inset: 0; background-size: cover; background-position: center 30%; }
.cutin[data-tone="red"] .cutin-band { background: repeating-linear-gradient(100deg, #6a0c0c 0 18px, #8f1414 18px 36px); }
.cutin[data-tone="gold"] .cutin-band { background: repeating-linear-gradient(100deg, #5a3d0c 0 18px, #8a6424 18px 36px); }
.cutin[data-tone="rainbow"] .cutin-band { background: linear-gradient(100deg, #ff5f6d, #ffc371, #fff17a, #7dffb0, #5ec8ff, #a17bff, #ff7de9); }
.cutin[data-tone="red"] .cutin-img { background-image: url("../assets/img/cut-trainer.webp"), radial-gradient(circle at 30% 50%, rgba(255, 120, 90, 0.5), rgba(0, 0, 0, 0) 60%); }
.cutin[data-tone="gold"] .cutin-img { background-image: url("../assets/img/cut-jockey.webp"), radial-gradient(circle at 30% 50%, rgba(255, 230, 150, 0.55), rgba(0, 0, 0, 0) 60%); }
.cutin[data-tone="rainbow"] .cutin-img { background-image: url("../assets/img/cut-legend.webp"), radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.6), rgba(0, 0, 0, 0) 60%); }
.cutin-text { position: relative; z-index: 1; width: 100%; padding: 10px 16px 14px; background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75)); transform: skewY(8deg); }
.cutin-text small { display: block; font-size: 13px; font-weight: 900; color: var(--brass-300); letter-spacing: 0.2em; }
.cutin-text b { display: block; font-family: var(--serif); font-weight: 900; font-size: clamp(22px, min(5cqh, 8cqw), 40px); white-space: nowrap; color: #fff; text-shadow: 0 0 12px rgba(0, 0, 0, 0.9), 0 3px 0 #000; }

.banner { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; opacity: 0; }
.banner.show { opacity: 1; }
.banner-in { text-align: center; padding: 18px 10px; width: 100%; background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.72) 25%, rgba(0, 0, 0, 0.72) 75%, rgba(0, 0, 0, 0)); }
.banner.show .banner-in { animation: bannerIn 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.banner-in small { display: block; font-size: clamp(13px, 2cqh, 16px); font-weight: 900; letter-spacing: 0.3em; color: var(--brass-300); }
.banner-in b { display: block; font-family: var(--serif); font-weight: 900; font-size: min(clamp(40px, 8cqh, 68px), calc((100cqw - 28px) / var(--banner-text-em, 1))); white-space: nowrap; line-height: 1.1; background: var(--gold-face); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #3a2708) drop-shadow(0 0 24px rgba(247, 224, 155, 0.7)); }
.banner[data-tone="rainbow"] .banner-in b { background: linear-gradient(100deg, #ff5f6d, #ffc371, #fff17a, #7dffb0, #5ec8ff, #a17bff, #ff7de9, #ff5f6d); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; animation: rainbowSlide 1.4s linear infinite; filter: drop-shadow(0 4px 0 #1a1030) drop-shadow(0 0 24px rgba(255, 255, 255, 0.6)); }
.banner[data-tone="dark"] .banner-in b { background: linear-gradient(180deg, #e9e4d4, #8d958f); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 3px 0 #000); }
.banner-in span { display: block; margin-top: 4px; font-family: var(--serif); font-weight: 900; font-size: clamp(16px, 2.8cqh, 22px); color: var(--cream); word-break: keep-all; overflow-wrap: anywhere; }
.banner-in small { word-break: keep-all; overflow-wrap: anywhere; }
@keyframes bannerIn { 0% { transform: scale(2.2); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* 暗転中のキュイン×3: 全画面は暗いまま、中央のエンブレムだけを局所発光（WCAG 2.3.1 の閾値面積未満） */
.kyuin { position: absolute; left: 50%; top: 45%; width: 96px; height: 96px; margin: -48px 0 0 -48px; display: grid; place-items: center; opacity: 0; pointer-events: none; }
.kyuin img { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(247, 224, 155, 0.5)); }
.kyuin.on { opacity: 1; }
.kyuin.hit img { animation: kyuinHit 0.2s ease-out; }
@keyframes kyuinHit { 0% { transform: scale(1.14); filter: drop-shadow(0 0 14px rgba(255, 240, 200, 0.9)) brightness(1.3); } 100% { transform: none; filter: drop-shadow(0 0 6px rgba(247, 224, 155, 0.5)); } }
/* 縮小モーション時の静的強調: 盤面外周の枠だけを一定時間点灯（明滅させない） */
.emph { position: absolute; inset: 0; opacity: 0; pointer-events: none; box-shadow: inset 0 0 0 4px #fff4c8, inset 0 0 0 7px rgba(223, 184, 96, 0.55); }
.emph.on { opacity: 1; }
.emph[data-tone="rainbow"] { box-shadow: inset 0 0 0 4px #ffd1f2, inset 0 0 0 7px rgba(150, 210, 255, 0.6); }

/* ---------- シート（モーダル） ---------- */
.sheet { position: absolute; inset: 0; z-index: 70; display: flex; align-items: flex-end; background: rgba(0, 0, 0, 0.55); }
.sheet[hidden] { display: none; }
.sheet-panel { width: 100%; max-height: 88%; display: flex; flex-direction: column; background: linear-gradient(180deg, #164a35, #071d14); animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.2, 1); padding-bottom: env(safe-area-inset-bottom); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 8px; border-bottom: 1px solid rgba(223, 184, 96, 0.35); }
.sheet-head h2 { margin: 0; font-family: var(--serif); font-size: 19px; color: var(--brass-300); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 10px 4px 16px; font-size: 14px; line-height: 1.65; user-select: text; -webkit-user-select: text; }
.sheet-body h3 { margin: 16px 0 6px; font-family: var(--serif); font-size: 16px; color: var(--brass-300); border-left: 3px solid var(--brass-500); padding-left: 8px; }
.sheet-body h3:first-child { margin-top: 0; }
.sheet-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sheet-body th, .sheet-body td { padding: 6px 4px; border-bottom: 1px solid rgba(223, 184, 96, 0.2); text-align: left; vertical-align: top; }
.sheet-body td.num, .sheet-body th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet-body table.sim { table-layout: fixed; font-size: 12px; }
.sheet-body table.sim th, .sheet-body table.sim td { padding: 6px 3px; }
.sheet-body table.sim col.c-rate { width: 5.1em; }
.sheet-body table.sim col.c-heads { width: 5.8em; }
.sheet-body table.sim col.c-goal { width: 5.2em; }
.sheet-body table.sim td.range, .sheet-body table.sim th.range { white-space: normal; line-height: 1.3; }
.sheet-body table.sim th.num { white-space: normal; line-height: 1.3; }
.sheet-body table.sim td:first-child { word-break: keep-all; overflow-wrap: anywhere; }
.sheet-body .tag { display: inline-block; font-size: 10px; font-weight: 900; padding: 1px 6px; border-radius: 3px; margin-left: 4px; vertical-align: 1px; }
.sheet-body .tag.real { color: #062012; background: #9cf0c0; }
.sheet-body .tag.sim { color: #2a1b05; background: var(--brass-300); }
.sheet-body .tag.assume { color: #fff; background: #6c5ca8; }
.sheet-body a { color: var(--brass-300); }
.sheet-body .note { color: var(--cream-dim); font-size: 12px; }
.sheet-body ul { margin: 4px 0; padding-left: 1.2em; }
.save-img { width: 100%; height: auto; border-radius: 10px; -webkit-touch-callout: default; user-select: auto; }

.zk-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.zk-summary div { text-align: center; padding: 8px 4px; border-radius: 6px; background: rgba(3, 16, 10, 0.6); box-shadow: inset 0 0 0 1px rgba(223, 184, 96, 0.35); }
.zk-summary small { display: block; font-size: 11px; color: var(--brass-300); }
.zk-summary b { font-family: var(--serif); font-size: 20px; }
.zk-bar { height: 8px; border-radius: 4px; background: rgba(3, 16, 10, 0.8); overflow: hidden; margin-bottom: 8px; }
.zk-bar i { display: block; height: 100%; background: var(--gold-face); }
.zk-group h3 { display: flex; justify-content: space-between; }
.zk-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.zk-item { padding: 8px; border-radius: 6px; background: rgba(3, 16, 10, 0.55); box-shadow: inset 0 0 0 1px rgba(223, 184, 96, 0.2); }
.zk-item b { display: block; font-family: var(--serif); font-size: 14px; line-height: 1.3; }
.zk-item small { display: block; font-size: 11px; line-height: 1.4; color: var(--cream-dim); }
.zk-item .rate { color: var(--brass-300); }
.zk-item.got { box-shadow: inset 0 0 0 1px var(--brass-400); background: linear-gradient(180deg, rgba(223, 184, 96, 0.18), rgba(3, 16, 10, 0.55)); }
.zk-item.got b { color: var(--brass-200); }
.zk-item.lock b { color: rgba(246, 241, 227, 0.4); letter-spacing: 0.2em; }
.zk-item.ur.got { box-shadow: inset 0 0 0 1px #fff, 0 0 10px rgba(255, 140, 220, 0.4); }

/* ---------- ローカル専用 demo パネル ---------- */
.demo-toggle { position: fixed; left: 8px; bottom: 8px; z-index: 999; padding: 8px 12px; border-radius: 6px; font: 700 12px var(--sans); color: #000; background: #ffd36b; }
.demo-panel { position: fixed; left: 8px; bottom: 48px; z-index: 999; width: min(360px, calc(100vw - 16px)); max-height: 70vh; overflow-y: auto; padding: 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.92); color: #fff; font: 12px var(--sans); box-shadow: 0 0 0 1px #ffd36b; }
.demo-panel h4 { margin: 8px 0 4px; color: #ffd36b; font-size: 12px; }
.demo-panel button { margin: 2px; padding: 6px 8px; border-radius: 4px; background: #233; color: #fff; font-size: 12px; box-shadow: inset 0 0 0 1px #4a6; }
.demo-panel button:active { background: #4a6; }

/* ---------- 低身長端末（375×667 等） ---------- */
@container phone (max-height: 700px) {
  .t-logo-g1 { font-size: 50px; }
  .t-logo-main { font-size: 28px; }
  .t-catch { margin-top: 4px; }
  .lamps i { height: 6px; }
  .marquee { min-height: 40px; }
  .reel-name { font-size: 11px; }
  .gauge { height: 4px; }
  /* G1 画面: 実効高 611px（375×667 の X 内）でも「次へ」を下端の安全余白内に収める（4〜5段のラダー想定） */
  #scrRace { gap: 6px; }
  #scrRace .plate-head { height: 38px; }
  #scrRace .plate-head span { font-size: 20px; }
  .ladder { gap: 3px; }
  .ladder li { min-height: 26px; padding: 2px 8px; }
  #scrRace .race-now.frame, #scrRace .lf-track.frame, #scrDebut .lf-track.frame { border-width: 8px; border-image-width: 8px; }
  #scrRace .race-now { padding: 2px 6px; }
  #scrRace .race-emblem { width: 44px; height: 44px; }
  #scrRace .lf-head { padding-bottom: 2px; }
  #scrRace .lf-lanes { gap: 4px; }
  #scrRace .lane { height: 20px; }
  #scrRace .lane .runner { width: 22px; height: 15px; }
  #scrRace .race-result { min-height: 54px; }
  #scrRace .race-result .place { font-size: 40px; }
  #scrRace .cta-slim { min-height: 48px; }
}
#scrRace > *, #scrDebut > * { flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  /* 退場キーフレームに飛ばさず、カットイン帯を中央に静止表示（.show が外れたら消える） */
  .cutin.show .cutin-band { animation: none !important; transform: translateX(0) skewY(-8deg); }
  .ov-flash { display: none; }
  .kyuin.hit img { animation: none !important; }
  .scr.crt-off { animation: none !important; }
}
