@font-face { font-family: 'Anton'; src: url('../fonts/anton.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow C'; src: url('../fonts/barlow-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow C'; src: url('../fonts/barlow-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
:root { --green: #6dff86; --green2: #2fd85a; --ink: #0d0818; --mag: #ff3fd0; --teal: #35f0e6; --gold: #ffd36a;
  --cond: 'Barlow C', 'Arial Narrow', system-ui, sans-serif; --display: 'Anton', Impact, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: #fff; font-family: var(--cond); user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
#scene, #fx2d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#scene { cursor: none; }
#fx2d { pointer-events: none; z-index: 2; }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at 50% 55%, rgba(0,0,0,0) 55%, rgba(8,2,18,0.55) 85%, rgba(5,0,12,0.85) 100%); }
#bolt { position: fixed; inset: 0; pointer-events: none; z-index: 4; background: rgba(210,220,255,0.0); }
#bolt.go { animation: bolt 0.55s ease-out; }
@keyframes bolt { 0% { background: rgba(220,228,255,0.38); } 12% { background: rgba(220,228,255,0.05); } 22% { background: rgba(220,228,255,0.26); } 100% { background: rgba(220,228,255,0); } }

#cross { position: fixed; left: -40px; top: -40px; width: 80px; height: 80px; pointer-events: none; z-index: 6;
  filter: drop-shadow(0 0 6px rgba(80,255,120,0.9)); transform: translate(50vw, 50vh); }
body.touch #cross { opacity: 0.9; transition: opacity .4s; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud label { display: block; font-weight: 800; font-size: 12px; letter-spacing: .28em; color: var(--green); text-shadow: 0 0 10px rgba(80,255,120,.6); }
#hud b { font-family: var(--display); font-weight: 400; letter-spacing: .03em; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.hl { position: absolute; left: max(18px, env(safe-area-inset-left)); top: max(14px, env(safe-area-inset-top)); }
.hl b { font-size: clamp(30px, 4.2vw, 50px); line-height: 1; }
#h-mult { display: inline-block; margin-left: 10px; font-family: var(--display); font-size: 28px; color: var(--gold); text-shadow: 0 0 14px rgba(255,200,80,.8); vertical-align: top; }
#h-mult.on { animation: pulse .6s ease-in-out infinite alternate; }
#h-streak { display: block; font-weight: 800; letter-spacing: .2em; font-size: 13px; color: #d8ffe0; opacity: .85; margin-top: 2px; }
.hc { position: absolute; left: 50%; top: max(10px, env(safe-area-inset-top)); transform: translateX(-50%); text-align: center; }
.hc b { display: block; font-size: clamp(40px, 5.5vw, 64px); line-height: 1; }
.hr { position: absolute; right: max(18px, env(safe-area-inset-right)); top: max(14px, env(safe-area-inset-top)); display: flex; gap: 22px; text-align: right; }
.hr b { font-size: clamp(22px, 2.6vw, 32px); }
.hbtns { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 8px; pointer-events: auto; }
.hbtns button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid rgba(110,255,134,.35); background: rgba(10,6,20,.6); backdrop-filter: blur(6px); font-size: 18px; }
.hbtns button.off { opacity: .4; text-decoration: line-through; }
@keyframes pulse { to { transform: scale(1.15); } }

#count { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 7; pointer-events: none;
  font-family: var(--display); font-size: min(30vh, 220px); color: var(--green); text-shadow: 0 0 40px rgba(80,255,120,.8), 0 6px 0 rgba(0,0,0,.5); }

#callout { position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 6; pointer-events: none;
  display: flex; align-items: center; gap: 12px; max-width: min(560px, 70vw);
  background: linear-gradient(90deg, rgba(14,8,26,.92), rgba(14,8,26,.7)); border: 2px solid var(--green2); border-radius: 18px; padding: 8px 18px 8px 8px;
  box-shadow: 0 0 28px rgba(60,255,110,.35), 0 10px 30px rgba(0,0,0,.6); }
#callout img { width: 76px; height: 76px; border-radius: 14px; object-fit: cover; border: 2px solid var(--green); flex: none; }
#callout p { margin: 0; font-family: var(--display); font-size: clamp(22px, 2.8vw, 36px); line-height: 1.02; letter-spacing: .03em; color: #eaffee; text-shadow: 0 0 12px rgba(80,255,120,.6); }
#callout.shake { animation: shake .42s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 0%{transform:translate(0,8px) scale(.96);opacity:0} 15%{transform:translate(-5px,0) scale(1.04);opacity:1} 30%{transform:translate(5px,-1px)} 45%{transform:translate(-4px,1px)} 60%{transform:translate(3px,0)} 80%{transform:translate(-1px,0)} 100%{transform:none} }

.screen { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; }
#title { align-items: flex-end; justify-content: flex-start; }
.tbg { position: absolute; inset: 0; background: url('../art/title.jpg') center 30% / cover no-repeat; }
.tbg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,4,16,.05) 30%, rgba(8,4,16,.0) 50%, rgba(8,4,16,.75) 100%), linear-gradient(0deg, rgba(8,4,16,.75), rgba(8,4,16,0) 45%); }
.tcard { position: relative; margin: 0 max(26px, env(safe-area-inset-right)) max(56px, env(safe-area-inset-bottom)) auto; width: min(470px, 46vw); text-align: left; }
#title h1 { margin: 0 0 10px; line-height: .92; font-weight: 400; }
#title h1 span { display: block; font-family: var(--display); font-size: clamp(38px, 5.6vw, 76px); letter-spacing: .02em; color: #fff;
  text-shadow: 0 0 24px rgba(80,255,120,.55), 0 4px 0 #0a3a16, 0 8px 20px rgba(0,0,0,.7); }
#title h1 em { display: block; font-style: normal; font-family: var(--display); font-size: clamp(22px, 2.8vw, 36px); letter-spacing: .3em; color: var(--green); text-shadow: 0 0 18px rgba(80,255,120,.8); margin-top: 6px; }
.lede { font-size: 18px; font-weight: 600; line-height: 1.35; margin: 0 0 16px; text-shadow: 0 2px 8px rgba(0,0,0,.9); }
.go { border: 0; border-radius: 16px; padding: 15px 28px; font-weight: 800; letter-spacing: .14em; font-size: 18px; color: #06210d;
  background: linear-gradient(135deg, #9dff7a, #2fd85a); box-shadow: 0 0 30px rgba(60,255,110,.45), 0 8px 0 #0f6b2a; transition: transform .12s; }
.go:hover { transform: translateY(-2px); } .go:active { transform: translateY(3px); box-shadow: 0 0 20px rgba(60,255,110,.4), 0 4px 0 #0f6b2a; }
.ghost { border: 1px solid rgba(255,255,255,.3); border-radius: 14px; padding: 12px 20px; background: rgba(255,255,255,.06); font-weight: 800; letter-spacing: .12em; margin-left: 8px; }
.best { margin: 12px 0 0; font-family: var(--display); letter-spacing: .12em; color: var(--gold); font-size: 20px; }
.how { list-style: none; margin: 16px 0 12px; padding: 12px 14px; background: rgba(10,6,20,.62); border: 1px solid rgba(110,255,134,.25); border-radius: 14px; backdrop-filter: blur(6px); }
.how li { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 3px 0; color: #e6e1f2; }
.how b { color: var(--green); font-weight: 800; }
.home { display: inline-block; color: #cfc6e8; font-weight: 800; letter-spacing: .08em; font-size: 14px; text-decoration: none; padding: 6px 2px; }
.home:hover { color: #fff; }
#title footer { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); font-size: 12px; font-weight: 600; letter-spacing: .14em; opacity: .7; }

#pause, #results { background: rgba(6,3,14,.6); backdrop-filter: blur(4px); }
.box { background: rgba(16,10,30,.94); border: 2px solid rgba(110,255,134,.45); border-radius: 24px; padding: 26px 28px; text-align: center; min-width: 300px;
  box-shadow: 0 0 40px rgba(60,255,110,.25), 0 20px 50px rgba(0,0,0,.6); }
.box.wide { width: min(560px, 92vw); }
.box img { width: 92px; height: 92px; border-radius: 18px; border: 2px solid var(--green); object-fit: cover; }
.box h2 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5vw, 54px); letter-spacing: .04em; margin: 6px 0 14px; color: var(--green); text-shadow: 0 0 22px rgba(80,255,120,.6); }
.rk-l { margin: 10px 0 0; font-weight: 800; letter-spacing: .3em; font-size: 12px; opacity: .7; }
.newbest { margin: -8px 0 10px; font-family: var(--display); color: var(--gold); letter-spacing: .2em; font-size: 20px; animation: pulse .5s ease-in-out infinite alternate; }
.box dl { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0 0 18px; }
.box dt { font-size: 11px; font-weight: 800; letter-spacing: .2em; color: var(--green); }
.box dd { margin: 2px 0 0; font-family: var(--display); font-size: 26px; }

#boot { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #0d0818; transition: opacity .6s; }
#boot.done { opacity: 0; pointer-events: none; }
.bt-logo { font-family: var(--display); font-size: clamp(32px, 6vw, 64px); color: var(--green); text-shadow: 0 0 26px rgba(80,255,120,.6); letter-spacing: .04em; }
.bt-msg { font-weight: 600; letter-spacing: .14em; opacity: .8; }
.bt-bar { width: 220px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.bt-bar i { display: block; height: 100%; width: 4%; background: var(--green); box-shadow: 0 0 12px var(--green); transition: width .3s; }

#rotate { display: none; }
@media (orientation: portrait) and (max-width: 820px) {
  #rotate { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #0d0818; text-align: center; padding: 30px; }
  #rotate .phone { width: 46px; height: 80px; border: 4px solid var(--green); border-radius: 10px; animation: rot 1.8s ease-in-out infinite; }
  #rotate p { font-weight: 800; letter-spacing: .08em; font-size: 18px; }
}
@keyframes rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (max-height: 520px) {
  .tcard { width: min(420px, 52vw); margin-bottom: 30px; } .how { display: none; } .lede { font-size: 15px; }
  #callout img { width: 54px; height: 54px; } .box dl { grid-template-columns: repeat(5, 1fr); } .box img { width: 60px; height: 60px; } .box { padding: 16px 20px; }
}
