/* BitGame Play — pantalla de carga común de todos los juegos (games/_kit/loader, 27-11-2026).
   Cada juego pone en su index.html su escena (.bgl-bg), su héroe 3D, su logo y sus colores (variables de .bgl);
   aquí va lo común: el orden, la barra de energía con porcentaje y etapa, los consejos, «by BitGame 2.0» y la salida.
   Ver la cabecera de loader.js para el marcado. */
@font-face { font-family: 'Lilita One'; src: url('/games/_vendor/fonts/lilita-one-latin.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/games/_vendor/fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

.bgl {
  --a: #2fc6ff; --a2: #ffd23f; --glow: rgba(47, 198, 255, .75); --sub: rgba(255, 255, 255, .84); --chip: rgba(8, 12, 30, .5);
  position: fixed; inset: 0; z-index: 50; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px 16px 70px; box-sizing: border-box;
  font-family: 'Inter', system-ui, sans-serif; color: #fff; background: #05070f;
  transition: opacity .6s ease, transform .75s cubic-bezier(.55, 0, .35, 1), filter .75s ease;
  -webkit-user-select: none; user-select: none;
}
.bgl * { box-sizing: border-box; }
.bgl.out { opacity: 0; transform: scale(1.14); filter: blur(5px) brightness(1.5); pointer-events: none; }
.bgl > * { position: relative; z-index: 2; }
.bgl > .bgl-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.bgl > .bgl-fx { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
.bgl-bg i { position: absolute; display: block; }

/* Héroe (el vehículo 3D del juego) y logo, que se montan un poco */
.bgl-hero { width: min(62vw, 360px); margin-bottom: -34px; animation: bglIn .8s cubic-bezier(.2, 1.3, .4, 1) both; }
.bgl-hero img { display: block; width: 100%; height: auto; filter: drop-shadow(0 22px 24px rgba(0, 0, 0, .5)); animation: bglFloat 2.8s ease-in-out infinite; }
.bgl-logo { position: relative; width: min(86vw, 560px, 82vh); animation: bglIn .9s .12s cubic-bezier(.2, 1.4, .4, 1) both; }
.bgl-logo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .45)); }
/* Destello que recorre el logo (con su propia forma como máscara) */
.bgl-logo .bgl-shine { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;                  /* la imagen de la máscara la pone loader.js */
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .75) 48%, rgba(255, 255, 255, .15) 54%, transparent 62%);
  background-size: 260% 100%; background-repeat: no-repeat; animation: bglShine 3.2s ease-in-out 1s infinite; mix-blend-mode: screen; }

/* Barra de energía: 20 celdas, etapa y porcentaje */
.bgl-gauge { width: min(340px, 82vw); margin-top: 18px; animation: bglIn .8s .25s ease both; }
.bgl-cells { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; height: 21px; padding: 4px; border-radius: 11px;
  background: var(--chip); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 8px 24px rgba(0, 0, 0, .25); }
.bgl-cells i { border-radius: 3px; background: rgba(255, 255, 255, .12); transition: background .3s, box-shadow .3s, transform .3s; }
.bgl-cells i.on { background: var(--a); box-shadow: 0 0 9px var(--glow); }
.bgl-cells i.hot { background: #fff; box-shadow: 0 0 12px #fff; animation: bglBlink .5s ease-in-out infinite alternate; }
.bgl-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.bgl-stage { font-size: 13px; font-weight: 700; letter-spacing: .01em; color: var(--sub); text-align: left; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.bgl-pct { font-family: 'Lilita One', system-ui, sans-serif; font-weight: 400; font-size: 23px; line-height: 1; color: var(--a2);
  min-width: 62px; text-align: right; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums; }

/* Consejos que van rotando */
.bgl-tip { margin-top: 16px; display: flex; align-items: center; gap: 11px; max-width: min(420px, 88vw); min-height: 52px;
  padding: 8px 14px 8px 8px; border-radius: 16px; background: var(--chip); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: bglIn .8s .35s ease both; }
.bgl-tip:empty { display: none; }
.bgl-tip .ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--a); overflow: hidden; transition: opacity .35s, transform .35s; }
.bgl-tip .ic img { width: 100%; height: 100%; object-fit: cover; }
.bgl-tip .ic svg { width: 21px; height: 21px; }
.bgl-tip p { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.38; text-align: left; transition: opacity .35s, transform .35s; }
.bgl-tip.swap p, .bgl-tip.swap .ic { opacity: 0; transform: translateY(6px); }

/* «by BitGame 2.0»: pequeño, abajo */
.bgl-by { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 13px; border-radius: 999px; white-space: nowrap;
  background: var(--chip); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.bgl-by span { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--sub); }
.bgl-by img { display: block; height: 38px; width: auto; }

@keyframes bglFloat { 0%, 100% { transform: translateY(0) rotate(-1.6deg); } 50% { transform: translateY(-10px) rotate(1.6deg); } }
@keyframes bglIn { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes bglShine { 0% { background-position: 130% 0; } 55%, 100% { background-position: -40% 0; } }
@keyframes bglBlink { from { opacity: .55; } to { opacity: 1; } }

/* Pantallas bajas (el marco del juego dentro de Play mide ~600 px en el ordenador): todo más compacto, con #bgl para
   ganar a los tamaños propios de cada juego. Los consejos se quitan solo cuando de verdad no caben. */
@media (max-height: 640px) {
  #bgl { padding-top: 14px; }
  #bgl .bgl-hero { width: min(44vw, 230px); margin-bottom: -20px; }
  #bgl .bgl-logo { width: min(74vw, 380px); }
  #bgl .bgl-gauge { margin-top: 12px; }
  #bgl .bgl-tip { margin-top: 12px; }
}
@media (max-height: 540px) { #bgl .bgl-tip { display: none; } }
@media (max-height: 460px) { #bgl .bgl-hero { display: none; } #bgl { padding-bottom: 56px; } }
@media (prefers-reduced-motion: reduce) {
  .bgl-hero img, .bgl-logo .bgl-shine, .bgl-cells i.hot, .bgl-bg i { animation: none !important; }
  .bgl-hero, .bgl-logo, .bgl-gauge, .bgl-tip { animation-duration: .01s; }
}

/* Coreano: ni «Lilita One» ni «Inter» (las letras de los juegos) tienen hangul. Solo para esos caracteres se usa la letra
   coreana que ya trae cada sistema (Windows, Apple, Android); no se descarga nada. Vale para la pantalla de carga y para
   el juego. Las líneas se parten entre palabras, no en medio de una. */
@font-face { font-family: 'Lilita One'; font-weight: 400; src: local('Malgun Gothic Bold'), local('MalgunGothicBold'), local('Apple SD Gothic Neo ExtraBold'), local('AppleSDGothicNeo-ExtraBold'),
    local('Apple SD Gothic Neo Bold'), local('AppleSDGothicNeo-Bold'), local('Noto Sans KR Bold'), local('NotoSansKR-Bold'),
    local('Noto Sans CJK KR Bold'), local('NotoSansCJKkr-Bold');
  unicode-range: U+1100-11FF, U+3130-318F, U+A960-A97F, U+AC00-D7FF; }
@font-face { font-family: 'Inter'; font-weight: 600 900; src: local('Malgun Gothic Bold'), local('MalgunGothicBold'), local('Apple SD Gothic Neo ExtraBold'), local('AppleSDGothicNeo-ExtraBold'),
    local('Apple SD Gothic Neo Bold'), local('AppleSDGothicNeo-Bold'), local('Noto Sans KR Bold'), local('NotoSansKR-Bold'),
    local('Noto Sans CJK KR Bold'), local('NotoSansCJKkr-Bold');
  unicode-range: U+1100-11FF, U+3130-318F, U+A960-A97F, U+AC00-D7FF; }
@font-face { font-family: 'Inter'; font-weight: 100 500; src: local('Malgun Gothic'), local('MalgunGothic'), local('Apple SD Gothic Neo Medium'), local('AppleSDGothicNeo-Medium'),
    local('Apple SD Gothic Neo Regular'), local('AppleSDGothicNeo-Regular'), local('Noto Sans KR'), local('NotoSansKR-Regular'),
    local('Noto Sans CJK KR'), local('NotoSansCJKkr-Regular');
  unicode-range: U+1100-11FF, U+3130-318F, U+A960-A97F, U+AC00-D7FF; }
html:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
