@charset "UTF-8";
/* BALLOON SKY - レイアウトとUI
   ゲーム本体は canvas に描画し、UI はその上に重ねた DOM で構成する。
   見た目はスーパーファミコン風のドット絵UI。枠・ボタン・アイコンはすべて
   assets/ui/ のドット絵画像を border-image / background-image で使う。
   ドットの角を残すため、拡大は image-rendering: pixelated（角丸は使わない）。 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* ドット絵と同じパレット */
  --c-ink: #1b2440;        /* いちばん濃い輪郭 */
  --c-ink2: #2c3a5e;
  --c-panel: #12233f;      /* パネルの地色 */
  --c-sky: #3aa5f0;
  --c-sky-lt: #8fd8ff;
  --c-gold: #ffd23f;
  --c-gold-lt: #fff3a8;
  --c-pink: #ff4f76;
  --c-pink-lt: #ff9fb4;
  --c-green: #8ed957;
  --c-text: #f2f7fb;
  /* 文字の縁取り。4方向だけだと斜めの角が欠けてギザギザに見えるので、
     斜めを含めた8方向に影を置いて輪郭をひとつながりにする */
  --ol2:
    2px 0 0 var(--c-ink), -2px 0 0 var(--c-ink), 0 2px 0 var(--c-ink), 0 -2px 0 var(--c-ink),
    1px 2px 0 var(--c-ink), -1px 2px 0 var(--c-ink), 1px -2px 0 var(--c-ink), -1px -2px 0 var(--c-ink),
    2px 1px 0 var(--c-ink), -2px 1px 0 var(--c-ink), 2px -1px 0 var(--c-ink), -2px -1px 0 var(--c-ink);
  --ol3:
    3px 0 0 var(--c-ink), -3px 0 0 var(--c-ink), 0 3px 0 var(--c-ink), 0 -3px 0 var(--c-ink),
    2px 2px 0 var(--c-ink), -2px 2px 0 var(--c-ink), 2px -2px 0 var(--c-ink), -2px -2px 0 var(--c-ink),
    1px 3px 0 var(--c-ink), -1px 3px 0 var(--c-ink), 1px -3px 0 var(--c-ink), -1px -3px 0 var(--c-ink),
    3px 1px 0 var(--c-ink), -3px 1px 0 var(--c-ink), 3px -1px 0 var(--c-ink), -3px -1px 0 var(--c-ink);
  /* フッター固定バナー広告（js/ad-banner.js が値を入れる） */
  --ad-h: 0px;
  --ad-space: 0px;
}
html.has-ad-banner {
  --ad-space: calc(var(--ad-h, 0px) + env(safe-area-inset-bottom, 0px));
}

html, body { height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  background: #0b1622;
  color: var(--c-text);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
  font-weight: 700;
}

/* ボタンの既定の背景（ほぼ白）が、ドット絵の枠の角の透明部分から
   「白い欠け」として覗いてしまうので、ブラウザ既定の見た目は消しておく。
   背景が必要なボタンは各クラス側で指定する */
button {
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}
.hidden { display: none !important; }

/* ドット絵をぼかさずに拡大する */
img, .pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

/* 共通ヘッダーのメニューからだけ使う実体のないボタン */
.sgh-proxy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------- 画面全体 ---------------- */
#app {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--sgh-top, 0px);
  bottom: var(--ad-space, 0px);
  overflow: hidden;
}

#stage-wrap {
  position: absolute;
  inset: 0;
  background: #0b1622;
  touch-action: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---------------- HUD ---------------- */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 6px max(8px, env(safe-area-inset-left)) 0 max(8px, env(safe-area-inset-right));
  pointer-events: none;
  z-index: 5;
  touch-action: none;
}

.hud-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 6px 10px;
  background: rgba(18, 35, 63, 0.82);
  border: 3px solid var(--c-ink);
  box-shadow:
    inset 0 3px 0 rgba(143, 216, 255, 0.35),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    0 3px 0 rgba(0, 0, 0, 0.35);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 54px;
  padding: 0 3px;
  line-height: 1.1;
}

/* HUD の小さなドット絵アイコン（assets/ui/icons.png の 16x16 セル） */
.hud-ico {
  display: block;
  width: 16px;
  height: 16px;
  background-image: url("assets/ui/icons.png?ver=20261122-1");
  background-repeat: no-repeat;
  background-size: 128px 16px;
  image-rendering: pixelated;
}
.hud-ico--score   { background-position:    0 0; }
.hud-ico--high    { background-position: -16px 0; }
.hud-ico--stage   { background-position: -32px 0; }
.hud-ico--enemy   { background-position: -48px 0; }
.hud-ico--life    { background-position: -64px 0; }
.hud-ico--balloon { background-position: -80px 0; }

.hud-label {
  font-size: 9px;
  letter-spacing: 0.02em;
  color: #a9c6e4;
}
.hud-value {
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 var(--c-ink);
}
.hud-balloons { color: var(--c-pink-lt); letter-spacing: 1px; }

.hud-buttons {
  margin-left: auto;
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

/* HUD の丸ボタン。絵文字は共通ヘッダーが読み取るので残し、見た目だけドット絵に差し替える。
   スプライトは ::before に置く（ボタンの背景にすると隣のセルまで見えてしまうため） */
.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 3px solid var(--c-ink);
  background-color: #1e3557;
  color: transparent;
  font-size: 0;
  line-height: 0;
  box-shadow: inset 0 3px 0 rgba(143, 216, 255, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.06s;
}
.icon-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background-image: url("assets/ui/icons.png?ver=20261122-1");
  background-repeat: no-repeat;
  background-size: 128px 16px;
  image-rendering: pixelated;
  transform: scale(1.5);
}
.icon-btn:active { transform: translateY(2px); }
.icon-btn:hover { background-color: #2a4a76; }
.icon-btn--sound::before { background-position: -96px 0; }
.icon-btn--sound.is-muted::before { background-position: -112px 0; }
.icon-btn--pause::before {
  background-image: url("assets/ui/icons-menu.png?ver=20261122-1");
  background-size: 64px 16px;
  background-position: 0 0;
}
.icon-btn:focus-visible { outline: 3px solid var(--c-gold); outline-offset: 2px; }

.hud-sub {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 0 4px;
  font-weight: 900;
  font-size: 13px;
  text-shadow: var(--ol2);
}
.hud-wind { color: var(--c-sky-lt); }
.hud-wind.is-warning { color: var(--c-gold); animation: blink 0.6s steps(2, end) infinite; }
.hud-combo { color: var(--c-gold); }
.hud-items { color: #d9f7ff; letter-spacing: 0.02em; }

@keyframes blink { 50% { opacity: 0.35; } }

/* ---------------- 画面・オーバーレイ ---------------- */
.screen, .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 20;
  /* 縦スクロールだけ許し、ピンチ・ダブルタップでの拡大は起こさせない */
  touch-action: pan-y;
}

/* 背景の空を見せたいので、画面を暗くしすぎない */
.screen { background: linear-gradient(180deg, rgba(6, 20, 36, 0.16), rgba(6, 20, 36, 0.4)); }
.overlay { background: rgba(6, 18, 32, 0.6); z-index: 30; }
/* 操作方法は結果画面の上にも出す（共通ヘッダーの「遊び方」）ので、ほかのオーバーレイより手前に置く */
#overlay-howto-ingame { z-index: 31; }

/* SNES風のウィンドウ枠（assets/ui/frame-panel.png の9スライス） */
.panel, .modal-box {
  width: min(560px, 100%);
  max-height: 100%;
  padding: 4px 12px 14px;
  border: 24px solid transparent;
  border-image: url("assets/ui/frame-panel.png?ver=20261122-1") 16 fill stretch;
  image-rendering: pixelated;
  text-align: center;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35));
}

.panel-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.panel-scroll { text-align: left; }
.modal-scroll { text-align: left; }

.panel-title, .modal-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  text-align: center;
  color: var(--c-gold-lt);
  text-shadow: var(--ol3);
}
.panel-note { font-size: 12px; color: #a9c6e4; text-align: center; margin-bottom: 10px; }

/* ロゴ（ドット絵画像） */
.game-logo { display: block; text-align: center; line-height: 0; }
.game-logo img {
  display: block;
  width: min(360px, 82vw);
  height: auto;
  margin: 0 auto;
}

/* ローディング */
.loading-track {
  width: min(280px, 82%);
  height: 18px;
  margin: 10px auto 0;
  background: #0d1830;
  border: 3px solid var(--c-ink);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.loading-bar {
  width: 0;
  height: 100%;
  background: var(--c-gold);
  box-shadow: inset 0 3px 0 var(--c-gold-lt), inset 0 -3px 0 #e09a12;
  transition: width 0.12s linear;
}
.loading-text { margin-top: 8px; font-size: 12px; color: #a9c6e4; }

.title-desc { font-size: 13px; line-height: 1.6; color: #cfe4f7; }
.title-desc strong { color: var(--c-gold); }
.title-highscore {
  font-size: 13px;
  font-weight: 900;
  color: var(--c-gold);
  padding: 5px 14px;
  background: #0d1830;
  border: 3px solid var(--c-ink);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.4);
  text-shadow: 0 2px 0 var(--c-ink);
}

/* ボタン（ドット絵の9スライス枠） */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin: 6px auto 0;
}

.btn {
  display: block;
  width: 100%;
  padding: 4px 10px;
  background: transparent;
  border: 16px solid transparent;
  border-image: url("assets/ui/frame-btn-sub.png?ver=20261122-1") 8 fill stretch;
  image-rendering: pixelated;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: var(--ol2);
  transition: transform 0.06s;
}
.btn:active,
.btn:hover:active { transform: translateY(3px); }
.btn:focus-visible { outline: 3px solid var(--c-gold); outline-offset: 2px; }

.btn-primary { border-image: url("assets/ui/frame-btn.png?ver=20261122-1") 8 fill stretch; }
.btn-primary:active { border-image: url("assets/ui/frame-btn-active.png?ver=20261122-1") 8 fill stretch; }
.btn-sub:active { border-image: url("assets/ui/frame-btn-sub-active.png?ver=20261122-1") 8 fill stretch; }
.btn-big { font-size: 17px; padding: 8px 10px; }

/* トロフィーアイコン付きのボタン */
.btn-trophy::before {
  content: "";
  display: inline-block;
  vertical-align: -3px;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  background: url("assets/ui/icons-menu.png?ver=20261122-1") no-repeat -16px 0 / 64px 16px;
  image-rendering: pixelated;
}

/* あそびかた */
.howto-body { font-size: 13px; line-height: 1.8; font-weight: 500; }
.howto-body h3 {
  font-size: 14px;
  font-weight: 900;
  margin: 14px 0 6px;
  padding: 3px 8px;
  color: var(--c-ink);
  background: var(--c-gold);
  box-shadow: 0 3px 0 #c07a10;
  letter-spacing: 0.06em;
}
.howto-body ul { padding-left: 1.2em; }
.howto-body li { margin-bottom: 4px; }
.howto-body strong { color: var(--c-gold-lt); font-weight: 900; }
#screen-howto .btn, #screen-select .btn, #screen-highscore .btn { margin-top: 16px; }

/* ステージ選択 */
.stage-list { display: flex; flex-direction: column; gap: 8px; }
.stage-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 2px 6px 6px;
  background: transparent;
  border: 12px solid transparent;
  border-image: url("assets/ui/frame-card.png?ver=20261122-1") 8 fill stretch;
  image-rendering: pixelated;
  color: #fff;
  transition: transform 0.06s;
}
.stage-card:hover:not(:disabled) { filter: brightness(1.25); }
.stage-card:active:not(:disabled) { transform: translateY(2px); }
.stage-card__no {
  display: block; font-size: 11px; font-weight: 900;
  color: var(--c-gold); letter-spacing: 0.1em;
}
.stage-card__name {
  display: block; font-size: 16px; font-weight: 900; margin: 1px 0 2px;
  text-shadow: 0 2px 0 var(--c-ink);
}
.stage-card__hint { display: block; font-size: 11px; color: #a9c6e4; font-weight: 500; }
.stage-card.is-locked { opacity: 0.4; cursor: not-allowed; }

/* ハイスコア */
.hs-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.hs-list li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  background: #1a3050;
  border: 2px solid var(--c-ink);
}
.hs-rank { font-weight: 900; color: var(--c-gold); text-align: center; }
.hs-score { font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 var(--c-ink); }
.hs-meta { font-size: 11px; color: #a9c6e4; font-weight: 500; }
.hs-empty { display: block; text-align: center; color: #a9c6e4; font-size: 13px; }

/* 結果表示 */
.clear-stage-name { font-size: 13px; color: #cfe4f7; margin-bottom: 10px; }
.newrecord {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 14px;
  background: var(--c-gold);
  border: 3px solid var(--c-ink);
  box-shadow: 0 3px 0 #c07a10;
  color: var(--c-ink);
  font-weight: 900;
  font-size: 13px;
}
.result-table { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 13px; }
.result-table > div {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  background: #1a3050;
  border: 2px solid var(--c-ink);
}
.result-table dt { color: #a9c6e4; font-weight: 500; }
.result-table dd { font-weight: 900; font-variant-numeric: tabular-nums; }
.result-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 12px;
  background: #0d1830;
  border: 3px solid var(--c-ink);
  box-shadow: inset 0 3px 0 rgba(255, 210, 63, 0.25);
  margin-top: 6px;
}
.result-total strong {
  font-size: 26px; color: var(--c-gold); font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 0 var(--c-ink);
}
.clear-note { margin-top: 8px; font-size: 12px; color: var(--c-gold); font-weight: 900; }

/* 音量 */
.volume-box { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.volume-row { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 900; }
.volume-row span { width: 52px; text-align: right; color: #a9c6e4; }
/* つまみの操作をスクロール判定に取られないようにする */
.volume-row input[type="range"] { flex: 1; accent-color: var(--c-pink); height: 26px; touch-action: none; }

/* フッター */
.game-footer { margin-top: 12px; font-size: 10px; color: #8fb0d0; line-height: 1.8; text-align: center; font-weight: 500; }
.game-footer a { color: var(--c-sky-lt); }

/* ---------------- 仮想パッド ---------------- */
#touch-pad {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  z-index: 10;
  pointer-events: none;
  touch-action: none;
}
#touch-pad.is-visible { display: flex; }
#touch-pad.is-disabled { display: none; }

/* ボタンの隙間を指でつまんでも拡大しないよう、枠側にも touch-action を効かせる */
.pad-left, .pad-right { display: flex; gap: 10px; pointer-events: auto; touch-action: none; }

.pad-btn {
  width: 78px;
  height: 78px;
  border: none;
  background: transparent center / contain no-repeat;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  text-shadow: var(--ol2);
  image-rendering: pixelated;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.pad-btn-flap {
  width: 104px;
  height: 104px;
  background-image: url("assets/ui/btn-flap.png?ver=20261122-1");
}
.pad-btn-flap.is-pressed {
  background-image: url("assets/ui/btn-flap-active.png?ver=20261122-1");
  transform: translateY(3px);
}

/* 左右ジョイスティック。枠（stick-zone）のどこを触っても効くので、
   親指を置いた場所がそのまま倒し具合になる */
.stick-zone {
  position: relative;
  width: 156px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.stick-base {
  position: relative;
  width: 96px;
  height: 96px;
  background: url("assets/ui/stick-base.png?ver=20261122-1") center / contain no-repeat;
  image-rendering: pixelated;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* 向きのヒントは土台の絵に描いてあるので、文字は出さない */
.stick-hint { display: none; }
.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  background: url("assets/ui/stick-knob.png?ver=20261122-1") center / contain no-repeat;
  image-rendering: pixelated;
  transform: translate(-50%, -50%);
  /* 指を離したときだけ中央へ戻るアニメーションを付ける（追従中は即時） */
  transition: transform 0.12s ease;
}
.stick-zone.is-active .stick-base { filter: brightness(1.2); }
.stick-zone.is-active .stick-knob { filter: brightness(1.3) saturate(1.2); transition: none; }

/* ---------------- デバッグ ---------------- */
#debug-panel {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: 46%;
  max-height: 52%;
  overflow: auto;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.62);
  color: #7CFC9A;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre;
  pointer-events: none;
  z-index: 40;
}

/* ---------------- レスポンシブ ---------------- */
@media (max-width: 600px) {
  .hud-item { min-width: 44px; }
  .hud-label { font-size: 8px; }
  .hud-value { font-size: 14px; }
  .icon-btn { width: 34px; height: 34px; }
  .panel, .modal-box { border-width: 18px; padding: 2px 6px 10px; }
  .pad-btn-flap { width: 92px; height: 92px; }
  .stick-zone { width: 140px; height: 118px; }
  .stick-base { width: 88px; height: 88px; }
  .stick-knob { width: 50px; height: 50px; }
  .howto-body { font-size: 12.5px; }
  .panel-title, .modal-title { font-size: 19px; }
}

@media (max-height: 480px) {
  .game-logo img { width: min(300px, 70vw); }
  .title-desc { display: none; }
  .btn { font-size: 14px; border-width: 12px; }
  .btn-big { font-size: 15px; }
  .pad-btn-flap { width: 78px; height: 78px; }
  .stick-zone { width: 124px; height: 96px; }
  .stick-base { width: 80px; height: 80px; }
  .stick-knob { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .hud-wind.is-warning { animation: none; }
  .btn, .icon-btn, .stage-card { transition: none; }
  .stick-knob { transition: 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));
  touch-action: pan-y;
  background: rgba(6, 18, 32, 0.8);
}

.sgr-panel {
  width: min(420px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 8px 10px;
  border: 20px solid transparent;
  border-image: url("assets/ui/frame-panel.png?ver=20261122-1") 16 fill stretch;
  image-rendering: pixelated;
  color: var(--c-text);
}

.sgr-title {
  margin: 0; font-size: 19px; text-align: center; font-weight: 900;
  color: var(--c-gold-lt);
  text-shadow: var(--ol3);
}
.sgr-tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.sgr-tab {
  border: 2px solid var(--c-ink);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 900;
  background: #1a3050;
  color: var(--c-text);
  cursor: pointer;
}
.sgr-tab-active {
  background: var(--c-gold);
  color: var(--c-ink);
  box-shadow: inset 0 3px 0 var(--c-gold-lt), inset 0 -3px 0 #c07a10;
}
.sgr-register-msg { margin: 0 0 6px; font-size: 13px; font-weight: 900; text-align: center; color: var(--c-gold); }
.sgr-form { display: flex; gap: 8px; }
.sgr-name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 10px;
  border: 3px solid var(--c-ink);
  background: #0d1830;
  color: var(--c-text);
}
.sgr-name:focus { outline: none; border-color: var(--c-gold); }
.sgr-submit {
  border: 3px solid var(--c-ink);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 900;
  background: var(--c-gold);
  box-shadow: inset 0 3px 0 var(--c-gold-lt), inset 0 -3px 0 #c07a10;
  color: var(--c-ink);
  cursor: pointer;
}
.sgr-submit:hover { filter: brightness(1.08); }
.sgr-submit:disabled { opacity: 0.5; cursor: default; }
.sgr-error { margin: 4px 0 0; font-size: 12px; color: #ff8a8a; }
.sgr-status { margin: 0; font-size: 12px; text-align: center; color: #a9c6e4; }
.sgr-list { margin: 0; padding: 0; list-style: none; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.sgr-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 14px; }
.sgr-row:nth-child(even) { background: rgba(255, 255, 255, 0.07); }
.sgr-row.sgr-row-me { background: var(--c-gold); color: var(--c-ink); }
.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; flex-shrink: 0; color: var(--c-gold-lt); }
.sgr-row.sgr-row-me .sgr-row-score { color: inherit; }
.sgr-close {
  border: 3px solid var(--c-ink);
  padding: 10px;
  font-size: 13px;
  font-weight: 900;
  background: #1a3050;
  color: #dbe8f2;
  cursor: pointer;
}
.sgr-cta { margin: 10px 0 4px; text-align: center; }
.sgr-cta-msg { margin: 0 0 6px; font-size: 13px; font-weight: 900; color: var(--c-gold); }
.sgr-cta-btn {
  border: 3px solid var(--c-ink);
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 900;
  background: var(--c-gold);
  box-shadow: inset 0 3px 0 var(--c-gold-lt), inset 0 -3px 0 #c07a10;
  color: var(--c-ink);
  cursor: pointer;
}
.sgr-cta-link {
  border: none;
  background: none;
  padding: 6px;
  font-size: 12px;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ==========================================================================
   フッター固定バナー広告（スマホ表示時のみ / js/ad-banner.js が挿入する）
   --ad-h    : 広告そのものの高さ。広告なしのときは 0px
   --ad-space: レイアウトが空けるべき高さ（広告 + セーフエリア）
   ========================================================================== */
.ad-banner {
  box-sizing: content-box;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  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);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

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

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