/* Página del juego dentro de Prendo Gaming: barra arriba, juego al centro, marcas abajo */
/* Letras de Prendo, servidas desde Prendo (licencia libre OFL) */
@font-face { font-family: 'Bricolage Grotesque'; src: url('../fuentes/bricolage-grotesque-latin-wght-normal.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('../fuentes/figtree-latin-wght-normal.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0f0b3b; color: #f5f5ff; font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif; }
body { display: flex; flex-direction: column; height: 100dvh; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #ff4a1c; outline-offset: 3px; border-radius: 8px; }

.j-tope { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px; }
.j-logo { display: block; width: 104px; color: #f5f5ff; }
.j-logo svg { display: block; width: 100%; height: auto; }
.j-logo .logo-pill { fill: #ff4a1c; }
.j-logo .logo-knob { fill: #ffc400; }
.j-demo { padding: 4px 10px; border-radius: 99px; background: rgb(245 245 255 / .12); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

#app { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 4px 10px; }
#game { display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; border-radius: 14px; box-shadow: 0 16px 40px rgb(0 0 0 / .5); cursor: pointer; }

.j-pie { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; padding: 8px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
.j-marcas { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.j-marcas span { opacity: .75; }
.j-marca { min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 99px; background: rgb(245 245 255 / .1); font-size: 13px; font-weight: 600; }
.j-marca:hover { background: rgb(245 245 255 / .2); }
.j-marca.activa { background: #ffc400; color: #17124f; }
.j-cta { min-height: 40px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 99px; background: #ff4a1c; color: #17124f; font-size: 14px; font-weight: 800; box-shadow: 0 10px 24px -10px rgb(255 74 28 / .8); }
.j-cta:hover { transform: translateY(-1px); }

/* Pantalla de carga: la marca mientras llegan los dibujos y las letras */
.j-carga { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #0f0b3b; transition: opacity .35s; }
.j-carga.lista { opacity: 0; pointer-events: none; }
.j-carga img { max-width: min(60vw, 240px); max-height: 110px; object-fit: contain; }
.j-carga b { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: clamp(26px, 7vw, 40px); letter-spacing: -.02em; text-align: center; padding-inline: 20px; }
.j-carga i { position: relative; width: 64px; height: 34px; border-radius: 99px; background: #ff4a1c; }
.j-carga i::after { content: ''; position: absolute; top: 5px; left: 5px; width: 24px; height: 24px; border-radius: 50%; background: #ffc400; animation: j-prende 1s ease-in-out infinite alternate; }
@keyframes j-prende { to { transform: translateX(30px); } }
@media (prefers-reduced-motion: reduce) { .j-carga i::after { animation: none; transform: translateX(30px); } }
.j-aviso { text-align: center; padding: 24px; }
.j-aviso h1, .j-demo { font-family: 'Bricolage Grotesque', sans-serif; }
.j-aviso h1 { margin: 0 0 10px; font-size: clamp(26px, 6vw, 40px); line-height: 1.1; }
.j-aviso p { margin: 0; font-size: 18px; opacity: .85; }
.j-hecho { font-size: 13px; font-weight: 600; opacity: .7; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 520px) {
    .j-marcas span { display: none; }
    .j-cta { width: 100%; justify-content: center; }
}

/* Cómo se juega y controles: escondidos en pantallas angostas (el juego ya lo explica) */
.j-como, .j-controles { display: none; }
.j-como h2, .j-controles h2 { margin: 0 0 10px; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.j-como ol { margin: 0; padding: 0; list-style: none; counter-reset: paso; display: grid; gap: 10px; }
.j-como li { counter-increment: paso; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14.5px; line-height: 1.35; color: rgb(245 245 255 / .82); }
.j-como li::before { content: counter(paso); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #ffc400; color: #17124f; font-weight: 800; font-size: 13px; }
.j-como b { color: #fff; }
.j-controles p { margin: 0; font-size: 14.5px; line-height: 1.4; color: rgb(245 245 255 / .82); }
.j-controles dl { margin: 0; display: grid; gap: 8px; font-size: 14px; }
.j-controles dl div { display: flex; align-items: center; gap: 10px; }
.j-controles dt { flex: none; min-width: 78px; }
.j-controles dd { margin: 0; color: rgb(245 245 255 / .82); }
.j-controles kbd { display: inline-block; min-width: 28px; padding: 3px 7px; border-radius: 7px; background: rgb(245 245 255 / .12); box-shadow: inset 0 -2px 0 rgb(0 0 0 / .35); font: 700 12.5px 'Figtree', sans-serif; text-align: center; }
/* Con dedo se muestra una explicación; con mouse, las teclas */
.j-controles .j-con-teclado { display: none; }
@media (hover: hover) and (pointer: fine) { .j-controles .j-con-teclado { display: grid; } .j-controles .j-con-dedo { display: none; } }

/* Computadora y tablet horizontal: el juego ocupa todo el alto y los lados se aprovechan */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
    body { display: grid; grid-template-columns: minmax(0, 1fr) min(calc((100dvh - 24px) * .6), 56vw) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 0 clamp(16px, 3vw, 44px); padding: 12px clamp(16px, 3vw, 40px); }
    .j-tope, .j-pie { flex-direction: column; align-items: flex-start; justify-content: center; gap: 22px; padding: 0; max-width: 300px; }
    .j-tope { justify-self: end; width: 100%; }
    .j-pie { flex-wrap: nowrap; }
    .j-logo { width: clamp(120px, 14vw, 180px); }
    #app { padding: 0; }
    .j-como, .j-controles { display: block; }
    .j-marcas { flex-wrap: wrap; }
    .j-marcas span { display: block; width: 100%; margin-bottom: 2px; }
    .j-cta { min-height: 46px; font-size: 15px; }
}
