:root {
  --bg: #0b0f0a;
  --fg: #f4f1e6;
  --muted: #a7a99c;
  --gold: #f5c542;
  --gold-deep: #c8961a;
  --green: #4ade80;
  --danger: #f87171;
  --sheet: rgba(14, 18, 12, 0.92);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden;
  font-family: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; }
video, #overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#overlay { pointer-events: none; }

#radar { position: absolute; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); width: 72px; height: 72px;
  border-radius: 50%; border: 2px solid rgba(74, 222, 128, .6); background:
  radial-gradient(circle, rgba(74,222,128,.15) 0 30%, transparent 31% 60%, rgba(74,222,128,.15) 61% 62%, transparent 63%);
  overflow: hidden; opacity: 0; transition: opacity .3s; }
#radar.on { opacity: 1; }
#radar .sweep { position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(74,222,128,.55), transparent 25%);
  animation: spin 2s linear infinite; }
#radar.hot { border-color: var(--gold); }
#radar.hot .sweep { background: conic-gradient(from 0deg, rgba(245,197,66,.8), transparent 25%); animation-duration: .5s; }
@keyframes spin { to { transform: rotate(360deg); } }

#hud { position: absolute; top: 0; left: 0; right: 0; padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
  background: linear-gradient(rgba(0,0,0,.65), transparent); }
.stat { display: flex; align-items: baseline; gap: 6px; }
.stat.right { justify-content: flex-end; }
.label { font-size: 11px; color: var(--muted); }
.big { font-size: 28px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
#status { grid-column: 1 / -1; font-size: 13px; color: var(--green); text-shadow: 0 1px 2px #000; }

#controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; justify-content: center; background: linear-gradient(transparent, rgba(0,0,0,.6)); }

button { font: inherit; border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer; }
button.primary { background: linear-gradient(var(--gold), var(--gold-deep)); color: #231a00; font-weight: 800; font-size: 18px; padding: 14px 32px;
  box-shadow: 0 4px 0 #7a5a08; }
button.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a5a08; }
button.primary:disabled { filter: grayscale(1) brightness(.7); }
button.ghost { background: rgba(255,255,255,.12); color: var(--fg); backdrop-filter: blur(6px); }

.sheet { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px 16px; text-align: center; background: var(--sheet); }
.sheet.modal { inset: auto 16px auto 16px; top: 50%; transform: translateY(-50%); border-radius: 24px;
  border: 2px solid var(--gold); box-shadow: 0 0 60px rgba(245,197,66,.35); animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: translateY(-50%) scale(.6); opacity: 0; } }
[hidden] { display: none !important; }
.logo { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 56px; font-weight: 900;
  color: #5a3f00; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 45%, var(--gold-deep));
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.2), 0 0 40px rgba(245,197,66,.5); animation: flip 3s ease-in-out infinite; }
@keyframes flip { 50% { transform: rotateY(180deg); } }
h1 { margin: 0; font-size: 40px; letter-spacing: .08em; color: var(--gold); }
h2 { margin: 0; font-size: 26px; }
.sub { margin: 0; color: var(--muted); line-height: 1.6; }
.warn { font-size: 12px; color: var(--muted); line-height: 1.6; max-width: 340px; }
.tiny { font-size: 11px; color: var(--muted); margin: 0; }
.burst { font-size: 56px; }
.amount { margin: 0; font-size: 56px; font-weight: 900; color: var(--gold); text-shadow: 0 0 20px rgba(245,197,66,.6); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.share { width: 100%; border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sns { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-weight: 800; font-size: 16px; color: #fff; }
.sns.native { width: auto; padding: 0 16px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 14px; flex-basis: 100%; }
.sns.x { background: #000; border: 1px solid #444; }
.sns.line { background: #06c755; font-size: 11px; }
.sns.fb { background: #1877f2; font-family: Georgia, serif; font-size: 22px; }
.sns.threads { background: #111; border: 1px solid #444; }
.sns.copy { background: rgba(255,255,255,.16); }
.legal { position: absolute; left: 16px; right: 16px; bottom: calc(10px + env(safe-area-inset-bottom)); margin: 0;
  font-size: 10px; line-height: 1.6; color: rgba(167,169,156,.7); }

#toast { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: rgba(0,0,0,.8); border: 1px solid rgba(255,255,255,.2); padding: 12px 18px; border-radius: 14px;
  font-weight: 700; text-align: center; animation: pop2 .25s ease-out; }
@keyframes pop2 { from { opacity: 0; transform: translate(-50%, 10px); } }
