/* ===== 共通トークン ===== */
.dg {
  --mint: #d6efe3;
  --mint-deep: #b9e0cd;
  --ink: #213047;
  --ink-soft: #52607a;
  --red: #e8392e;
  --red-dark: #b8231b;
  --sun: #f6c945;
  --sun-dark: #c89a1c;
  --paper: #fffaf0;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}

.dg *,
.dg *::before,
.dg *::after {
  box-sizing: border-box;
}
.dg [hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.dg {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--mint);
  background-image: radial-gradient(rgba(33, 48, 71, 0.08) 1.6px, transparent 1.8px);
  background-size: 22px 22px;
  overflow-x: hidden;
  line-height: 1.6;
}

.dg button,
.dg input {
  font-family: inherit;
}
.dg :focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

/* ===== 上部バー ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.topbar-site {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-site:hover {
  text-decoration: underline;
}
.topbar-link {
  flex: none;
  padding: 6px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.topbar-link:hover {
  background: var(--paper);
}

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 24px;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.08s,
    box-shadow 0.08s;
}
.btn:active {
  transform: translateY(3px);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.btn-red {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 0 var(--red-dark);
}
.btn-red:active {
  box-shadow: 0 1px 0 var(--red-dark);
}
.btn-sun {
  background: var(--sun);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--sun-dark);
}
.btn-sun:active {
  box-shadow: 0 1px 0 var(--sun-dark);
}
.btn-ghost {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.btn-ghost-light {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 2px #fff;
}

/* ===== データ保存キー（初回ダイアログ・図鑑ページ共通） ===== */
.keycard {
  width: min(92vw, 420px);
  padding: 28px 24px 22px;
  border: none;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.keycard::backdrop {
  background: rgba(22, 36, 58, 0.6);
}
.keycard[open] {
  animation: keycard-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes keycard-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.keycard-kicker {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--ink);
  font-size: 15px;
  font-weight: 800;
}
.keycard-title {
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
}

.keycard-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 0 12px;
  padding: 16px 12px;
  border: 3px dashed var(--red);
  border-radius: 16px;
  background: #fff;
  line-height: 1.15;
}
.keycard-prefix {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--red);
}
.keycard-body {
  font-size: clamp(26px, 7.4vw, 34px);
  font-weight: 800;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  user-select: all;
  -webkit-user-select: all;
}
.keycard-note {
  margin: 0;
  color: var(--red-dark);
  font-size: 15px;
  font-weight: 800;
}
.keycard-help {
  margin: 8px 0 18px;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: left;
}
.keycard-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.keycard-foot {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .keycard[open] {
    animation: none;
  }
}

/* ===== ゲームページ ===== */
.dg-game {
  --metal-hi: #f4f6f8;
  --metal-lo: #9ea8b3;
  --cream: #fff8ea;
}

/* ===== ページ ===== */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 16px 40px;
}

.title {
  margin: 0;
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.guide {
  margin: 12px 0 26px;
  padding: 8px 20px;
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(33, 48, 71, 0.12);
  text-align: center;
}

/* ===== ガチャマシン ===== */
.machine {
  --k: 1;
  width: 320px;
  transform: scale(var(--k));
  transform-origin: top center;
}
@media (max-width: 360px) {
  .machine {
    --k: 0.88;
  }
}
@media (max-height: 700px) and (min-width: 361px) {
  .machine {
    --k: 0.86;
  }
}

.lid {
  position: relative;
  z-index: 2;
  width: 92px;
  height: 30px;
  margin: 0 auto -12px;
  border-radius: 46px 46px 8px 8px;
  background: linear-gradient(#f04a3e, #c92c22);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35);
}

.globe {
  position: relative;
  z-index: 1;
  width: 260px;
  height: 260px;
  margin: 0 auto -34px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 42%,
    rgba(255, 255, 255, 0.7),
    rgba(222, 242, 250, 0.45) 58%,
    rgba(160, 205, 222, 0.6)
  );
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.7),
    inset 0 -24px 40px rgba(70, 130, 160, 0.22),
    0 10px 24px rgba(33, 48, 71, 0.1);
}

.globe-caps {
  position: absolute;
  inset: 0;
}

.gc {
  position: absolute;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: linear-gradient(
    color-mix(in srgb, var(--c) 80%, #fff) 0 46%,
    color-mix(in srgb, var(--c) 12%, #fff) 46% 54%,
    color-mix(in srgb, var(--c) 38%, #fff) 54%
  );
  box-shadow:
    inset -4px -6px 8px rgba(0, 0, 0, 0.12),
    inset 3px 4px 6px rgba(255, 255, 255, 0.5);
  transform: rotate(var(--r));
}
.gc::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 11px;
  width: 11px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
}
.globe.shake .gc {
  animation: jiggle 0.16s ease-in-out infinite alternate;
  animation-delay: var(--delay);
}
@keyframes jiggle {
  from {
    transform: rotate(var(--r)) translate(0, 0);
  }
  to {
    transform: rotate(calc(var(--r) + 28deg)) translate(var(--jx), -7px);
  }
}

.globe-shine {
  position: absolute;
  top: 22px;
  left: 40px;
  width: 64px;
  height: 108px;
  border-radius: 50%;
  background: linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
  transform: rotate(32deg);
  pointer-events: none;
}

.body {
  position: relative;
  z-index: 2;
  width: 300px;
  height: 232px;
  margin: 0 auto;
  border-radius: 30px 30px 22px 22px;
  background: linear-gradient(180deg, #f04a3e, #d22f25);
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.35),
    inset 0 -8px 0 rgba(0, 0, 0, 0.12),
    0 18px 30px rgba(120, 20, 10, 0.22);
}

.base {
  width: 320px;
  height: 18px;
  margin: -4px auto 0;
  border-radius: 0 0 16px 16px;
  background: #9e1e17;
}

/* ----- ハンドル ----- */
.handle {
  position: absolute;
  left: 32px;
  top: 30px;
  width: 108px;
  height: 108px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #d3d9df 45%, var(--metal-lo));
  box-shadow:
    0 6px 0 #6d7580,
    0 10px 16px rgba(0, 0, 0, 0.22),
    inset 0 -4px 8px rgba(0, 0, 0, 0.15);
  cursor: not-allowed;
  filter: saturate(0.7) brightness(0.96);
  transition: filter 0.3s;
}
.handle-knob {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.handle-bar {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 30px;
  margin-top: -15px;
  border-radius: 15px;
  background: linear-gradient(#fdfdfd, #b9c1ca);
  box-shadow:
    0 3px 0 #7d8691,
    inset 0 1px 0 #fff;
}
.handle-bar::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--red);
}
.handle.ready {
  cursor: pointer;
  filter: none;
}
.handle.ready::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 3px dashed #fff;
  animation: ring-spin 3s linear infinite;
}
@keyframes ring-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ----- コイン投入口 ----- */
.coin-slot {
  position: absolute;
  right: 34px;
  top: 30px;
  width: 68px;
  height: 104px;
  padding: 0;
  border: none;
  border-radius: 14px;
  background: linear-gradient(var(--metal-hi), #aeb7c1);
  box-shadow:
    0 5px 0 #7c8591,
    inset 0 1px 0 #fff;
  cursor: pointer;
}
.coin-slot.ready::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 18px;
  border: 3px solid #fff;
  animation: slot-pulse 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes slot-pulse {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.97);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}
.slot-hole {
  position: absolute;
  left: 50%;
  top: 16px;
  width: 10px;
  height: 46px;
  margin-left: -5px;
  border-radius: 5px;
  background: #1e2530;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 255, 255, 0.8);
}
.slot-lamp {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #5b6470;
  transition:
    background 0.2s,
    box-shadow 0.2s;
}
.coin-slot.lit .slot-lamp {
  background: #7dff8a;
  box-shadow: 0 0 10px #7dff8a;
}
.slot-price {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #4a5563;
}

/* コインは「差し込み口の中心線」より下を切り取って、吸い込まれたように見せる */
.coin-track {
  position: absolute;
  left: 50%;
  top: -101px; /* slot-hole中心(39px) - 高さ140px */
  width: 72px;
  height: 140px;
  margin-left: -36px;
  overflow: hidden;
  perspective: 300px;
  pointer-events: none;
}
.coin {
  position: absolute;
  top: 0;
  left: 50%;
  width: 46px;
  height: 46px;
  margin-left: -23px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #f5c542 45%, #c98f16);
  box-shadow:
    inset 0 0 0 3px #e0a92a,
    inset 0 0 0 6px #fbe08a;
  color: #93650a;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
}

/* ----- 排出口 ----- */
.exit {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 128px;
  height: 66px;
  margin-left: -64px;
  border-radius: 20px 20px 10px 10px;
  background: var(--red-dark);
  box-shadow:
    inset 0 3px 0 rgba(0, 0, 0, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.25);
  perspective: 200px;
}
.exit-hole {
  position: absolute;
  inset: 8px 10px 10px;
  border-radius: 30px 30px 8px 8px;
  background: radial-gradient(ellipse at 50% 20%, #3a1210, #150605);
}
.exit-flap {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 8px;
  height: 40px;
  border-radius: 30px 30px 4px 4px;
  background: linear-gradient(rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.1));
  transform-origin: top center;
  transition: transform 0.25s ease-out;
}
.exit.open .exit-flap {
  transform: rotateX(-72deg);
}

/* ===== 排出カプセル ===== */
.capsule {
  position: fixed;
  z-index: 60;
  width: 56px;
  height: 56px;
  pointer-events: none;
  will-change: transform;
}
.cap-top,
.cap-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
}
.cap-top {
  top: 0;
  z-index: 2;
  border-radius: 28px 28px 0 0;
  background:
    radial-gradient(ellipse 22% 16% at 34% 38%, rgba(255, 255, 255, 0.85) 0 60%, transparent 62%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 70%, #fff), color-mix(in srgb, var(--c) 85%, #000 5%));
  opacity: 0.96;
  box-shadow: inset -4px 4px 8px rgba(255, 255, 255, 0.35);
}
.cap-bottom {
  bottom: 0;
  z-index: 1;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(color-mix(in srgb, var(--c) 30%, #fff), color-mix(in srgb, var(--c) 48%, #fff));
  box-shadow: inset -4px -5px 8px rgba(0, 0, 0, 0.08);
}
/* つなぎ目のリップ（明るい色で、カプセルらしく） */
.cap-bottom::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: -2px;
  height: 7px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--c) 10%, #fff);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ===== 開封演出 ===== */
.reveal {
  --stage: min(56vmin, 340px);
  --stage-y: 40%;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(22, 36, 58, 0);
  transition:
    background-color 0.4s,
    backdrop-filter 0.4s;
}
.reveal[hidden] {
  display: none;
}
.reveal.show {
  background: rgba(22, 36, 58, 0.64);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  overflow: clip;
}

.reveal-stage {
  position: absolute;
  left: 50%;
  top: var(--stage-y);
  width: var(--stage);
  height: var(--stage);
  margin: calc(var(--stage) / -2) 0 0 calc(var(--stage) / -2);
}

.rays {
  position: absolute;
  inset: -32%;
  opacity: 0;
  transform: scale(0.3);
  transition:
    opacity 0.5s,
    transform 0.7s cubic-bezier(0.2, 0.8, 0.3, 1);
  -webkit-mask: radial-gradient(closest-side, #000 20%, transparent 100%);
  mask: radial-gradient(closest-side, #000 20%, transparent 100%);
}
.rays::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 234, 150, 0.6) 0deg 9deg, transparent 9deg 22.5deg);
  animation: ring-spin 16s linear infinite;
}
.reveal-stage.open .rays {
  opacity: 1;
  transform: scale(1);
}

.glow {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 228, 0.95), rgba(255, 220, 120, 0.45) 45%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
}
.reveal-stage.open .glow {
  opacity: 1;
  animation: glow-pulse 1.8s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%,
  100% {
    transform: scale(0.94);
  }
  50% {
    transform: scale(1.06);
  }
}

.figure-wrap {
  position: absolute;
  inset: 2%;
}
.figure-wrap.float {
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3%);
  }
}
.figure {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 0 14px rgba(255, 244, 190, 0.95));
}
.figure.shown {
  opacity: 1;
}

/* キラキラ */
.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 232, 130, 0.95));
  opacity: 0;
  transition: opacity 0.3s;
}
.reveal-stage.open .sparkles {
  opacity: 1;
}
.star {
  position: absolute;
  left: calc(50% + var(--x));
  top: calc(50% + var(--y));
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: var(--col, #fff);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  opacity: 0;
  animation: twinkle var(--t, 1.6s) ease-in-out var(--d) infinite;
}
@keyframes twinkle {
  0%,
  100% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1) rotate(90deg);
    opacity: 1;
  }
}

.flash,
.dot {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  pointer-events: none;
}
.flash {
  width: 60%;
  height: 60%;
  margin: -30% 0 0 -30%;
  background: radial-gradient(circle, #fff 30%, rgba(255, 255, 255, 0) 70%);
}
.dot {
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
}

.result {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--stage-y) + var(--stage) / 2 + 4px);
  padding: 0 16px;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.4s,
    transform 0.4s;
  pointer-events: none;
}
.reveal.done .result {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.result-name {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(20px, 4.6vw, 28px);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.result-sub {
  margin: -8px 0 14px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 800;
}
.result-sub:empty {
  display: none;
}
.result-new {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-size: 0.6em;
  vertical-align: 0.25em;
  text-shadow: none;
}
.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.result-actions .btn:focus-visible {
  outline-color: #fff;
}

/* ===== 動きを減らす設定 ===== */
@media (prefers-reduced-motion: reduce) {
  .handle.ready::before,
  .rays::before,
  .coin-slot.ready::after,
  .figure-wrap.float,
  .reveal-stage.open .glow {
    animation: none;
  }
  .star {
    animation-duration: 3s;
  }
}

/* =====================================================
   追加：コイン・結果画面・テスト用パネル
   ===================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ----- コインの表示 ----- */
.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 14px;
}
.wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px 6px 8px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 800;
  line-height: 1;
}
.wallet-coin,
.fly-coin {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #f5c542 45%, #c98f16);
  box-shadow:
    inset 0 0 0 3px #e0a92a,
    inset 0 0 0 5px #fbe08a;
  color: #93650a;
  font-size: 14px;
}
.wallet-label {
  font-size: 14px;
}
.wallet-x {
  font-size: 14px;
  color: var(--ink-soft);
}
.wallet-count {
  min-width: 1.2ch;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.wallet.is-empty .wallet-count {
  color: var(--red);
}

.daily-btn {
  min-height: 44px;
}
.daily-next {
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.fly-coin {
  position: fixed;
  z-index: 70;
  margin: -17px 0 0 -17px;
  pointer-events: none;
}
.plus-one {
  position: fixed;
  z-index: 70;
  color: var(--red);
  font-size: 18px;
  font-weight: 800;
  pointer-events: none;
  text-shadow: 0 2px 0 #fff;
}

.guide {
  margin-top: 16px;
}

/* ----- コインの集め方 ----- */
.howto {
  width: min(100%, 360px);
  margin-top: 26px;
  padding: 12px 18px;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 3px 0 rgba(33, 48, 71, 0.12);
}
.howto summary {
  font-weight: 800;
  cursor: pointer;
}
.howto ul {
  margin: 10px 0 2px;
  padding-left: 1.3em;
  font-size: 14px;
}
.howto li + li {
  margin-top: 4px;
}

/* ----- 結果画面 ----- */
.reveal-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 18px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(22, 36, 58, 0.55);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.reveal-close:hover {
  background: rgba(22, 36, 58, 0.8);
}
.reveal-close:focus-visible {
  outline-color: #fff;
}
.reveal-close-x {
  font-size: 20px;
  line-height: 1;
}

.result-coins {
  margin: -6px 0 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.result-coins .fly-coin-mini {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  border-radius: 50%;
  vertical-align: -2px;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #f5c542 45%, #c98f16);
}
.btn-light {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 0 #b9c3cf;
}
.btn-light:active {
  box-shadow: 0 1px 0 #b9c3cf;
}
.btn-light:focus-visible,
.result-actions .btn:focus-visible {
  outline-color: #fff;
}

.result-more {
  margin-top: 12px;
}
.reveal {
  overflow-y: auto;
}

@media (max-height: 640px) {
  .reveal {
    --stage: min(46vmin, 300px);
    --stage-y: 36%;
  }
}

/* ----- テスト用パネル（本番では出力しない） ----- */
.debug {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 40;
  width: min(calc(100vw - 24px), 330px);
  border: 2px dashed #8a97a8;
  border-radius: 14px;
  background: #1f2a3c;
  color: #e8edf3;
  font-size: 13px;
}
.debug summary {
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
}
.debug-body {
  padding: 0 14px 14px;
}
.debug-note {
  margin: 0 0 10px;
  color: #aab6c6;
  font-size: 12px;
}
.debug-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.debug button,
.debug a {
  padding: 5px 10px;
  border: 1px solid #8a97a8;
  border-radius: 8px;
  background: #2c3a50;
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.debug a[aria-current="true"] {
  background: #e8edf3;
  color: #1f2a3c;
}
.debug-info {
  margin: 10px 0 6px;
  line-height: 1.7;
}
.debug-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.debug-table th,
.debug-table td {
  padding: 3px 4px;
  border-bottom: 1px solid #3a4960;
  text-align: left;
}
.debug-table th {
  color: #aab6c6;
  font-weight: 800;
}
.debug :focus-visible {
  outline-color: #fff;
}
.debug-tz label {
  width: 100%;
  color: #aab6c6;
  font-weight: 800;
}
.debug select {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #8a97a8;
  border-radius: 8px;
  background: #2c3a50;
  color: #fff;
  font: inherit;
}
.debug-body {
  max-height: 70vh;
  overflow-y: auto;
}
