/* ═══════════════════════════════════════════════════════════════════
   めい競艇予想 — 深い海の青 × 空色（イメージキャラ：青髪の長めのボブ）
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* 地の色（深い海の青） */
  --sea-0: #061640;
  --sea-1: #0a2159;
  --sea-2: #0e2b6e;
  --sea-3: #143583;
  --sea-4: #1b4299;

  /* 面（カード）と線 */
  --surface:   linear-gradient(180deg, rgba(31, 72, 160, 0.46), rgba(18, 46, 112, 0.46));
  --surface-2: rgba(10, 33, 89, 0.62);
  --line:      rgba(140, 196, 255, 0.18);
  --line-2:    rgba(140, 196, 255, 0.34);

  /* 空色（アクセント） */
  --sky:        #5ab8ff;
  --sky-bright: #aee0ff;
  --sky-deep:   #2f7df0;
  --glow:       rgba(90, 184, 255, 0.16);

  /* 文字 */
  --text:       #f2f7ff;
  --text-dim:   #bccdec;
  --text-faint: #86a0cb;

  /* 状態の色 */
  --gold:       #ffd166;
  --gold-soft:  rgba(255, 209, 102, 0.14);
  --coral:      #ff7f8e;
  --coral-soft: rgba(255, 127, 142, 0.14);
  --mint:       #62e3b7;
  --mint-soft:  rgba(98, 227, 183, 0.14);

  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px -24px rgba(0, 8, 30, 0.9);

  --round: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;

  /* 艇番の色（公式の枠色） */
  --boat1: #f7f8fb; --boat1-ink: #16213d;
  --boat2: #1c2233; --boat2-ink: #f7f8fb;
  --boat3: #e04a55; --boat3-ink: #ffffff;
  --boat4: #2f6fe8; --boat4-ink: #ffffff;
  --boat5: #f6d449; --boat5-ink: #1f2430;
  --boat6: #3fc27a; --boat6-ink: #0d1a14;

  /* 波の模様（data: URI なので CSP の img-src 'self' data: で読める） */
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 40 C150 8 300 72 450 40 S750 8 900 40 S1050 72 1200 40 V80 H0 Z' fill='%235ab8ff' fill-opacity='.10'/%3E%3Cpath d='M0 54 C170 30 330 78 500 54 S830 30 1000 54 S1120 70 1200 58 V80 H0 Z' fill='%235ab8ff' fill-opacity='.10'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--sea-1); }
[hidden] { display: none !important; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--sea-1);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

/* 背景は固定の層に描く（iOS は background-attachment: fixed が効かないため） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 88% -140px, rgba(90, 184, 255, 0.26), transparent 70%),
    radial-gradient(760px 520px at -12% 18%, rgba(56, 118, 255, 0.20), transparent 70%),
    radial-gradient(900px 600px at 50% 120%, rgba(40, 170, 255, 0.16), transparent 70%),
    linear-gradient(180deg, #0d2d74 0%, #0a2159 42%, #071a4a 100%);
}

a { color: inherit; text-decoration: none; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
button, input { font: inherit; color: inherit; }
strong { font-weight: 700; color: var(--text); }

:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 8px; }

/* ── 共通の飾り ───────────────────────────────────────────────── */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--round);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--sky);
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--sky));
}

/* ── イメージキャラ ───────────────────────────────────────────── */

/* 丸いアイコン（顔だけを切り出した mei-face.webp） */
.avatar {
  position: relative;
  display: inline-block;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #e6f4ff, #9fd0ff 62%, #5c9ff5);
  box-shadow: 0 0 0 2px rgba(174, 224, 255, 0.8), 0 8px 18px -8px rgba(0, 8, 30, 0.8);
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar--brand { width: 42px; height: 42px; }
.avatar--small { width: 36px; height: 36px; }
.avatar--large { width: 64px; height: 64px; }

/* ふきだし（下向きのしっぽ） */
.bubble {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 12px 18px;
  border-radius: 18px;
  background: #ffffff;
  color: #173069;
  font-family: var(--round);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 26px -14px rgba(0, 8, 30, 0.9);
}

/* キャラが話しかける 1 行（顔＋ふきだし） */
.talk {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.talk__bubble {
  position: relative;
  flex: 1;
  margin: 0;
  padding: 11px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: #173069;
  font-family: var(--round);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  box-shadow: 0 10px 24px -14px rgba(0, 8, 30, 0.9);
}
.talk__bubble::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  background: inherit;
  border-radius: 3px;
  transform: translateY(-50%) rotate(45deg);
}
.talk__bubble b { color: var(--sky-deep); }

/* ── 認証コードの画面 ─────────────────────────────────────────── */

.gate-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 20px 40px;
}
.gate-body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  height: 180px;
  background: var(--wave) bottom / 100% 100% no-repeat;
  pointer-events: none;
}

.gate {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/*
 * キャラがカードの上から顔を出す形。画像の下の端（まっすぐ切れている）はカードの裏に隠す。
 * 画像の左上は透明なので、ふきだしはそこに重ねる。
 */
.gate__hero {
  position: relative;
  z-index: 0;
  width: 100%;
  margin: 0 auto -62px;
}
.gate__mascot {
  display: block;
  width: 300px;
  max-width: 88%;
  height: auto;
  margin-left: auto;
  filter: drop-shadow(0 16px 24px rgba(0, 8, 30, 0.55));
}
.gate__bubble {
  position: absolute;
  left: 0;
  top: 8px;
  max-width: 190px;
  padding: 10px 14px;
  font-size: 13.5px;
  text-align: left;
  animation: pop .5s .2s ease both;
}
/* しっぽは右下（キャラの顔の方）へ向ける */
.gate__bubble::before {
  content: "";
  position: absolute;
  right: -7px;
  bottom: 14px;
  width: 16px;
  height: 16px;
  background: inherit;
  border-radius: 3px;
  transform: rotate(45deg);
}

.gate__card {
  position: relative;
  z-index: 1;
  padding: 30px 24px 24px;
  border: 1px solid var(--line-2);
  border-radius: 26px;
  background:
    radial-gradient(420px 200px at 50% 0%, rgba(90, 184, 255, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(24, 62, 148, 0.92), rgba(10, 33, 89, 0.94));
  box-shadow: var(--shadow), 0 30px 60px -30px rgba(0, 8, 30, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gate__title {
  margin: 0;
  font-family: var(--round);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.gate__sub {
  margin: 4px 0 18px;
  font-family: var(--round);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.36em;
  color: var(--sky);
}
.gate__lead { margin: 0 0 22px; color: var(--text-dim); font-size: 14px; }

.gate__form { display: grid; gap: 10px; text-align: left; }
.gate__label { font-family: var(--round); font-size: 12.5px; font-weight: 700; letter-spacing: 0.18em; color: var(--sky-bright); }

.gate__input,
.field__input {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(6, 22, 64, 0.72);
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0.14em;
  transition: border-color .2s, box-shadow .2s;
}
.gate__input:focus,
.field__input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px var(--glow); }

.gate__error,
.field__error {
  padding: 11px 14px;
  margin: 0 0 16px;
  border: 1px solid rgba(255, 127, 142, 0.45);
  border-radius: var(--radius-sm);
  background: var(--coral-soft);
  color: #ffd2d8;
  font-size: 14px;
  text-align: left;
}

.gate__note { margin-top: 20px; font-size: 12.5px; color: var(--text-faint); }

/* ── ボタン ───────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  font-family: var(--round);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform .15s, filter .2s, background .2s, border-color .2s, opacity .2s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary, .gate__button {
  background: linear-gradient(180deg, #7cc9ff 0%, #3d92f5 52%, #2a6fe0 100%);
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(10, 40, 110, 0.35);
  box-shadow: 0 12px 26px -12px rgba(61, 146, 245, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn--primary:hover:not(:disabled), .gate__button:hover { filter: brightness(1.07); }

.gate__button {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  font-family: var(--round);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.24em;
  cursor: pointer;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
  color: var(--sky-bright);
}
.btn--ghost:hover { border-color: var(--sky); background: var(--glow); }

.btn--big { width: 100%; min-height: 60px; font-size: 18px; letter-spacing: 0.14em; }
.btn--small { min-height: 38px; padding: 7px 16px; font-size: 13px; }

/* ── ヘッダー ─────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(8, 28, 76, 0.84);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
  padding: 12px 18px 8px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__text { min-width: 0; }
.brand__name {
  display: block;
  font-family: var(--round);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1.25;
  white-space: nowrap;
}
.brand__sub {
  display: block;
  font-family: var(--round);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--sky);
  white-space: nowrap;
}

.topbar__actions { display: flex; align-items: center; gap: 12px; flex: none; }
.clock {
  font-family: var(--round);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--sky-bright);
  letter-spacing: 0.06em;
}

.logout-form { margin: 0; }
.text-btn {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--round);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.text-btn:hover { border-color: var(--sky); color: var(--sky-bright); }

.tabs {
  display: flex;
  gap: 6px;
  max-width: 820px;
  margin: 0 auto;
  padding: 2px 12px 10px;
}
.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 4px;
  border-radius: 999px;
  text-align: center;
  font-family: var(--round);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  transition: color .2s, background .2s;
}
.tab:hover { color: var(--text-dim); background: rgba(255, 255, 255, 0.04); }
.tab.is-active {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(90, 184, 255, 0.34), rgba(47, 125, 240, 0.34));
  box-shadow: inset 0 0 0 1px rgba(174, 224, 255, 0.4);
}
.tab__lock { width: 12px; height: 12px; flex: none; opacity: .8; }

/* ── レイアウト ───────────────────────────────────────────────── */

.view {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 18px 56px;
  min-height: 62vh;
}

.section { margin-bottom: 38px; }

.section__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-family: var(--round);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.section__title::before {
  content: "";
  width: 6px;
  height: 20px;
  flex: none;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--sky-bright), var(--sky-deep));
}
.section__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

.section__lead { margin: 0 0 16px; font-size: 14px; color: var(--text-dim); }

.panel, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  font-size: 15px;
}
.panel--warn { border-color: rgba(255, 209, 102, 0.36); background: linear-gradient(180deg, rgba(80, 70, 30, 0.35), rgba(30, 40, 80, 0.45)); }
.panel__title { margin: 0 0 14px; font-family: var(--round); font-size: 18px; font-weight: 700; letter-spacing: 0.06em; }
.panel__note { margin: 14px 0 0; font-size: 14px; color: var(--text-dim); }

.fine { font-size: 12.5px; color: var(--text-faint); margin-top: 14px; }

.notice {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-dim);
}
.notice--warn { border-color: rgba(255, 209, 102, 0.42); background: linear-gradient(180deg, rgba(90, 74, 24, 0.42), rgba(34, 40, 70, 0.5)); color: #fbe8bd; }
.notice--warn strong { color: var(--gold); }

.alert {
  border: 1px solid rgba(255, 127, 142, 0.45);
  background: var(--coral-soft);
  border-radius: var(--radius);
  padding: 20px;
  color: #ffd4da;
}
.alert strong { display: block; font-family: var(--round); font-size: 17px; margin-bottom: 6px; color: #ffe4e8; }
.alert p { font-size: 14px; margin-bottom: 16px; }

.loading, .empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 15px;
  text-align: center;
}
.empty__icon { font-size: 34px; opacity: .8; }
/* 画像の下の端はまっすぐ切れているので、下をぼかして浮かせる */
.empty__mascot {
  width: 170px;
  height: auto;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 96%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 96%);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(140, 196, 255, 0.25);
  border-top-color: var(--sky);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner--inline { width: 13px; height: 13px; border-width: 2px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
.spinner--big { width: 44px; height: 44px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 今日／明日 ───────────────────────────────────────────────── */

.day-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.day-switch__btn {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-faint);
  font-family: var(--round);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: background .25s, color .25s;
}
.day-switch__btn.is-active {
  background: linear-gradient(180deg, #7cc9ff, #2f7df0);
  color: #ffffff;
  box-shadow: 0 8px 18px -10px rgba(61, 146, 245, 0.95);
}

/* ── つぎに始まるレース ───────────────────────────────────────── */

.next-race {
  display: block;
  position: relative;
  overflow: hidden;
  margin-bottom: 36px;
  padding: 24px 22px 22px;
  border: 1px solid var(--line-2);
  border-radius: 24px;
  background:
    radial-gradient(480px 220px at 100% 0%, rgba(90, 184, 255, 0.28), transparent 70%),
    linear-gradient(160deg, #1d4aa8, #0f2c74 70%);
  box-shadow: var(--shadow), 0 26px 50px -30px rgba(0, 8, 30, 0.95);
}
.next-race::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70px;
  background: var(--wave) bottom / 100% 100% no-repeat;
  opacity: .9;
  pointer-events: none;
}
.next-race > * { position: relative; z-index: 1; }

.next-race__label { margin-bottom: 8px; }

.next-race__place {
  font-family: var(--round);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.3;
}
.next-race__place em { font-style: normal; color: var(--sky-bright); font-size: 0.72em; margin-left: 6px; }

.next-race__time {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}
.next-race__time b { font-family: var(--round); font-size: 21px; color: var(--text); font-weight: 900; }

.next-race__remain {
  padding: 3px 12px;
  border: 1px solid rgba(255, 127, 142, 0.55);
  border-radius: 999px;
  background: var(--coral-soft);
  color: #ffc6cd;
  font-size: 13px;
  font-weight: 700;
}

.next-race__racers { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }

.next-race__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin-top: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #dcefff);
  color: #173a8a;
  font-family: var(--round);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.14em;
  box-shadow: 0 12px 26px -12px rgba(0, 8, 30, 0.9), inset 0 -2px 0 rgba(47, 125, 240, 0.2);
  transition: transform .2s;
}
.next-race:hover .next-race__cta { transform: translateY(-1px); }

.mini-racer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 4px;
  border: 1px solid rgba(174, 224, 255, 0.14);
  border-radius: 999px;
  background: rgba(6, 22, 64, 0.35);
  font-size: 13px;
  color: var(--text-dim);
}
.mini-racer .boat { width: 22px; height: 22px; font-size: 12px; border-radius: 50%; }

/* ── レース一覧 ───────────────────────────────────────────────── */

.race-list { display: grid; gap: 10px; }

.race-card {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s, transform .2s, background .2s;
}
.race-card:hover { border-color: var(--line-2); transform: translateY(-1px); }

.race-card__left { text-align: center; border-right: 1px solid var(--line); padding-right: 14px; }
.race-card__time { font-family: var(--round); font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; }
.race-card__timelabel { font-size: 10.5px; letter-spacing: 0.2em; color: var(--text-faint); }

.race-card__place { font-family: var(--round); font-size: 18px; font-weight: 700; letter-spacing: 0.06em; }
.race-card__place em { font-style: normal; color: var(--sky); font-size: 14.5px; margin-left: 4px; }
.race-card__remain { font-size: 13.5px; color: var(--text-dim); }
.race-card__remain.is-urgent { color: var(--coral); font-weight: 700; }

.race-card__go {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--glow);
  font-family: var(--round);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--sky-bright);
  white-space: nowrap;
}

/* ── 競艇場の絞り込み ─────────────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--round);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.is-active { border-color: var(--sky); background: var(--glow); color: #ffffff; }

/* ── 艇番 ─────────────────────────────────────────────────────── */

.boat {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-family: var(--round);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  flex: none;
  /* 青い地でも 4 号艇（青）・2 号艇（黒）が見分けられるよう、白いふちを付ける */
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.16), 0 2px 8px -3px rgba(0, 8, 30, 0.7);
}
.boat--1 { background: var(--boat1); color: var(--boat1-ink); }
.boat--2 { background: var(--boat2); color: var(--boat2-ink); }
.boat--3 { background: var(--boat3); color: var(--boat3-ink); }
.boat--4 { background: var(--boat4); color: var(--boat4-ink); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 8px -3px rgba(0, 8, 30, 0.7); }
.boat--5 { background: var(--boat5); color: var(--boat5-ink); }
.boat--6 { background: var(--boat6); color: var(--boat6-ink); }

/* ── レース画面 ───────────────────────────────────────────────── */

.back-link { display: inline-flex; gap: 6px; font-family: var(--round); font-size: 13.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 16px; }
.back-link:hover { color: var(--sky-bright); }

.race-header { margin-bottom: 22px; }
.race-header__place { font-family: var(--round); font-size: 30px; font-weight: 900; letter-spacing: 0.06em; line-height: 1.3; }
.race-header__place em { font-style: normal; color: var(--sky-bright); font-size: 0.7em; margin-left: 6px; }
.race-header__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.race-header__racers { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.race-header__note {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-left: 3px solid var(--sky);
  font-size: 13.5px;
  color: var(--text-dim);
}

.pill {
  padding: 4px 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  white-space: nowrap;
}
.pill--time { border-color: rgba(255, 127, 142, 0.55); background: var(--coral-soft); color: #ffc6cd; }
.pill--gold { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }
.pill--hit { border-color: rgba(98, 227, 183, 0.6); background: var(--mint-soft); color: #b7f4dd; font-weight: 700; }
.pill--miss { color: var(--text-faint); }
.pill--small { padding: 2px 10px; font-size: 11.5px; }

/* 分析ボタン */

.start-panel {
  margin-bottom: 28px;
  padding: 26px 22px;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background:
    radial-gradient(420px 200px at 50% 0%, rgba(90, 184, 255, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(31, 72, 160, 0.6), rgba(12, 36, 96, 0.6));
  text-align: center;
  box-shadow: var(--shadow);
}
.start-panel__lead { font-size: 14.5px; color: var(--text-dim); margin-bottom: 20px; }
.start-panel__note { font-size: 12.5px; color: var(--text-faint); margin-top: 14px; }
.start-panel .talk { justify-content: center; text-align: left; margin-bottom: 18px; }
.start-panel .talk__bubble { flex: 0 1 auto; }

.progress { display: grid; justify-items: center; gap: 14px; padding: 6px 0; }
.progress .avatar { animation: bob 1.6s ease-in-out infinite; }
.progress__text { margin: 0; font-family: var(--round); font-size: 15px; font-weight: 700; letter-spacing: 0.04em; color: var(--text-dim); }
.progress__bar { width: 100%; max-width: 320px; height: 6px; border-radius: 999px; background: rgba(6, 22, 64, 0.6); overflow: hidden; }
.progress__fill { height: 100%; width: 16%; border-radius: 999px; background: linear-gradient(90deg, var(--sky-deep), var(--sky-bright)); transition: width .9s ease; }

.done-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14.5px;
  color: var(--text-dim);
}
.done-bar__check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mint-soft);
  border: 1px solid var(--mint);
  color: var(--mint);
  font-weight: 700;
}

/* ── AI の解説 ────────────────────────────────────────────────── */

.ai-box {
  position: relative;
  margin-bottom: 34px;
  padding: 24px 22px 22px;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(90, 184, 255, 0.2), transparent 70%),
    linear-gradient(170deg, rgba(31, 72, 160, 0.66), rgba(10, 33, 89, 0.66) 75%);
  box-shadow: var(--shadow);
}
.ai-box__top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ai-box__label { margin: 0; line-height: 1.4; }
.ai-box__label::before { display: none; }
.ai-box__who { font-family: var(--round); font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--sky-bright); }
.ai-box__headline {
  margin: 0 0 12px;
  font-family: var(--round);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.55;
}
.ai-box__summary { font-size: 15px; color: #dce7fb; margin: 0; }

.marks { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 660px) { .marks { grid-template-columns: repeat(3, 1fr); } }

.mark {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(6, 22, 64, 0.45);
}
.mark__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mark__role { font-family: var(--round); font-size: 14.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--sky-bright); }
.mark__reason { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--text-dim); }

.ai-box__row { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ai-box__rowlabel { display: block; margin-bottom: 4px; font-family: var(--round); font-size: 12px; font-weight: 700; letter-spacing: 0.18em; color: var(--sky); }
.ai-box__row p { margin: 0; font-size: 14.5px; color: var(--text-dim); }

/* ── おすすめの組み合わせ ─────────────────────────────────────── */

.coverage {
  display: grid;
  gap: 2px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(174, 224, 255, 0.5);
  border-radius: var(--radius);
  background:
    radial-gradient(360px 140px at 100% 0%, rgba(174, 224, 255, 0.24), transparent 70%),
    linear-gradient(180deg, #2358c4, #163b8f);
  box-shadow: var(--shadow);
}
.coverage__label { font-family: var(--round); font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em; color: var(--sky-bright); }
.coverage__value { font-family: var(--round); font-size: 28px; font-weight: 900; letter-spacing: 0.04em; line-height: 1.4; }
.coverage__value small { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--text-dim); margin-left: 6px; white-space: nowrap; }
.coverage__note { font-size: 12.5px; color: var(--text-dim); }

.picks { display: grid; gap: 10px; }

.pick {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.pick--best { border-color: var(--sky); box-shadow: 0 0 0 1px rgba(90, 184, 255, 0.25), var(--shadow); }

.pick__rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  font-family: var(--round);
  font-size: 16px;
  font-weight: 900;
  color: var(--sky-bright);
}
.pick--best .pick__rank {
  border: 0;
  background: linear-gradient(180deg, #7cc9ff, #2f7df0);
  color: #ffffff;
}

.combo { display: inline-flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; }
.combo__cell { display: grid; justify-items: center; gap: 4px; min-width: 40px; }
.combo__rank { font-size: 10px; letter-spacing: 0.14em; color: var(--text-faint); }
.combo__arrow { padding-bottom: 22px; color: var(--sky); font-size: 13px; }
.combo__name {
  max-width: 4.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-dim);
}

.pick__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.fact { font-size: 13px; color: var(--text-faint); }
.fact b { font-family: var(--round); font-size: 15px; font-weight: 900; color: var(--text); }
.fact small { font-size: 11px; }

/* ── 選手の強さ ───────────────────────────────────────────────── */

.strength { display: grid; gap: 16px; }
.strength__row { display: grid; grid-template-columns: 32px 1fr 70px; align-items: center; gap: 14px; }
.strength__name { font-size: 15.5px; font-weight: 600; }
.strength__bar { height: 6px; margin: 6px 0 4px; border-radius: 999px; background: rgba(6, 22, 64, 0.6); overflow: hidden; }
.strength__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sky-deep), var(--sky-bright)); }
.strength__sub { font-size: 12px; color: var(--text-faint); }
.strength__value { text-align: right; font-family: var(--round); font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.strength__value small { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; color: var(--text-faint); }
.strength__row--out { opacity: 0.5; }

/* ── 選手のくわしい情報 ───────────────────────────────────────── */

.racers { display: grid; gap: 10px; }
.racer {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.racer__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.racer__name { font-family: var(--round); font-size: 18px; font-weight: 700; letter-spacing: 0.06em; }
.racer__rank { font-size: 12px; color: var(--text-faint); letter-spacing: 0.06em; }

.racer__facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 580px) { .racer__facts { grid-template-columns: repeat(4, 1fr); } }

.racer__fact { padding: 10px 12px; border: 1px solid rgba(174, 224, 255, 0.1); border-radius: var(--radius-sm); background: rgba(6, 22, 64, 0.42); }
.racer__factlabel { display: block; font-size: 11px; letter-spacing: 0.06em; color: var(--text-faint); }
.racer__factvalue { display: block; font-family: var(--round); font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.4; }
.racer__factnote { display: block; font-size: 11.5px; color: var(--sky); }

/* ── 予想の記録 ───────────────────────────────────────────────── */

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 660px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

.kpi {
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.kpi__label { font-size: 12px; letter-spacing: 0.06em; color: var(--text-faint); }
.kpi__value { font-family: var(--round); font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.3; }
.kpi__value small { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--text-dim); margin-left: 3px; }
.kpi--hit { border-color: rgba(255, 209, 102, 0.55); background: linear-gradient(170deg, rgba(120, 96, 30, 0.45), rgba(24, 48, 110, 0.5)); }
.kpi--hit .kpi__value { color: var(--gold); }

.verify-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(31, 72, 160, 0.6), rgba(12, 36, 96, 0.6));
}
.verify-panel__title { font-family: var(--round); font-size: 18px; font-weight: 700; letter-spacing: 0.04em; }
.verify-panel__note { margin: 4px 0 0; font-size: 14px; color: var(--text-dim); }
.verify-panel__note b { color: var(--sky-bright); }

.verify-done {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(98, 227, 183, 0.5);
  border-radius: var(--radius);
  background: var(--mint-soft);
}
.verify-done__title { font-family: var(--round); font-size: 17px; font-weight: 700; }
.verify-done__hits { margin-bottom: 10px; font-size: 14px; color: var(--text-dim); }
.verify-done__hits b { color: var(--mint); font-size: 16px; }

.verify-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13.5px;
  color: var(--text-dim);
}
.is-hit-text { color: var(--gold); font-weight: 700; }
.is-miss-text { color: var(--text-faint); }

.records { display: grid; gap: 12px; }
.record-filter { margin-bottom: 16px; }
.chip__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  color: var(--text-dim);
}
.chip--hit { border-color: rgba(255, 209, 102, 0.6); color: #ffe3a3; }
.chip.is-active .chip__count { background: rgba(90, 184, 255, 0.3); color: #ffffff; }

.record {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* はずれ・不成立は控えめに */
.record--miss, .record--void { opacity: 0.75; }
.record--miss .record__place, .record--void .record__place { color: var(--text-dim); }

/* 当たり：金のふちと「的中」の印で、ひと目でわかるように */
.record--hit {
  border: 1px solid transparent;
  background:
    linear-gradient(170deg, #2a4a9a, #183a86 55%, #12306f) padding-box,
    linear-gradient(135deg, #ffe7a8, #e8b24a 40%, #ffe7a8 70%, #c98f2c) border-box;
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.14), 0 22px 44px -26px rgba(255, 209, 102, 0.55);
}
.record--hit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(360px 160px at 100% 0%, rgba(255, 231, 168, 0.18), transparent 70%);
  pointer-events: none;
}

.record__stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 2px solid #ff5a67;
  border-radius: 50%;
  color: #ff6b77;
  font-family: var(--round);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.06em;
  transform: rotate(-12deg);
  box-shadow: inset 0 0 0 3px rgba(255, 90, 103, 0.2);
  background: rgba(255, 255, 255, 0.92);
}

.record__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.record--hit .record__head { padding-right: 70px; }
.record__place { font-family: var(--round); font-size: 18px; font-weight: 700; letter-spacing: 0.04em; }
.record__date { font-size: 12px; color: var(--text-faint); letter-spacing: 0.04em; }
.record__headline { margin-top: 10px; font-size: 14px; color: var(--text-dim); }
.record__warn {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--sky-bright);
}

.record__win {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 231, 168, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(6, 22, 64, 0.4);
}
.record__win-payout { text-align: right; }
.record__win-label { display: block; font-size: 11.5px; letter-spacing: 0.1em; color: var(--gold); }
.record__win-amount {
  display: block;
  font-family: var(--round);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.15;
  background: linear-gradient(180deg, #fff6d6, #ffc94d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.record__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.record__label { width: 100%; font-size: 11.5px; letter-spacing: 0.08em; color: var(--text-faint); }
.record__actual { font-family: var(--round); font-size: 17px; font-weight: 700; }
.record__actual small { font-family: var(--sans); font-size: 11px; font-weight: 500; color: var(--text-faint); }
.record__combos { display: flex; flex-wrap: wrap; gap: 6px; }

.combo-mini {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 22, 64, 0.42);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.combo-mini.is-hit { border-color: var(--gold); background: var(--gold-soft); color: #fff1c9; font-weight: 800; }

/* ── 予想のしくみ ─────────────────────────────────────────────── */

.about-hero {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 30px;
  padding: 20px 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(90, 184, 255, 0.22), transparent 70%),
    var(--surface);
  overflow: hidden;
}
/* 画像の下の端は、カードの下のふちで切って隠す */
.about-hero__mascot { order: 2; width: 190px; height: auto; flex: none; margin: 0 -10px -46px 0; }
.about-hero__body { flex: 1; padding-bottom: 20px; }
.about-hero__title { margin: 4px 0 8px; font-family: var(--round); font-size: 22px; font-weight: 900; letter-spacing: 0.06em; }
.about-hero__body p { font-size: 14.5px; color: var(--text-dim); }

.steps { display: grid; gap: 10px; }
.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.step__no {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #7cc9ff, #2f7df0);
  font-family: var(--round);
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
}
.step__title { margin-bottom: 4px; font-family: var(--round); font-size: 17px; font-weight: 700; letter-spacing: 0.04em; }
.step p { margin: 0; font-size: 14.5px; color: var(--text-dim); }

.glossary { margin: 0; }
.glossary dt { margin-top: 18px; font-family: var(--round); font-size: 16px; font-weight: 700; letter-spacing: 0.04em; color: var(--sky-bright); }
.glossary dt:first-child { margin-top: 0; }
.glossary dd { margin: 4px 0 0; font-size: 14.5px; color: var(--text-dim); }

.factors { display: grid; gap: 8px; }
.factor {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 12px 14px;
  border: 1px solid rgba(174, 224, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(6, 22, 64, 0.42);
}
.factor__name { font-family: var(--round); font-weight: 700; font-size: 15px; }
.factor__desc { grid-column: 1 / -1; font-size: 13.5px; color: var(--text-dim); }

.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 22, 64, 0.42);
  font-size: 14px;
  color: var(--text-dim);
}
.level-chip small { font-size: 11px; letter-spacing: 0.06em; color: var(--text-faint); }
.level-chip--4 { border-color: var(--sky); background: var(--glow); color: #ffffff; font-weight: 700; }
.level-chip--4 small { color: var(--sky-bright); }
.level-chip--3 { border-color: var(--line-2); color: var(--text); }
.level-chip--3 small { color: var(--sky); }

/* アクセスコードの入力（予想のしくみ） */

.lock {
  display: grid;
  justify-items: center;
  max-width: 420px;
  margin: 8px auto 20px;
  text-align: center;
}
/* 認証コードの画面と同じく、キャラがカードの上から顔を出す形 */
.lock__hero { position: relative; z-index: 0; width: 100%; margin-bottom: -56px; }
.lock__mascot {
  display: block;
  width: 270px;
  max-width: 84%;
  height: auto;
  margin-left: auto;
  filter: drop-shadow(0 14px 22px rgba(0, 8, 30, 0.55));
}
.lock__bubble {
  position: absolute;
  left: 0;
  top: 6px;
  max-width: 190px;
  padding: 10px 14px;
  font-size: 13px;
  text-align: left;
  animation: pop .45s .15s ease both;
}
.lock__bubble::before {
  content: "";
  position: absolute;
  right: -7px;
  bottom: 14px;
  width: 16px;
  height: 16px;
  background: inherit;
  border-radius: 3px;
  transform: rotate(45deg);
}
.lock__card {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 26px 22px 22px;
  border: 1px solid var(--line-2);
  border-radius: 24px;
  background:
    radial-gradient(380px 180px at 50% 0%, rgba(90, 184, 255, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(24, 62, 148, 0.92), rgba(10, 33, 89, 0.94));
  box-shadow: var(--shadow), 0 30px 60px -30px rgba(0, 8, 30, 0.9);
}
.lock__icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--glow);
  color: var(--sky-bright);
}
.lock__icon svg { width: 18px; height: 18px; }
.lock__title { margin: 0 0 4px; font-family: var(--round); font-size: 21px; font-weight: 900; letter-spacing: 0.08em; }
.lock__lead { margin: 0 0 18px; font-size: 14px; color: var(--text-dim); }
.lock__form { display: grid; gap: 10px; text-align: left; }
.lock__form .btn { margin-top: 6px; }
.field__label { font-family: var(--round); font-size: 12.5px; font-weight: 700; letter-spacing: 0.18em; color: var(--sky-bright); }
.field__error { margin: 4px 0 0; }
.lock__note { margin-top: 16px; font-size: 12.5px; color: var(--text-faint); }

/* ── 記録のリセット ───────────────────────────────────────────── */

.reset-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 127, 142, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 127, 142, 0.05);
}
.reset-panel__title { font-family: var(--round); font-size: 16px; font-weight: 700; letter-spacing: 0.04em; }
.reset-panel__note { margin: 2px 0 0; font-size: 13px; color: var(--text-faint); }

.btn--danger { background: transparent; border: 1px solid rgba(255, 127, 142, 0.6); color: #ffc0c8; }
.btn--danger:hover:not(:disabled) { background: var(--coral-soft); border-color: var(--coral); }
.btn--danger-solid { background: linear-gradient(180deg, #ff8f9c, #e0515f); color: #fff; }
.btn--danger-solid:hover { filter: brightness(1.06); }

/* ── 確認の画面 ───────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 12, 36, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
.modal__box {
  width: 100%;
  max-width: 400px;
  padding: 24px 22px 20px;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: linear-gradient(175deg, #1c4296, #0d2a6c);
  box-shadow: 0 30px 60px -20px rgba(0, 8, 30, 0.9);
  animation: rise .22s ease;
}
.modal__title { margin: 0 0 10px; font-family: var(--round); font-size: 19px; font-weight: 900; letter-spacing: 0.04em; }
.modal__message { margin: 0 0 22px; font-size: 14.5px; color: var(--text-dim); }
.modal__message b { color: var(--text); }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal__actions .btn { flex: 1; min-width: 120px; padding: 12px 14px; letter-spacing: 0.04em; white-space: nowrap; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.96); } }
@keyframes bob { 50% { transform: translateY(-5px); } }

/* ── フッター ─────────────────────────────────────────────────── */

.footer {
  position: relative;
  padding: 64px 18px calc(36px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  background: linear-gradient(180deg, transparent, rgba(4, 14, 42, 0.55) 60%);
}
.footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 56px;
  background: var(--wave) bottom / 100% 100% no-repeat;
}
.footer__brand { margin-bottom: 10px; font-family: var(--round); font-size: 15px; font-weight: 900; letter-spacing: 0.2em; color: var(--sky-bright); }
.footer p { margin: 0 0 6px; }
.footer__note { max-width: 620px; margin: 0 auto; line-height: 1.9; }

/* ── 小さな画面 ───────────────────────────────────────────────── */

@media (max-width: 520px) {
  .gate__bubble, .lock__bubble { max-width: 160px; font-size: 12.5px; }
  .about-hero { flex-direction: column; align-items: stretch; padding-right: 20px; }
  .about-hero__mascot { order: 2; width: 180px; align-self: flex-end; margin: -28px -20px -44px 0; }
}

@media (max-width: 400px) {
  .brand__name { font-size: 17px; }
  .brand__sub { display: none; }
  .tab { font-size: 13px; letter-spacing: 0.02em; }
  .next-race__place { font-size: 28px; }
  .race-card { grid-template-columns: 68px 1fr auto; gap: 12px; padding: 14px; }
}

@media (max-width: 360px) {
  .clock { display: none; }
  .eyebrow { letter-spacing: 0.16em; font-size: 10px; }
  .record__stamp { width: 50px; height: 50px; font-size: 15px; top: 12px; right: 12px; }
  .record--hit .record__head { padding-right: 56px; }
  .record__win-amount { font-size: 26px; }
  .view { padding-left: 14px; padding-right: 14px; }
  .tab__lock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
