/* Lot Rush — one self-hosted variable font, no third parties. */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/fredoka.woff2) format('woff2');
}

:root {
  --bg: #eef0f6;
  --ink: #2f2a3d;
  --accent: #ffd23f;
  --accent-ink: #4a3a00;
  --go: #4ccc5a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #1d1826; overflow: hidden; font-family: 'Fredoka', system-ui, sans-serif; color: var(--ink); }
body { display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; }

#stage { position: relative; width: 100vw; height: 100vh; height: 100dvh; max-width: 560px; background: var(--bg); overflow: hidden; }
@media (min-aspect-ratio: 3/4) { #stage { width: calc(100dvh * 0.56); max-width: 560px; } }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; padding-top: var(--safe-top); }
.hud-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 10px; }
.coins { pointer-events: auto; justify-self: start; display: flex; gap: 6px; align-items: center; background: #3b3450; color: #fff; font-weight: 700; padding: 4px 12px 4px 6px; border-radius: 14px; font-size: 15px; box-shadow: 0 2px 0 #211c2e; }
.coin { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2a8, #f5b800 70%); box-shadow: inset 0 0 0 2px #d69a00; vertical-align: -3px; }
.big-coin { width: 34px; height: 34px; box-shadow: inset 0 0 0 4px #d69a00; }
.level-title { color: #fff; font-weight: 700; font-size: 22px; letter-spacing: .02em; text-shadow: 0 2px 0 #4a4466, 0 0 10px rgba(0,0,0,.25); }
#speedBtn { pointer-events: auto; position: absolute; right: 8px; top: calc(var(--safe-top) + 19%); border: 0; border-radius: 10px; padding: 4px 9px; background: #fff; color: #3b3450; display: flex; flex-direction: column; align-items: center; line-height: 1; box-shadow: 0 3px 0 #c9c4d8; cursor: pointer; transform: skewX(-8deg); }
#speedBtn b { font-size: 16px; } #speedBtn small { font-size: 8px; letter-spacing: .06em; color: #e38a00; }
.boosters { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 8px); display: flex; justify-content: center; align-items: flex-end; gap: 14px; }
.booster { pointer-events: auto; position: relative; width: 62px; height: 62px; border: 3px solid #fff; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #7ec8ff, #2d7fd6 75%); color: #fff; font-size: 26px; box-shadow: 0 4px 0 #1d5fa6, 0 4px 10px rgba(0,0,0,.25); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.booster[data-booster="refresh"] { background: radial-gradient(circle at 50% 35%, #ff9a6b, #e04b2d 75%); box-shadow: 0 4px 0 #a8321d, 0 4px 10px rgba(0,0,0,.25); }
.booster[data-booster="sort"] { background: radial-gradient(circle at 50% 35%, #d49cff, #8b3fd6 75%); box-shadow: 0 4px 0 #612a9a, 0 4px 10px rgba(0,0,0,.25); }
.booster .icon { transform: translateY(-4px); }
.booster label { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 700; letter-spacing: .04em; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.5); }
.booster .count { position: absolute; top: -6px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; background: #4ccc5a; border: 2px solid #fff; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.booster.active { outline: 4px solid var(--accent); }
.booster:disabled { filter: grayscale(.8); opacity: .7; }
.gear { pointer-events: auto; width: 46px; height: 46px; border: 3px solid #fff; border-radius: 50%; background: #2d7fd6; color: #fff; font-size: 24px; box-shadow: 0 4px 0 #1d5fa6; cursor: pointer; margin-bottom: 8px; }
.menu { pointer-events: auto; position: absolute; right: 12px; bottom: calc(var(--safe-bottom) + 84px); background: #fff; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.menu[hidden] { display: none; }
.menu button { border: 0; background: #eef0f6; border-radius: 10px; padding: 10px 14px; font: 700 14px 'Fredoka', sans-serif; color: var(--ink); cursor: pointer; text-align: left; }

/* Overlays */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(29, 24, 38, .6); padding: 20px; z-index: 5; }
.overlay[hidden] { display: none; }
.card { background: #fff; border-radius: 22px; padding: 26px 22px; width: min(320px, 100%); text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.card.result { background: linear-gradient(#fff6d8, #ffe39a); border: 4px solid #5aa9ff; box-shadow: 0 0 0 4px #2d6fc9, 0 12px 30px rgba(0,0,0,.35); padding-top: 34px; position: relative; }
.ribbon { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); background: linear-gradient(#5aa9ff, #2d6fc9); color: #fff; font-weight: 700; font-size: 22px; padding: 8px 28px; border-radius: 14px; border: 3px solid #fff; box-shadow: 0 3px 0 #1d4f94; white-space: nowrap; }
.ribbon.red { background: linear-gradient(#ff7a6b, #d6382d); box-shadow: 0 3px 0 #9a2419; }
.welldone { margin: 6px 0 4px; font-size: 34px; color: #ff8a1f; text-shadow: 0 3px 0 #b85a00, 0 0 0 #fff; -webkit-text-stroke: 1px #fff; }
.reward-label { font-size: 12px; letter-spacing: .12em; color: #8a6a20; font-weight: 700; margin-top: 6px; }
.reward { font-size: 28px; font-weight: 700; margin: 6px 0 14px; display: flex; justify-content: center; align-items: center; gap: 8px; color: #4a3a00; background: rgba(255,255,255,.5); border-radius: 14px; padding: 8px; }
.card .hint { margin: 0 0 14px; color: #6a6280; font-size: 15px; }
.card .blurb { color: #6a6280; font-size: 15px; margin: 0 0 18px; }
.card .sub { margin-top: 12px; color: #8d85a0; font-size: 14px; }
.big { display: block; width: 100%; border: 0; border-radius: 16px; padding: 14px; font: 700 20px 'Fredoka', sans-serif; letter-spacing: .04em; background: var(--go); color: #fff; box-shadow: 0 5px 0 #2f9d3c; cursor: pointer; margin-top: 10px; }
.big:active { transform: translateY(3px); box-shadow: 0 2px 0 #2f9d3c; }
.big.alt { background: var(--accent); color: var(--accent-ink); box-shadow: 0 5px 0 #c99f00; font-size: 16px; }
.big.alt:active { box-shadow: 0 2px 0 #c99f00; }
.logo { display: flex; flex-direction: column; line-height: .9; margin: 4px 0 14px; }
.logo span { font-size: 56px; font-weight: 700; letter-spacing: .02em; color: #ff5a4e; text-shadow: 0 4px 0 #b83a30; }
.logo span + span { color: #3d8bff; text-shadow: 0 4px 0 #2857a8; }

#autotest-result { position: absolute; left: 0; bottom: 0; font: 11px monospace; color: #000; background: #fff; padding: 2px 4px; z-index: 9; }
