/* イヤすぎチキンレース - Iyasugi Chicken Race */

:root {
  --cream: #fff4d6;
  --cream2: #ffeab0;
  --paper: #fffaf0;
  --ink: #2a1f1a;
  --ink-dim: #6b5a4d;
  --yellow: #ffd23f;
  --red: #ff4b3e;
  --green: #8bc34a;
  --blue: #3d6fd8;
  --purple: #6c4ab6;
  --stripe: repeating-linear-gradient(-45deg, var(--yellow) 0 12px, var(--ink) 12px 24px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  background:
    repeating-conic-gradient(from 0deg at 50% 12%, rgba(255, 210, 63, 0.18) 0deg 6deg, transparent 6deg 18deg),
    var(--cream);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

.hidden { display: none !important; }

button {
  font-family: inherit;
  touch-action: manipulation;
  color: inherit;
}

#app {
  min-height: calc(100vh - var(--sgh-top, 0px) - var(--ad-space, 0px));
  min-height: calc(100dvh - var(--sgh-top, 0px) - var(--ad-space, 0px));
  display: flex;
  flex-direction: column;
  padding: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: none;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.icon-btn:focus-visible, .btn:focus-visible, .start-btn:focus-visible, .zukan-btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* ===================== ホーム ===================== */

#screen-home {
  flex: 1;
  width: min(580px, 100%);
  margin: 0 auto;
  padding: 14px 16px 8px;
  display: flex;
  flex-direction: column;
}

#home-head {
  position: relative;
  text-align: center;
  padding: 10px 0 14px;
}

#home-head-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-height: 40px;
}

#logo-kicker {
  display: inline-block;
  margin: 6px 0 0;
  padding: 4px 12px;
  background: var(--ink);
  color: var(--yellow);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  transform: rotate(-2deg);
}

#logo {
  margin: 8px 0 6px;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 0.02em;
}
#logo span { display: block; }
.logo-a {
  font-size: clamp(30px, 9vw, 46px);
  color: var(--red);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-3deg);
}
.logo-b {
  font-size: clamp(38px, 12vw, 62px);
  color: var(--yellow);
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink);
}

#tagline {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--ink);
}
#tagline b { background: linear-gradient(transparent 58%, var(--yellow) 58%); }

#home-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 10px;
}

.mode-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 14px 14px 16px;
}
.mode-main {
  position: relative;
  overflow: hidden;
  padding-top: 22px;
}
.mode-main::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 10px;
  background: var(--stripe);
}

.mode-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.mode-emoji {
  font-size: 34px;
  line-height: 1;
  flex: none;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream2);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
}
.mode-name {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 900;
}
.mode-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.mode-desc b { color: var(--ink); }

.start-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 14px 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  text-shadow: 2px 2px 0 rgba(42, 31, 26, 0.55);
}
.start-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.best-chip {
  font-size: 12px;
  font-weight: 700;
  text-shadow: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
}

/* 図鑑 */
.zukan {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 520px) {
  .zukan { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.zukan-btn {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px 9px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  text-align: center;
}
.zukan-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.zukan-emoji { font-size: 30px; line-height: 1.1; }
.zukan-name { font-size: 12.5px; font-weight: 800; line-height: 1.35; }
.zukan-rec { font-size: 11px; color: var(--ink-dim); line-height: 1.4; }
.zukan-rec b { color: var(--red); }

.howto {
  margin: 8px 0 0;
  padding-left: 1.4em;
  font-size: 13.5px;
  line-height: 1.7;
}
.howto li { margin-bottom: 4px; }
.howto b { background: linear-gradient(transparent 60%, var(--yellow) 60%); }
.howto-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-dim); }

#footer {
  margin-top: auto;
  padding: 18px 0 14px;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-dim);
}
#footer a { color: var(--ink); }

/* ===================== ゲーム画面 ===================== */

#screen-game {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--sgh-top, 0px) - var(--ad-space, 0px));
  height: calc(100dvh - var(--sgh-top, 0px) - var(--ad-space, 0px));
  min-height: 320px;
  padding: 8px 10px 6px;
  gap: 6px;
}

#game-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
#hud-round {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
#hud-round-no {
  flex: none;
  font-weight: 900;
  font-size: 15px;
  background: var(--ink);
  color: var(--yellow);
  padding: 2px 8px;
  border-radius: 6px;
}
#hud-round-name {
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
#hud-lives { font-size: 16px; letter-spacing: 1px; line-height: 1; white-space: nowrap; }
#hud-lives .life-off { filter: grayscale(1); opacity: 0.35; }
#hud-lives.hit { animation: lives-shake 0.5s; }
@keyframes lives-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
#hud-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.hud-label { font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em; color: var(--ink-dim); }
#hud-score-val { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }

/* 距離メーター */
#meter {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 4px 12px 4px 14px;
  box-shadow: 3px 3px 0 var(--ink);
}
#meter-read {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 3px;
  min-width: 8.6em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.meter-pre { font-size: 14px; }
#meter-val {
  font-size: 34px;
  line-height: 1.1;
  min-width: 2.8em;
  text-align: right;
  color: var(--ink);
}
.meter-unit { font-size: 15px; }
#meter.near #meter-val { color: #e0631b; }
#meter.danger #meter-val { color: var(--red); }
#meter.danger { animation: meter-pulse 0.32s infinite alternate; }
#meter.frozen { background: #fff7cf; }
@keyframes meter-pulse {
  from { box-shadow: 3px 3px 0 var(--ink); }
  to { box-shadow: 3px 3px 0 var(--ink), 0 0 0 4px rgba(255, 75, 62, 0.35); }
}
#meter-bar {
  position: relative;
  flex: 1;
  height: 16px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
#meter-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #9ad35a, var(--yellow) 70%, var(--red));
  transform-origin: left;
}
#meter-danger {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8%;
  background: var(--stripe);
  opacity: 0.85;
}

/* ステージ */
#stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 3px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: #2b2440;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
  outline: none;
}
#stage:focus-visible { box-shadow: 0 0 0 3px var(--blue); }
#cv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#intro {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: linear-gradient(rgba(42, 31, 26, 0.34), rgba(42, 31, 26, 0.08) 70%);
  pointer-events: none;
  padding: 12px 14px;
}
#intro-box {
  width: min(340px, 100%);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 14px 14px 16px;
  text-align: center;
  animation: pop-in 0.32s cubic-bezier(0.2, 1.4, 0.4, 1);
  position: relative;
  overflow: hidden;
}
#intro-box::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: var(--stripe);
}
#intro-round { font-size: 13px; font-weight: 900; letter-spacing: 0.16em; color: var(--red); margin-top: 4px; }
#intro-emoji { font-size: 46px; line-height: 1.15; margin: 2px 0; }
#intro-name { font-size: 21px; font-weight: 900; line-height: 1.3; }
#intro-flavor { font-size: 13px; color: var(--ink-dim); margin-top: 4px; line-height: 1.5; }
#intro-hint {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--yellow);
  font-weight: 900;
  font-size: 15px;
  animation: hint-blink 1.1s ease-in-out infinite;
}
.hold-icon { display: inline-block; animation: hold-press 1.1s ease-in-out infinite; }
@keyframes hold-press {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(2px) scale(0.92); }
}
@keyframes hint-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}
@keyframes pop-in {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: none; opacity: 1; }
}

#verdict {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  width: min(320px, calc(100% - 20px));
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 8px 12px 10px;
  text-align: center;
  pointer-events: none;
  animation: pop-in 0.26s cubic-bezier(0.2, 1.5, 0.4, 1);
}
#verdict-label { font-size: 24px; font-weight: 900; line-height: 1.25; }
#verdict-dist { font-size: 13.5px; font-weight: 700; color: var(--ink-dim); }
#verdict-pts { font-size: 28px; font-weight: 900; color: var(--red); line-height: 1.15; font-variant-numeric: tabular-nums; }
#verdict-note { font-size: 12px; color: var(--ink-dim); line-height: 1.5; margin-top: 2px; }
#verdict-note:empty { display: none; }
#verdict.v-god #verdict-label { color: #d12b8f; }
#verdict.v-great #verdict-label { color: var(--red); }
#verdict.v-good #verdict-label { color: #e0631b; }
#verdict.v-meh #verdict-label { color: var(--ink-dim); }
#verdict.v-chicken #verdict-label { color: #c08a00; }
#verdict.v-hit { background: #ffe1dc; }
#verdict.v-hit #verdict-label { color: var(--red); }
#verdict.v-hit #verdict-pts { color: var(--ink-dim); }
#verdict.v-endure { background: #fff3a8; }
#verdict.v-endure #verdict-label { color: #1f8a3b; }

#fx-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 40%;
  text-align: center;
  font-size: clamp(34px, 11vw, 64px);
  font-weight: 900;
  color: #fff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}
#fx-text.show { animation: fx-pop 1.1s ease-out forwards; }
@keyframes fx-pop {
  0% { opacity: 0; transform: scale(2.2) rotate(-6deg); }
  14% { opacity: 1; transform: scale(0.94) rotate(-4deg); }
  22% { transform: scale(1.04) rotate(-4deg); }
  75% { opacity: 1; transform: scale(1) rotate(-4deg); }
  100% { opacity: 0; transform: scale(1.08) rotate(-4deg) translateY(-10px); }
}

#hint {
  flex: none;
  text-align: center;
  font-size: 13.5px;
  font-weight: 800;
  min-height: 1.6em;
  line-height: 1.6;
  color: var(--ink);
}
#hint.next { color: var(--red); animation: hint-blink 0.9s ease-in-out infinite; }

/* ===================== 結果 ===================== */

#result-overlay, #howto-overlay {
  position: fixed;
  inset: 0;
  top: var(--sgh-top, 0px);
  bottom: var(--ad-space, 0px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(42, 31, 26, 0.55);
  overflow-y: auto;
}
#result-box, #howto-box {
  width: min(420px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 16px 16px 18px;
  text-align: center;
  animation: pop-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
  position: relative;
}
#result-box::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 9px;
  background: var(--stripe);
  border-radius: 15px 15px 0 0;
}
#result-kicker { margin-top: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.14em; color: var(--ink-dim); }
#result-title {
  margin: 4px 0 2px;
  font-size: 27px;
  font-weight: 900;
  color: var(--red);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
}
#result-score { font-weight: 900; line-height: 1.1; }
#result-value { font-size: 52px; font-variant-numeric: tabular-nums; }
.result-unit { font-size: 20px; margin-left: 2px; }
#result-best {
  display: inline-block;
  margin: 4px 0 2px;
  padding: 3px 12px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  animation: hint-blink 0.9s ease-in-out infinite;
}
#result-list {
  list-style: none;
  margin: 10px 0 12px;
  padding: 0;
  text-align: left;
  border-top: 2px dashed rgba(42, 31, 26, 0.25);
}
#result-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  border-bottom: 2px dashed rgba(42, 31, 26, 0.18);
  font-size: 13.5px;
}
.rl-emoji { flex: none; font-size: 20px; width: 26px; text-align: center; }
.rl-name { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-res { flex: none; color: var(--ink-dim); font-size: 12.5px; }
.rl-pts { flex: none; width: 3.2em; text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
.rl-hit .rl-res { color: var(--red); font-weight: 800; }
.rl-endure .rl-res { color: #1f8a3b; font-weight: 800; }
.rl-skip { opacity: 0.45; }

#result-buttons, #howto-box .btn { margin-top: 4px; }
#result-buttons { display: flex; gap: 10px; }
.btn {
  flex: 1;
  padding: 12px 10px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--red); color: #fff; }
.btn-sub { background: #fff; color: var(--ink); }

#howto-box { text-align: left; }
#howto-box h2 { margin: 0 0 4px; font-size: 20px; font-weight: 900; text-align: center; }
#howto-box .btn { width: 100%; margin-top: 12px; }

/* 低い画面（横向きのスマホ） */
@media (max-height: 520px) {
  #screen-game { padding-top: 4px; gap: 4px; }
  #meter { padding-top: 1px; padding-bottom: 1px; }
  #meter-val { font-size: 26px; }
  #intro-emoji { font-size: 32px; }
  #intro-flavor { display: none; }
  #intro-hint { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  #intro-hint, .hold-icon, #meter.danger, #hint.next, #result-best { animation: none; }
}

/* ---------- 全国ランキング（SGRanking 共通モジュール） ---------- */
.sgr-hidden { display: none !important; }

.sgr-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(42, 31, 26, 0.6);
}
.sgr-panel {
  width: min(420px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 6px 6px 0 var(--ink);
}
.sgr-title { margin: 0; font-size: 20px; font-weight: 900; text-align: center; }
.sgr-tabs { display: flex; gap: 6px; justify-content: center; }
.sgr-tab {
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.sgr-tab-active { background: var(--yellow); }
.sgr-register-msg { margin: 0 0 6px; font-size: 14px; font-weight: 800; color: var(--red); text-align: center; }
.sgr-form { display: flex; gap: 8px; }
.sgr-name {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 16px;
  padding: 8px 10px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.sgr-name:focus { outline: 3px solid var(--yellow); outline-offset: 0; }
.sgr-submit {
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.sgr-submit:disabled { opacity: 0.5; cursor: default; }
.sgr-error { margin: 4px 0 0; font-size: 12px; font-weight: 700; color: var(--red); }
.sgr-status { margin: 0; font-size: 13px; color: var(--ink-dim); text-align: center; }
.sgr-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  border-top: 2px dashed rgba(42, 31, 26, 0.25);
}
.sgr-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 14px; }
.sgr-row:nth-child(even) { background: rgba(255, 210, 63, 0.18); }
.sgr-row.sgr-row-me { background: var(--yellow); font-weight: 800; }
.sgr-rank { width: 2em; text-align: right; font-weight: 900; flex-shrink: 0; }
.sgr-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgr-row-score { font-weight: 900; color: var(--red); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.sgr-row.sgr-row-me .sgr-row-score { color: var(--ink); }
.sgr-close {
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.sgr-close:active, .sgr-cta-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.sgr-cta { margin: 0 0 12px; text-align: center; }
.sgr-cta-msg { margin: 0 0 6px; font-size: 14px; font-weight: 900; color: var(--red); }
.sgr-cta-btn {
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  background: var(--yellow);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
.sgr-cta-link {
  border: none;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

/* ==========================================================================
   フッター固定バナー広告（スマホ表示時のみ / js/ad-banner.js が挿入する）
   --ad-h    : 広告そのものの高さ。広告なしのときは 0px
   --ad-space: レイアウトが空けるべき高さ（広告 + セーフエリア）
   ========================================================================== */
:root {
  --ad-h: 0px;
  --ad-space: 0px;
}
html.has-ad-banner {
  --ad-space: calc(var(--ad-h, 0px) + env(safe-area-inset-bottom, 0px));
}

.ad-banner {
  /* height は広告そのものの高さ。セーフエリアぶんの padding は外側に足す */
  box-sizing: content-box;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* ランキング・リザルト等の全画面オーバーレイ（2147483000）よりは下に置く */
  z-index: 2147482000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: var(--ad-h, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
  background: rgba(14, 16, 20, 0.86);
  /* border ではなく inset shadow にして、枠線ぶん高さがずれないようにする */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ad-banner__frame {
  display: block;
  width: 100%;
  height: var(--ad-h, 0px);
  border: 0;
  color-scheme: light;
}

@media print {
  .ad-banner { display: none; }
}
