:root {
  --bg: #12142a;
  --text: #f4f1ea;
  --muted: #a9a9c4;
  --accent: #ffd166;
  --accent2: #ef476f;
  --card: #1d2042;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif; }
button { font: inherit; }

#game {
  position: relative; margin: 0 auto;
  width: 100%; max-width: 560px;
  height: 88svh; min-height: 420px;
  overflow: hidden; touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  background: #f6c8a8;
}
@media (min-width: 700px) { #game { height: min(92svh, 960px); border-radius: 0 0 18px 18px; } }
#c { display: block; width: 100%; height: 100%; }

#hud { position: absolute; inset: 0 0 auto 0; padding: 14px 16px; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start; }
#score { font-size: 52px; font-weight: 900; line-height: 1; color: #fff;
  text-shadow: 0 3px 0 rgba(0,0,0,.25); font-variant-numeric: tabular-nums; }
#gems { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 800; color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.25); margin-top: 6px; margin-right: 44px; }
.gem-ico { width: 16px; height: 16px; background: #4cc9f0; transform: rotate(45deg); border-radius: 3px;
  box-shadow: 0 0 10px #4cc9f0; display: inline-block; }
#gems.bump { animation: bump .25s; }
@keyframes bump { 50% { transform: scale(1.3); } }

#popups { position: absolute; inset: 0; pointer-events: none; }
.pop { position: absolute; left: 50%; top: 38%; transform: translateX(-50%);
  font-weight: 900; font-size: 26px; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.3);
  animation: pop .8s ease-out forwards; white-space: nowrap; }
.pop.edge { color: var(--accent); }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }

.icon-btn { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.25); color: #fff; font-size: 18px; cursor: pointer; z-index: 5; }
.icon-btn.off { opacity: .45; text-decoration: line-through; }

.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 24px; gap: 8px;
  background: linear-gradient(180deg, rgba(18,20,42,.15), rgba(18,20,42,.55)); }
.overlay[hidden], #hud[hidden] { display: none; }
.logo { margin: 0; font-size: 64px; line-height: .9; font-weight: 900; letter-spacing: 2px; color: #fff;
  text-shadow: 0 5px 0 var(--accent2), 0 10px 24px rgba(0,0,0,.3); }
.sub { margin: 4px 0 18px; font-weight: 700; color: #fff; opacity: .9; }
.how { background: rgba(0,0,0,.3); border-radius: 14px; padding: 12px 18px; line-height: 1.9; color: #fff; }
.how b { color: var(--accent); }
.best-line { margin: 10px 0 0; color: #fff; font-weight: 700; }
.tap { margin-top: 26px; font-size: 22px; font-weight: 900; color: #fff; }
.blink { animation: blink 1.1s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.over-label { margin: 0; font-weight: 900; letter-spacing: 3px; color: #fff; opacity: .9; }
.final { font-size: 88px; font-weight: 900; line-height: 1; color: #fff; text-shadow: 0 5px 0 rgba(0,0,0,.25); }
.newrec { margin: 0; color: var(--accent); font-weight: 900; font-size: 20px; animation: blink .6s infinite; }
.btns { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; width: min(280px, 100%); }
.btn { border: 0; border-radius: 999px; padding: 14px 18px; font-weight: 900; font-size: 17px; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.btn:disabled { opacity: .6; cursor: default; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn-main { background: var(--accent); color: #2b2100; }
.btn-ad { background: var(--accent2); color: #fff; }
.btn-sub { background: rgba(255,255,255,.9); color: #1b1f3b; }

.below { max-width: 640px; margin: 0 auto; padding: 18px 16px 40px; line-height: 1.8; }
.below h2 { font-size: 1.15rem; margin: 28px 0 6px; border-left: 4px solid var(--accent); padding-left: 10px; }
.below a { color: var(--accent); }
.below ul { padding-left: 1.3em; }
.ad-slot { min-height: 100px; margin: 18px 0; border: 1px dashed rgba(255,255,255,.15); border-radius: 8px; }
footer { margin-top: 40px; display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; }

.policy { max-width: 720px; margin: 0 auto; padding: 24px 16px 60px; line-height: 1.85; }
.policy h2 { font-size: 1.05rem; margin-top: 28px; }
.policy a { color: var(--accent); }
