:root {
  --bg: #0a0a0a;
  --ink: #f4f4f4;
  --muted: #8a8a8a;
  --card: #161616;
  --line: #2a2a2a;
  --accent: #6ee7ff;
  --crit: #ff3b5c;
  --ok: #7dff9a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Inter, sans-serif;
  overflow: hidden; user-select: none; }
#stage { position: relative; width: 100%; height: 100%; overflow: hidden; }
#hud { position: absolute; inset: 0 auto auto 0; z-index: 20; padding: 18px 20px; pointer-events: none; }
#plus { font-size: clamp(28px, 5vw, 54px); font-weight: 750; letter-spacing: -0.04em; }
#count { font-size: 16px; color: var(--muted); margin-top: 4px; }
#sps { font-size: 13px; color: var(--accent); margin-top: 2px; display: none; }
#click-wrap { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 15; text-align: center; }
#main-btn {
  appearance: none; border: 0; cursor: pointer;
  width: 168px; height: 168px; border-radius: 22.37%;
  background: #111 url("assets/svg/click.svg") center/cover no-repeat;
  box-shadow: 0 10px 0 #1a1a1a, 0 18px 40px rgba(0,0,0,.45);
  color: transparent; font-size: 0;
  transition: transform .05s ease, box-shadow .05s ease, filter .2s;
}
#main-btn.glow { filter: drop-shadow(0 0 18px rgba(110,231,255,.45)); width: 188px; height: 188px; }
#main-btn:active { transform: translateY(6px); box-shadow: 0 4px 0 #2a2a2a; }
#under { margin-top: 16px; font-size: 15px; color: var(--muted); }
#shop {
  position: absolute; right: 12px; top: 12px; bottom: 12px;
  width: min(340px, 38vw); z-index: 30;
  background: rgba(12,12,12,.82); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; overflow: auto;
  backdrop-filter: blur(8px);
}
#shop h2 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.up {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; margin-bottom: 8px; cursor: pointer;
}
.up[disabled] { opacity: .38; cursor: not-allowed; }
.up .ico { width: 48px; height: 48px; border-radius: 22.37%; object-fit: cover; background: #111; }
.up .name { font-size: 14px; font-weight: 650; }
.up .desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.up .cost { font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; }
#ticker { display: none; position: absolute; top: 0; left: 0; right: min(352px, 38vw); height: 42px; z-index: 25; overflow: hidden; background: #9b1018; }
#ticker::before {
  content: "BREAKING";
  position: absolute; left: 0; top: 0; height: 100%;
  display: flex; align-items: center; padding: 0 14px;
  background: #c1121f; font-weight: 800; letter-spacing: .06em; font-size: 13px; z-index: 2;
}
#ticker .strip {
  position: absolute; left: 128px; top: 0; height: 100%;
  display: flex; align-items: center; white-space: nowrap;
  animation: marquee 22s linear infinite; font-weight: 750; letter-spacing: .04em;
  font-size: 14px; text-transform: uppercase;
}
@keyframes marquee { from { transform: translateX(20%); } to { transform: translateX(-80%); } }
.logo {
  position: absolute; width: 108px; height: 108px; z-index: 8; pointer-events: none;
  border-radius: 22.37%; object-fit: cover;
  mix-blend-mode: screen; filter: contrast(1.15) saturate(1.2);
}
.floater { position: absolute; z-index: 40; pointer-events: none; font-weight: 800; animation: rise .7s ease-out forwards; }
.floater.crit { color: var(--crit); font-size: 28px; text-shadow: 0 0 12px #ff3b5c; }
.floater.norm { color: #fff; font-size: 18px; }
@keyframes rise { to { transform: translateY(-48px); opacity: 0; } }
#runner, #press, #ach { display: none; position: absolute; z-index: 18; overflow: hidden; border: 1px solid var(--line); background: #000; }
#runner, #press { border-radius: 22.37%; }
#ach { border-radius: 14px; }
#runner { right: min(364px, calc(38vw + 24px)); bottom: 16px; width: 168px; height: 168px; }
#runner img, #press img { width: 100%; height: 100%; object-fit: cover; display: block; }
#press { left: 16px; bottom: 16px; width: 168px; height: 168px; cursor: pointer; }
#press .hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font-size: 11px; background: linear-gradient(transparent, #000c); text-align: center; }
#ach { left: 16px; top: 70px; width: 240px; padding: 10px; display: none; background: #111d; }
#ach h3 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
#ach li { list-style: none; font-size: 12px; padding: 3px 0; color: #666; }
#ach li.on { color: var(--ok); }
#slime {
  display: none; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background:
    radial-gradient(circle at 18% 80%, rgba(90,220,40,.22), transparent 32%),
    radial-gradient(circle at 78% 30%, rgba(60,180,20,.16), transparent 28%);
  animation: drip 4s ease-in-out infinite;
}
@keyframes drip { 50% { filter: hue-rotate(20deg) saturate(1.3); } }
#toasts { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; }
.toast { background: #111; border: 1px solid var(--ok); color: var(--ok); padding: 8px 12px; border-radius: 8px; margin-top: 6px; font-size: 13px; }
#ocean { display: none; position: absolute; inset: 0; z-index: 80; background: #071422 url("assets/svg/wave.svg") center/cover no-repeat; }
#ocean .cap { position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%); text-align: center; text-shadow: 0 2px 16px #000; }
#ocean h1 { font-weight: 500; font-size: 28px; }
#ocean p { margin-top: 8px; color: #ddd; }
#ocean button { margin-top: 18px; padding: 10px 16px; border: 1px solid #fff4; background: #0006; color: #fff; border-radius: 8px; cursor: pointer; }
#bar { position: absolute; left: 16px; bottom: 8px; z-index: 35; display: flex; gap: 8px; }
#bar button { background: #111; color: #aaa; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px; }
@media (max-width: 820px) {
  #shop { width: 100%; right: 0; left: 0; top: auto; bottom: 0; height: 38vh; border-radius: 14px 14px 0 0; }
  #runner { right: 8px; bottom: 40vh; width: 112px; height: 112px; }
  #press { left: 8px; bottom: 40vh; width: 112px; height: 112px; }
  #click-wrap { top: 34%; }
  #ticker { right: 0; }
}
