/* KytePush Games — shared look. Brand: black / white / violet, Geist. */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=Geist+Mono:wght@500;700&display=swap");

:root {
  --bg: #0A0A0B;
  --bg-2: #131316;
  --bg-3: #1C1C21;
  --line: #2A2A31;
  --text: #F5F5F7;
  --muted: #9A9AA6;
  --violet: #8B6DFF;
  --violet-2: #B3A0FF;
  --good: #3DDC97;
  --warn: #FFB547;
  --bad: #FF5C6C;
  --radius: 16px;
  --bar-h: 52px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body:not(.kp-game) { padding-top: env(safe-area-inset-top); }
/* In the iOS/Android app the status bar overlays the page: keep a solid strip behind it. Zero height on the web. */
body:not(.kp-game)::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--bg); z-index: 100; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: inherit; }

/* Game pages: full-viewport, no scroll, no text selection, no double-tap zoom. */
body.kp-game {
  height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
.kp-stage { flex: 1; position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }
.kp-stage canvas { display: block; touch-action: none; }

/* Header bar */
.kp-bar {
  height: var(--bar-h); flex: none; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--bg);
  position: relative; z-index: 5;
}
.kp-back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; padding: 8px 6px; border-radius: 10px; }
.kp-back:hover { color: var(--text); }
.kp-title { flex: 1; text-align: center; font-weight: 700; letter-spacing: -0.01em; font-size: 16px; margin-right: 34px; }
.kp-icon { background: none; border: 0; padding: 8px; border-radius: 10px; color: var(--muted); cursor: pointer; display: inline-flex; }
.kp-icon:hover { color: var(--text); background: var(--bg-3); }
.kp-bar .kp-icon { position: absolute; right: 8px; }

/* HUD pills games may use */
.kp-hud { position: absolute; top: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; pointer-events: none; z-index: 2; }
.kp-pill { background: rgba(19,19,22,.82); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-family: var(--mono); font-size: 14px; font-weight: 700; backdrop-filter: blur(6px); }
.kp-pill small { color: var(--muted); font-family: var(--font); font-weight: 500; margin-right: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

/* Overlay card */
.kp-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(10,10,11,.72); backdrop-filter: blur(4px); animation: kpfade .18s ease-out;
}
.kp-card {
  width: 100%; max-width: 380px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px;
  padding: 24px 22px 20px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: kppop .22s cubic-bezier(.2,1.4,.4,1);
}
.kp-kicker { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--violet-2); margin-bottom: 6px; }
.kp-h { margin: 0 0 8px; font-size: 26px; letter-spacing: -0.02em; font-weight: 800; }
.kp-body { color: var(--muted); font-size: 15px; line-height: 1.5; }
.kp-body b, .kp-body strong { color: var(--text); }
.kp-big { font-family: var(--mono); font-size: 48px; font-weight: 700; color: var(--text); line-height: 1.1; margin: 6px 0 2px; }
.kp-stats { display: flex; justify-content: center; gap: 22px; margin: 12px 0 4px; }
.kp-stats div { display: flex; flex-direction: column; }
.kp-stats span { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--text); }
.kp-stats label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.kp-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.kp-btn {
  border: 1px solid var(--line); background: var(--bg-3); border-radius: 14px; padding: 13px 16px;
  font-weight: 600; font-size: 15px; cursor: pointer; transition: transform .08s, background .15s;
}
.kp-btn:hover { background: #24242b; }
.kp-btn:active { transform: scale(.98); }
.kp-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.kp-primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.kp-primary:hover { background: #9b80ff; }
.kp-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.kp-ghost:hover { background: var(--bg-3); color: var(--text); }
.kp-btn .kp-ad-tag { font-size: 10px; font-weight: 700; letter-spacing: .08em; background: rgba(255,255,255,.18); border-radius: 6px; padding: 2px 6px; margin-left: 6px; vertical-align: 1px; }
.kp-foot { margin-top: 14px; font-size: 12px; color: var(--muted); }
.kp-new { display: inline-block; background: var(--violet); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; margin-bottom: 6px; }

.kp-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  opacity: 0; transition: .2s; z-index: 60; pointer-events: none;
}
.kp-toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes kpfade { from { opacity: 0; } }
@keyframes kppop { from { transform: scale(.94); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .kp-overlay, .kp-card { animation: none; } }

/* Leaderboard + account */
.kp-bar .kp-trophy { right: 48px; }
.kp-bar .kp-title { margin-right: 74px; margin-left: 40px; }
.kp-lb-layer { z-index: 70; }
.kp-lb-card { max-width: 400px; text-align: left; }
.kp-lb-card .kp-kicker, .kp-lb-card .kp-h { text-align: center; }
.kp-tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 10px 0 12px; }
.kp-tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; padding: 9px 4px; border-radius: 9px; cursor: pointer; min-height: 36px; }
.kp-tabs button[aria-selected="true"] { background: var(--bg-3); color: var(--text); }
.kp-lb-wrap { min-height: 120px; }
.kp-lb { list-style: none; margin: 0; padding: 0; }
.kp-lb li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 15px; }
.kp-lb li:nth-child(odd) { background: rgba(255,255,255,.03); }
.kp-lb li.me { background: rgba(139,109,255,.18); color: #fff; }
.kp-lb li.gap { margin-top: 6px; border-top: 1px dashed var(--line); border-radius: 0 0 10px 10px; }
.kp-lb .r { width: 26px; font-family: var(--mono); font-weight: 700; color: var(--muted); text-align: right; }
.kp-lb li:nth-child(1) .r { color: #FFD166; } .kp-lb li:nth-child(2) .r { color: #D7DCE3; } .kp-lb li:nth-child(3) .r { color: #E8A273; }
.kp-lb .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-lb .s { font-family: var(--mono); font-weight: 700; }
.kp-lb-empty { color: var(--muted); text-align: center; padding: 34px 0; font-size: 14px; }
.kp-acct { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); text-align: center; }
.kp-acct b { color: var(--text); }
.kp-acct-sub { font-size: 12px; margin-top: 8px; line-height: 1.45; }
.kp-link { background: none; border: 0; padding: 4px 2px; color: var(--violet-2); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.kp-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 12px; background: #fff; color: #1f1f1f; border-color: #fff; min-height: 46px; }
.kp-google:hover { background: #f1f1f1; }
.kp-lb .n small { margin-left: 8px; font-size: 12px; font-weight: 500; opacity: .6; }
.kp-lb-all { display: block; text-align: center; margin: 12px 0 0; font-size: 14px; font-weight: 600; color: var(--violet-2); text-decoration: underline; text-underline-offset: 3px; }
/* Never let a long name or wide row push the page sideways. */
.kp-lb, .kp-lb li, .kp-card { min-width: 0; max-width: 100%; }
html { overflow-x: clip; }

/* ---------- Game cards v3: art-led start screen, bottom sheet on phones, chunky buttons ---------- */
.kp-overlay { background: rgba(8, 7, 14, .55); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); }
.kp-card {
  max-width: 400px; border-radius: 28px; border: 0; padding: 22px 22px 20px;
  background: linear-gradient(180deg, #1D1B26 0%, #15141B 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 30px 90px rgba(0,0,0,.55);
  animation: kpsheet .38s cubic-bezier(.2, 1.2, .3, 1);
}
.kp-has-art { padding-top: 0; overflow: hidden; }
.kp-art { position: relative; margin: 0 -22px 14px; aspect-ratio: 16 / 9; overflow: hidden; background: #222; }
.kp-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: kpdrift 14s ease-in-out infinite alternate; }
.kp-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, #1D1B26 100%); }
.kp-kicker { display: inline-block; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; color: #E5F49C; background: rgba(229, 244, 156, .12); border-radius: 999px; padding: 5px 12px; margin: 0 0 10px; }
.kp-has-art .kp-kicker { position: relative; z-index: 1; margin-top: -30px; background: #E5F49C; color: #19142B; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.kp-h { font-size: 34px; letter-spacing: -0.04em; line-height: 1.02; margin: 0 0 10px; }
.kp-body { font-size: 15.5px; color: #B7B4C4; }
.kp-chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 0 0 12px; }
.kp-chip { font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 5px 11px; background: rgba(255,255,255,.07); color: #D8D6E2; }
.kp-chip-pts { background: rgba(124, 92, 255, .2); color: #CFC3FF; }
.kp-actions { gap: 10px; margin-top: 20px; }
.kp-btn { border-radius: 16px; min-height: 50px; }
.kp-primary {
  background: linear-gradient(180deg, #8F74FF 0%, #6E4CFF 100%); border: 0; color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
  min-height: 58px; border-radius: 18px; box-shadow: 0 6px 0 #4527C8, 0 14px 28px rgba(110, 76, 255, .38); transform: translateY(0);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.kp-primary:hover { background: linear-gradient(180deg, #9C84FF 0%, #7A5BFF 100%); filter: brightness(1.04); }
.kp-primary:active { transform: translateY(5px); box-shadow: 0 1px 0 #4527C8, 0 6px 14px rgba(110, 76, 255, .3); }
.kp-has-art .kp-actions .kp-primary:first-child { animation: kpbreathe 2.4s ease-in-out 1s infinite; }
.kp-ghost { min-height: 44px; font-weight: 650; }
.kp-btn:not(.kp-primary):not(.kp-ghost) { background: rgba(255,255,255,.07); border: 0; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.kp-btn:not(.kp-primary):not(.kp-ghost):active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.kp-foot { color: #8D8A9B; }
@media (hover: none), (pointer: coarse) { .kp-foot.kp-kbd { display: none; } }
@media (max-width: 560px) {
  .kp-overlay { align-items: flex-end; padding: 0; }
  .kp-card { max-width: none; border-radius: 28px 28px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); animation: kpsheetup .42s cubic-bezier(.2, 1.15, .3, 1); }
  .kp-card::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); margin: 0 auto 14px; }
  .kp-has-art::before { position: absolute; left: 50%; margin-left: -20px; top: 8px; z-index: 2; background: rgba(255,255,255,.55); }
  .kp-has-art { position: relative; }
  .kp-lb-card { max-height: 88vh; overflow-y: auto; }
}
@keyframes kpsheet { from { transform: translateY(18px) scale(.97); opacity: 0; } }
@keyframes kpsheetup { from { transform: translateY(100%); } }
@keyframes kpdrift { to { transform: scale(1.12) translate(-2%, -2%); } }
@keyframes kpbreathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(0) scale(1.025); } }
@media (prefers-reduced-motion: reduce) { .kp-card, .kp-art img, .kp-has-art .kp-actions .kp-primary:first-child { animation: none; } }

/* After-game points strip (top of every card after the start screen) */
.kp-sum { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 9px 12px; border-radius: 14px; background: rgba(124, 92, 255, .16); color: #E6E0FF; font-size: 13.5px; text-decoration: none; text-align: left; }
.kp-sum b { font-family: var(--mono); font-size: 15px; color: #fff; }
.kp-sum-pts { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-sum-rk { font-family: var(--mono); font-weight: 700; color: #E5F49C; }
.kp-sum-go { font-weight: 700; font-size: 12.5px; background: rgba(255,255,255,.1); border-radius: 999px; padding: 4px 10px; }
.kp-has-art .kp-sum { position: relative; z-index: 1; }
.kp-menu { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--muted); }
/* Challenge banner when arriving from a friend's link */
.kp-challenge { position: fixed; z-index: 45; left: 50%; top: calc(var(--bar-h) + env(safe-area-inset-top) + 10px); transform: translateX(-50%); width: min(92vw, 420px);
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 18px; background: #E5F49C; color: #19142B; font-weight: 700; font-size: 15px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35); animation: kpchin .5s cubic-bezier(.2, 1.3, .3, 1); }
.kp-challenge span:nth-child(2) { flex: 1; min-width: 0; }
.kp-challenge button { border: 0; background: rgba(25,20,43,.1); border-radius: 999px; width: 30px; height: 30px; cursor: pointer; flex: none; }
.kp-ch-ic { font-size: 20px; }
.kp-challenge.kp-ch-small { font-size: 13px; padding: 8px 10px; opacity: .92; }
@keyframes kpchin { from { transform: translate(-50%, -30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .kp-challenge { animation: none; } }
/* Short screens: the card never runs off-screen; it scrolls, and the cover art steps aside */
.kp-card { max-height: calc(100dvh - 24px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain; }
@media (max-height: 640px) { .kp-art { display: none; } .kp-has-art { padding-top: 22px; } .kp-has-art .kp-kicker { margin-top: 0; background: rgba(229,244,156,.12); color: #E5F49C; box-shadow: none; } }
@media (max-height: 640px) and (max-width: 560px) { .kp-has-art { padding-top: 0; } }

/* Kids mode (Kyte Kids build, or ?from=kytekids): continues and hints are free, so no ad tag. */
.kp-kids .kp-ad-tag { display: none; }
