/* Blockfill — DOM screens (menu, map, settings, how-to, cards).  The game itself is drawn on the canvas. */
body.bf { background: #0F0C22; overscroll-behavior: none; touch-action: none; }
.bf .ar__cv { touch-action: none; cursor: default; }
.bf button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.bf-ic { display: inline-block; flex: none; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.bf-ic--t { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .1); font-family: var(--font-d); font-size: 1.1rem; color: var(--sun); }

/* ---------- overlay variants ---------- */
.ar__ov.bf-ov { padding: 0; overflow: auto; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.ar__ov.bf-ov--menu.show { display: grid; align-items: center; justify-items: start; padding: clamp(60px, 9vh, 120px) clamp(20px, 5vw, 100px) 24px; background: linear-gradient(90deg, rgba(15, 12, 34, .92) 0%, rgba(15, 12, 34, .7) 34%, rgba(15, 12, 34, .12) 56%, rgba(15, 12, 34, 0) 70%), linear-gradient(0deg, rgba(15, 12, 34, .55), rgba(15, 12, 34, 0) 28%); }
.ar__ov.bf-ov--panel.show { display: grid; place-items: start center; padding: calc(env(safe-area-inset-top) + 62px) 14px 18px; background: rgba(12, 9, 30, .86); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.ar__ov.bf-ov--center.show { display: grid; place-items: center; padding: 70px 16px 16px; background: rgba(12, 9, 30, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ar__ov.bf-ov--final.show { background: rgba(20, 8, 50, .38); backdrop-filter: none; -webkit-backdrop-filter: none; }
.ar__ov.bf-ov--rescue.show { display: grid; place-items: end center; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); pointer-events: none; background: linear-gradient(0deg, rgba(25, 4, 20, .55), rgba(25, 4, 20, 0) 55%); }
.bf-ov--rescue .bf-rescue { pointer-events: auto; width: min(460px, 100%); }

/* ---------- main menu ---------- */
.bf-menu { width: 100%; }
.bf-menu__l { max-width: 600px; animation: arpop .5s var(--ease); }
.bf-kicker { display: inline-flex; align-items: center; gap: .6em; font-weight: 800; font-size: clamp(.7rem, .5vw + .5rem, .95rem); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.bf-kicker i { width: 28px; height: 3px; border-radius: 3px; background: currentColor; }
.bf-title { font-family: var(--font-d); font-weight: 400; font-size: clamp(3.4rem, 10vw, 8rem); line-height: .84; margin: .12em 0 .16em; text-transform: uppercase; display: flex; flex-direction: column; letter-spacing: .01em; }
.bf-title span { display: block; width: fit-content; background-size: 260% 100%, 100% 100%; background-repeat: no-repeat; -webkit-background-clip: text; background-clip: text; color: transparent; animation: bfshine 4.5s ease-in-out infinite; }
.bf-t1 { background-image: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .95) 50%, transparent 62%), linear-gradient(180deg, #fff 0%, #9AF1FF 40%, #2FD6FF 78%, #1B93D8 100%); filter: drop-shadow(0 5px 0 #0A5E8C) drop-shadow(0 14px 24px rgba(0, 0, 0, .5)); }
.bf-t2 { background-image: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .95) 50%, transparent 62%), linear-gradient(180deg, #fff 0%, #FFD0EA 36%, #FF3D8B 76%, #C21E6B 100%); animation-delay: .35s; filter: drop-shadow(0 5px 0 #8A0F4A) drop-shadow(0 14px 24px rgba(0, 0, 0, .5)); }
@keyframes bfshine { 0% { background-position: 140% 0, 0 0; } 55%, 100% { background-position: -80% 0, 0 0; } }
.bf-tag { margin: 0 0 16px; font-size: clamp(.95rem, .5vw + .8rem, 1.2rem); font-weight: 600; color: #DCD7FF; max-width: 28em; }
.bf-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; }
.bf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1) inset; font-size: .82rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.bf-chip b { font-family: var(--font-d); font-weight: 400; color: var(--cyan); }
.bf-chip .bf-star { width: 16px; height: 16px; }
.bf-btns { display: grid; gap: 12px; max-width: 440px; }
.bf-btns .bf-row, .bf-acts .bf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bf-btns .btn--big { font-size: clamp(1.1rem, 1vw + .8rem, 1.5rem); padding: .8em 1.4em; }
.bf-btns .btn, .bf-acts .btn { width: 100%; }
.btn small { font-family: var(--font-b); font-size: .62em; font-weight: 800; opacity: .75; letter-spacing: .04em; margin-left: .3em; }

/* ---------- stars ---------- */
.bf-star { display: inline-block; width: 22px; height: 22px; }
.bf-star svg { width: 100%; height: 100%; fill: rgba(255, 255, 255, .16); stroke: rgba(255, 255, 255, .2); stroke-width: 1; stroke-linejoin: round; }
.bf-star.on svg { fill: var(--sun); stroke: #B68A00; filter: drop-shadow(0 2px 0 rgba(120, 70, 0, .5)) drop-shadow(0 0 6px rgba(255, 210, 63, .6)); }
.bf-star.big { width: clamp(46px, 11vw, 72px); height: clamp(46px, 11vw, 72px); }
.bf-star.big.on { animation: bfstar .6s calc(.35s + var(--i) * .28s) both var(--ease); }
.bf-star.big:not(.on) svg { fill: rgba(255, 255, 255, .1); }
@keyframes bfstar { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 60% { transform: scale(1.35) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }

/* ---------- panels: map / settings / how ---------- */
.bf-panel { width: min(1180px, 100%); animation: arpop .35s var(--ease); }
.bf-panel.bf-small { width: min(640px, 100%); }
.bf-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin: 0 0 16px; }
.bf-head h2 { margin: 0; font-family: var(--font-d); font-weight: 400; font-size: clamp(1.4rem, 3vw, 2.2rem); text-align: center; text-transform: uppercase; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.bf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.bf-card { --ac: #fff; position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 20px; overflow: hidden; text-align: left; aspect-ratio: 16 / 11; background: #1B1540; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12) inset, 0 12px 28px rgba(0, 0, 0, .4); transition: transform .15s var(--ease), box-shadow .15s; color: #fff; }
.bf-card:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 0 0 2.5px var(--ac) inset, 0 18px 34px rgba(0, 0, 0, .5); }
.bf-card.cur { box-shadow: 0 0 0 3px var(--ac) inset, 0 0 26px color-mix(in srgb, var(--ac) 55%, transparent), 0 12px 28px rgba(0, 0, 0, .4); animation: bfcur 1.8s ease-in-out infinite; }
@keyframes bfcur { 50% { transform: translateY(-3px); } }
.bf-card__cv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bf-card.locked .bf-card__cv { filter: grayscale(.9) brightness(.45); }
.bf-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 6, 30, .92) 0%, rgba(10, 6, 30, .35) 46%, rgba(10, 6, 30, 0) 70%); pointer-events: none; }
.bf-card__num { position: absolute; z-index: 2; left: 10px; top: 8px; min-width: 38px; height: 38px; padding: 0 8px; display: grid; place-items: center; border-radius: 12px; background: var(--ac); color: #1B1235; font-family: var(--font-d); font-size: 1.25rem; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.bf-card__info { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 34px; display: grid; gap: 1px; }
.bf-card__info b { font-family: var(--font-d); font-weight: 400; font-size: 1.02rem; line-height: 1.05; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); text-transform: uppercase; }
.bf-card__info small { font-size: .74rem; font-weight: 700; color: #E3DEFF; opacity: .92; }
.bf-card__stars { position: absolute; z-index: 2; left: 10px; bottom: 8px; display: flex; gap: 2px; }
.bf-card__stars .bf-star { width: 20px; height: 20px; }
.bf-card__lock { position: absolute; z-index: 3; right: 10px; top: 10px; width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: rgba(15, 12, 34, .75); color: #fff; }
.bf-card--end { background: linear-gradient(135deg, #3A2A8A, #FF3D8B); }
.bf-shake { animation: bfshk .35s; }
@keyframes bfshk { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.bf-list { display: grid; gap: 10px; }
.bf-set { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .08) inset; }
.bf-set b { display: block; font-weight: 800; }
.bf-set small { display: block; color: var(--mute); font-weight: 600; font-size: .78rem; }
.bf-sw { position: relative; flex: none; width: 56px; height: 32px; border: 0; padding: 0; border-radius: 99px; background: #3a3466; transition: background .15s; }
.bf-sw i { position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); transition: transform .15s var(--ease); }
.bf-sw.on { background: var(--lime); }
.bf-sw.on i { transform: translateX(24px); }
.bf-seg { display: inline-flex; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .15) inset; }
.bf-seg button { border: 0; padding: .6em 1em; background: transparent; font-weight: 800; color: var(--paper); min-height: 44px; }
.bf-seg button.on { background: var(--cyan); color: var(--ink); }
.bf-seg button.bad { background: var(--orange); color: #fff; }

.bf-how { display: grid; gap: 10px; }
.bf-how h3 { margin: 10px 0 0; font-family: var(--font-d); font-weight: 400; font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; color: var(--cyan); }
.bf-how__i { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .07); }
.bf-how__i b { display: block; font-weight: 800; }
.bf-how__i span { color: #CFC9F5; font-size: .88rem; font-weight: 600; line-height: 1.35; display: block; }
.bf-how__p { display: flex; gap: 12px; justify-content: center; padding: 6px 0; }
.bf-how__t { margin: 0; color: #CFC9F5; font-weight: 600; font-size: .9rem; line-height: 1.45; }
.bf-how__t b { color: #fff; }
.bf-how kbd { margin: 0 3px; }

/* ---------- dialogs ---------- */
.bf-card-ov { display: grid; place-items: center; width: 100%; }
.bf-dlg { --ac: var(--cyan); width: min(520px, 100%); text-align: center; padding: 26px 26px 22px; border-radius: 28px; background: linear-gradient(180deg, #2A2260, #1B1540); box-shadow: 0 0 0 2px rgba(255, 255, 255, .12) inset, 0 30px 80px rgba(0, 0, 0, .55); animation: arpop .35s var(--ease); }
.bf-dlg .bf-kicker { color: var(--ac); margin-bottom: 4px; }
.bf-dlg h2 { margin: 0 0 4px; font-family: var(--font-d); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1; text-transform: uppercase; text-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.bf-sub { margin: 0 0 12px; color: #CFC9F5; font-weight: 700; }
.bf-bigstars { display: flex; justify-content: center; gap: 8px; margin: 10px 0 6px; }
.bf-bigstars .bf-star:nth-child(2) { transform: translateY(-8px); }
.bf-score { font-family: var(--font-d); font-size: clamp(2.8rem, 9vw, 4.4rem); line-height: 1; color: var(--ac); text-shadow: 0 5px 0 rgba(0, 0, 0, .4); font-variant-numeric: tabular-nums; margin-top: 4px; }
.bf-scorelab { font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); margin-bottom: 4px; }
.bf-badge { display: inline-block; margin: 6px 0; padding: .35em 1em; border-radius: 999px; background: var(--sun); color: var(--ink); font-family: var(--font-d); font-size: .85rem; letter-spacing: .04em; transform: rotate(-3deg); box-shadow: 0 3px 0 #B68A00; animation: arpop .5s .25s both var(--ease); }
.bf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 14px 0 12px; }
.bf-stat { padding: 9px 6px; border-radius: 14px; background: rgba(255, 255, 255, .07); line-height: 1.1; }
.bf-stat small { display: block; font-size: .6rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); margin-bottom: 3px; }
.bf-stat b { font-family: var(--font-d); font-weight: 400; font-size: 1.2rem; }
.bf-note { margin: 0 0 14px; color: var(--mute); font-weight: 700; font-size: .84rem; }
.bf-acts { display: grid; gap: 10px; }
.bf-dlg--rescue { width: 100%; padding: 18px 18px 16px; border-radius: 24px; background: linear-gradient(180deg, rgba(60, 20, 70, .96), rgba(32, 12, 50, .97)); box-shadow: 0 0 0 2px rgba(255, 110, 110, .5) inset, 0 20px 60px rgba(0, 0, 0, .55); }
.bf-dlg--rescue h2 { color: #FF8A7A; font-size: clamp(1.4rem, 4.5vw, 2rem); }

/* ---------- phones / short screens ---------- */
@media (max-width: 760px) {
  .ar__ov.bf-ov--menu.show { justify-items: center; padding-top: calc(env(safe-area-inset-top) + 64px); background: linear-gradient(0deg, rgba(15, 12, 34, .94) 0%, rgba(15, 12, 34, .8) 48%, rgba(15, 12, 34, .22) 100%); align-items: end; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .bf-menu__l { text-align: center; }
  .bf-kicker { justify-content: center; }
  .bf-title { align-items: center; font-size: clamp(2.8rem, 15vw, 5rem); flex-direction: row; gap: .12em; flex-wrap: wrap; justify-content: center; }
  .bf-chips { justify-content: center; }
  .bf-btns { margin-inline: auto; }
  .bf-tag { margin-inline: auto; }
  .bf-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .bf-card__info b { font-size: .8rem; } .bf-card__info small { font-size: .66rem; } .bf-card__num { min-width: 32px; height: 32px; font-size: 1rem; }
  .bf-card__info { bottom: 30px; } .bf-card__stars .bf-star { width: 17px; height: 17px; }
}
@media (max-height: 560px) {
  .ar__ov.bf-ov--menu.show { padding-top: 52px; padding-bottom: 8px; align-items: center; justify-items: start; background: linear-gradient(90deg, rgba(15, 12, 34, .94) 0%, rgba(15, 12, 34, .75) 50%, rgba(15, 12, 34, .1) 78%); }
  .bf-menu__l { text-align: left; max-width: 380px; }
  .bf-kicker { justify-content: flex-start; font-size: .62rem; }
  .bf-title { flex-direction: row; gap: .14em; font-size: clamp(2rem, 9vh, 3.2rem); margin: .05em 0; justify-content: flex-start; }
  .bf-tag { display: none; }
  .bf-chips { margin-bottom: 8px; justify-content: flex-start; } .bf-chip { padding: 4px 10px; font-size: .72rem; }
  .bf-btns { gap: 7px; max-width: 360px; margin-inline: 0; } .bf-btns .btn--big { padding: .55em 1em; font-size: 1rem; } .bf-btns .btn { padding: .55em 1em; font-size: .9rem; } .bf-btns .btn--sm { padding: .5em .8em; }
  .ar__ov.bf-ov--panel.show { padding-top: 54px; } .bf-head { margin-bottom: 10px; }
  .ar__ov.bf-ov--center.show { padding-top: 48px; align-items: start; }
  .bf-dlg { padding: 14px 18px; } .bf-bigstars { margin: 2px 0; } .bf-star.big { width: 38px; height: 38px; } .bf-score { font-size: 2.2rem; } .bf-stats { margin: 8px 0; } .bf-note { display: none; } .bf-acts { gap: 6px; } .bf-acts .btn--big { padding: .5em 1em; font-size: 1rem; }
  .bf-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .ar__top { padding: 6px 8px; } .ar__tool { width: 38px; height: 38px; border-radius: 11px; } .ar__home img { width: 28px; height: 28px; } .ar__tools { gap: 6px; }
}
@media (max-height: 500px) and (min-width: 761px) {
  .bf-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .bf-title span, .bf-card.cur { animation: none; }
}
