/* Botigames web funnel: the game page and the demo overlay. Colours come from the game's funnel.json (theme -> CSS variables). */
:root {
  --bg: #0e1020; --bg2: #1b1f3a; --accent: #ff5a36; --accent2: #5ad9ff; --text: #f4efe6; --muted: #9aa3c7;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45; -webkit-text-size-adjust: 100%;
}
a { color: inherit; }

/* ---- page ---- */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--bg2) 0, var(--bg) 520px); }
.bf-hero { position: relative; width: 100%; max-width: 980px; margin: 0 auto; }
.bf-hero-img {
  display: block; width: 100%; aspect-ratio: 1024 / 500; max-height: 52vh; object-fit: cover;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent), linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, #000 60%, transparent), linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}
.bf-head { display: flex; align-items: center; gap: 16px; padding: 0 16px; margin-top: -12px; position: relative; }
.bf-icon { width: 88px; height: 88px; border-radius: 22%; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); flex: none; background: var(--bg2); }
.bf-ttl h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.05; letter-spacing: .01em; }
.bf-tagline { margin: 4px 0 0; color: var(--muted); font-size: 1.02rem; }
.bf-main { width: 100%; max-width: 980px; margin: 0 auto; padding: 20px 16px 24px; flex: 1; }
.bf-ctas { display: flex; flex-direction: column; align-items: stretch; gap: 12px; max-width: 460px; }
.bf-row { display: flex; flex-wrap: wrap; gap: 10px; }
.bf-row > * { flex: 1 1 180px; }
.bf-note { margin: 0; color: var(--muted); font-size: .9rem; }
.bf-desc { max-width: 640px; margin: 22px 0 8px; font-size: 1.05rem; }
.bf-feats { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bf-feats li { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); font-size: .92rem; }
.bf-shots { display: flex; gap: 12px; overflow-x: auto; padding: 22px 0 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.bf-shots img { flex: none; border-radius: 12px; scroll-snap-align: start; background: var(--bg2); box-shadow: 0 4px 18px rgba(0, 0, 0, .4); }
.bf-tall img { height: min(56vh, 420px); aspect-ratio: 9 / 16; }
.bf-wide img { height: min(40vh, 260px); aspect-ratio: 16 / 9; }
.bf-foot { text-align: center; padding: 18px 16px 28px; color: var(--muted); font-size: .85rem; }
.bf-foot a { color: var(--text); text-decoration: none; font-weight: 700; }
.bf-foot .bf-legal { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---- buttons ---- */
.bf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 18px;
  border-radius: var(--radius); border: 2px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06);
  color: var(--text); font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; text-align: center;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform .08s, filter .15s, background .15s;
}
.bf-btn:hover { filter: brightness(1.12); }
.bf-btn:active { transform: scale(.97); }
.bf-btn:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }
.bf-btn span { min-width: 0; }
.bf-btn small { font-weight: 600; opacity: .7; font-size: .8rem; }
.bf-ico { width: 20px; height: 20px; fill: currentColor; flex: none; }
.bf-big { min-height: 64px; font-size: 1.18rem; border: 0; background: var(--accent); color: var(--bg); box-shadow: 0 6px 0 rgba(0, 0, 0, .35), 0 0 32px color-mix(in srgb, var(--accent) 35%, transparent); }
.bf-big .bf-ico { width: 26px; height: 26px; }
.bf-badge { display: inline-flex; align-self: flex-start; border-radius: 10px; -webkit-tap-highlight-color: transparent; transition: transform .08s, filter .15s; }
.bf-badge img { display: block; height: 52px; width: auto; }
.bf-badge-big img { height: 64px; }
.bf-badge:hover { filter: brightness(1.15); }
.bf-badge:active { transform: scale(.97); }
.bf-badge:focus-visible { outline: 3px solid var(--accent2); outline-offset: 3px; }
.bf-row > .bf-badge { flex: none; }
.bf-card .bf-badge { align-self: center; }
.bf-pill .bf-badge img { height: 34px; }
.bf-soon { cursor: default; opacity: .65; border-style: dashed; }
.bf-soon:hover { filter: none; }
.bf-soon:active { transform: none; }

/* ---- demo: corner button and end panel ---- */
.bf-pill { position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); z-index: 40; display: flex; gap: 8px; }
.bf-pill .bf-btn { min-height: 36px; padding: 6px 12px; font-size: .85rem; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); }
.bf-pill .bf-ico { width: 16px; height: 16px; }
.bf-bar-title { display: none; }
/* a portrait game on a phone fills the screen: the store button becomes a thin bar above the game instead of covering its corner */
@media (max-aspect-ratio: 10/16) {
  body.portrait .bf-pill {
    top: 0; left: 0; right: 0; height: var(--bar-h, 46px); padding: 0 max(10px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    align-items: center; justify-content: space-between; background: var(--bg2); border-bottom: 1px solid rgba(255, 255, 255, .1);
  }
  body.portrait .bf-bar-title { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .85rem; color: var(--muted); }
  body.portrait .bf-pill { gap: 10px; }
  body.portrait .bf-pill .bf-btn { flex: none; background: var(--accent); color: var(--bg); border: 0; }
  body.portrait .bf-pill .bf-badge img { height: 34px; }
}
.bf-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); animation: bf-in .22s ease-out; }
.bf-overlay[hidden] { display: none; }
.bf-card {
  width: min(420px, 100%); max-height: calc(100% - 8px); overflow-y: auto; display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  padding: 22px 20px 18px; border-radius: 20px; background: linear-gradient(180deg, var(--bg2), var(--bg)); border: 2px solid rgba(255, 255, 255, .12);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .6); text-align: center; animation: bf-pop .32s cubic-bezier(.2, 1.4, .4, 1);
}
.bf-card .bf-icon { width: 64px; height: 64px; margin: 0 auto; }
.bf-card h2 { margin: 0; font-size: 1.5rem; }
.bf-card .bf-desc { margin: 0; font-size: .98rem; }
.bf-card .bf-feats { justify-content: center; margin: 0; }
.bf-score { display: flex; flex-direction: column; align-items: center; }
.bf-score small { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; }
.bf-score b { font-size: 2.4rem; line-height: 1; color: var(--accent); }
.bf-again { background: transparent; position: relative; overflow: hidden; }
.bf-again:disabled { cursor: default; opacity: .55; }
.bf-again:disabled:active { transform: none; }
.bf-wait::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent2); transform-origin: left; animation: bf-grace var(--grace, 2500ms) linear forwards; }
@keyframes bf-grace { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bf-opt { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .35);
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); font-size: .85rem; font-weight: 800; color: #fff; white-space: nowrap; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.bf-opt input { width: 18px; height: 18px; accent-color: var(--accent2); margin: 0; }
.bf-opt:has(input:checked) { border-color: var(--accent2); background: color-mix(in srgb, var(--accent2) 30%, rgba(0, 0, 0, .6)); }
.bf-support { max-width: 640px; margin: 18px 0 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: rgba(255, 255, 255, .05); border-radius: 0 10px 10px 0; font-size: .95rem; }
.bf-card .bf-support { margin: 0; text-align: left; font-size: .88rem; }
.bf-motivation { margin: 0; color: var(--accent2); font-weight: 700; font-size: .95rem; }
.bf-record b { animation: bf-glow 1.2s ease-in-out infinite alternate; }
.bf-record small { color: var(--accent); }
@keyframes bf-glow { from { text-shadow: 0 0 0 transparent; } to { text-shadow: 0 0 18px var(--accent); } }
.bf-gallery { overflow: hidden; margin: 0 -20px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.bf-track { display: flex; gap: 10px; width: max-content; animation: bf-scroll 20s linear infinite; }
.bf-track img { height: 150px; aspect-ratio: 9 / 16; border-radius: 10px; flex: none; background: var(--bg2); }
@keyframes bf-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes bf-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bf-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bf-overlay, .bf-card, .bf-track, .bf-record b, .bf-wait::after { animation: none; } .bf-btn { transition: none; } .bf-gallery { overflow-x: auto; } }
@media (min-width: 760px) {
  .bf-head { padding: 0 24px; margin-top: -64px; }
  .bf-icon { width: 112px; height: 112px; }
  .bf-main { padding: 26px 24px 32px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .bf-card { gap: 8px; padding: 14px 16px 12px; }
  .bf-card .bf-icon, .bf-card .bf-feats, .bf-gallery { display: none; }
  .bf-score b { font-size: 1.8rem; }
}

/* language selector: top corner of the game page, and in the bar of the demo on PC */
.bf-lang { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .25);
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px); color: #fff; cursor: pointer; }
.bf-lang .bf-ico { width: 16px; height: 16px; fill: currentColor; flex: none; }
.bf-lang select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: inherit; font: inherit; font-size: .85rem; font-weight: 800;
  padding: 6px 2px; cursor: pointer; outline: none; }
.bf-lang select option { color: #111; }
.bf-lang:focus-within { border-color: var(--accent2); }
.bf-hero { position: relative; }
.bf-hero > .bf-lang { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 2; }

/* PC: no on-screen console; the game box leaves room for the keys underneath */
html.bf-pc #stage { flex-direction: column; gap: 10px; padding: 12px 0; box-sizing: border-box; }
html.bf-pc .portrait #box { height: calc(100% - 64px); flex: none; }
.bf-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; max-width: min(860px, 96vw); color: var(--muted); font-size: .85rem; font-weight: 700; }
.bf-key { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.bf-key span { margin-left: 3px; }
.bf-key kbd { min-width: 26px; height: 26px; padding: 0 6px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid rgba(255, 255, 255, .28); border-bottom-width: 3px; background: rgba(255, 255, 255, .08); color: var(--text);
  font: 800 .8rem/1 inherit; font-family: inherit; }
