/* WEB-PLAY (W15): la pagina del juego. Colores y tonos: GUIA_ESTILO_MU_PAPRIOKA.md (piedra negra, hierro forjado, oro viejo). Las piezas dibujadas (marco, barra, piedra,
   logo) son las de la web publica, recortadas por tools\webplay\shell\build_art.py. Nada en linea: la CSP no lo deja. */
@font-face { font-family: Cinzel; src: url(cinzel.woff2) format("woff2"); font-weight: 700; font-display: swap; }
:root {
	--hundido: #080907; --metal-s: #876d59; --grabado: #e6c068; --oro: #faac43;
	--texto: #d9ceb8; --valor: #f3d68f; --suave: #b9ae98; --apagado: #8e8475;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #000; color: var(--texto); font: 15px/1.5 Tahoma, Verdana, "DejaVu Sans", sans-serif; }
p { margin: 0; }

/* ---------- el lienzo: la medida la pone main.js (la mas grande que entra sin deformar) */
#lienzo { position: fixed; inset: 0; margin: auto; display: block; width: 0; height: 0; background: #000; outline: 0; touch-action: none; user-select: none; }

/* ---------- la carga */
#carga {
	position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; text-align: center;
	background:
		radial-gradient(60% 75% at 22% 38%, #4a0c1166, transparent 70%),
		radial-gradient(60% 75% at 78% 38%, #0d1f4a66, transparent 70%),
		radial-gradient(90% 90% at 50% 50%, transparent 45%, #000c 100%),
		#111110 url(piedra.webp);
	transition: opacity .45s;
}
#carga.se-va { opacity: 0; pointer-events: none; }
#logo { width: min(400px, 62vw, 62vh); height: auto; margin-bottom: 2vh; filter: drop-shadow(0 10px 28px #000); }
.barra { position: relative; flex: none; width: min(760px, 94vw); height: 54px; border: 0 solid transparent; border-width: 0 145px; border-image: url(barra.webp) 0 220 fill / 0 145px stretch; filter: drop-shadow(0 6px 14px #000); }
.canal { position: absolute; left: -54px; right: -54px; top: 23px; bottom: 8px; overflow: hidden; border-radius: 2px; }
#relleno {
	display: block; width: 0; height: 100%; transition: width .18s linear;
	background: linear-gradient(#f7dd82, #fca73c 22%, #d28b37 52%, #9f621e 82%, #5e380f);
	box-shadow: 0 0 10px #fca73c66, inset 0 1px 0 #fff3c466;
}
/* sin total conocido: el oro va y viene */
#carga.sin-total #relleno { width: 32% !important; animation: vaiven 1.7s ease-in-out infinite alternate; }
@keyframes vaiven { from { margin-left: 0; } to { margin-left: 68%; } }
#carga-que { margin-top: 14px; font: 700 20px/1.3 Cinzel, Georgia, serif; color: var(--grabado); text-shadow: 0 0 1px #000, 0 2px 4px #000; letter-spacing: .02em; }
#carga-cuanto { min-height: 1.5em; color: var(--valor); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
#carga-nota { max-width: 560px; margin-top: 10px; color: #ffb06a; font-size: 14px; }
#carga-boton { margin-top: 14px; }
#carga-dev { position: absolute; left: 10px; bottom: 8px; color: var(--apagado); font-size: 12px; text-align: left; }
/* W53 (Fable M1): el aviso sin JS (index.html): invisible 15 s; main.js lo saca apenas corre */
#carga-sin-js { max-width: 560px; margin-top: 10px; color: #ffb06a; font-size: 14px; opacity: 0; animation: sin-js-aparece .4s 15s forwards; }
@keyframes sin-js-aparece { to { opacity: 1; } }

/* ---------- carteles */
#cartel { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 12px; background: #000a; overflow: auto; }
#cartel.opaco { background: radial-gradient(90% 90% at 50% 50%, transparent 35%, #000d 100%), #111110 url(piedra.webp); }
.marco {
	position: relative; width: min(620px, 100%); margin: auto; border: 0 solid transparent; border-width: 110px 69px 87px;
	border-image: url(marco.webp) 110 69 87 fill / 110px 69px 87px stretch; background: #050606 padding-box; filter: drop-shadow(0 18px 50px #000);
}
.marco h1 {
	position: absolute; left: -34px; right: -34px; top: -62px; height: 42px; margin: 0; display: flex; align-items: center; justify-content: center; text-align: center;
	font: 700 22px/1.1 Cinzel, Georgia, serif; color: var(--grabado); text-shadow: 0 0 1px #000, 0 2px 3px #000;
}
.cuerpo { margin: -8px -30px -44px; text-align: center; }
#cartel-texto { white-space: pre-line; }
#cartel-lista { margin: 12px auto 0; padding: 0; max-width: 470px; list-style: none; text-align: left; }
#cartel-lista li { position: relative; margin: 6px 0; padding-left: 20px; }
#cartel-lista li::before { content: ""; position: absolute; left: 3px; top: .48em; width: 7px; height: 7px; transform: rotate(45deg); background: linear-gradient(135deg, #f7dd82, #9f621e); box-shadow: 0 0 0 1px #000; }
#cartel-codigo { margin-top: 12px; color: var(--apagado); font-size: 12px; letter-spacing: .04em; }
#cartel-detalle { margin-top: 8px; text-align: left; color: var(--suave); font-size: 12px; }
#cartel-detalle summary { cursor: pointer; text-align: center; }
#cartel-detalle pre { max-height: 22vh; margin: 6px 0 0; padding: 8px; overflow: auto; background: var(--hundido); border: 1px solid #3a332b; color: var(--suave); font: 11px/1.4 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
#cartel-botones { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.boton {
	min-width: 150px; padding: 9px 20px; cursor: pointer; font: 700 15px/1.2 Cinzel, Georgia, serif; color: var(--oro); text-decoration: none; text-align: center;
	background: linear-gradient(#32302e, #292827 45%, #1c1b1a); border: 1px solid #cbbfb2; outline: 1px solid #000; outline-offset: 0; border-radius: 2px;
	box-shadow: inset 0 0 0 1px #000, inset 0 1px 0 1px #ffffff1c, 0 3px 8px #000c; text-shadow: 0 1px 2px #000;
}
.boton:hover { color: #fcd040; border-color: #e2d6c0; background: linear-gradient(#393734, #2e2d2a 45%, #201f1d); }
.boton:active { color: #ab732c; border-color: #c3b4a6; background: linear-gradient(#1a1918, #232222); }
.boton:focus-visible { outline: 2px solid var(--grabado); outline-offset: 2px; }
.boton.segundo { color: var(--suave); border-color: #6d635a; }
.boton.segundo:hover { color: var(--valor); }

/* ---------- avisos que no frenan el juego */
#aviso {
	position: fixed; left: 50%; top: 18px; z-index: 20; transform: translateX(-50%); max-width: min(640px, calc(100vw - 24px)); padding: 10px 18px; text-align: center;
	background: #0b0a09f2; border: 1px solid var(--metal-s); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000, 0 8px 24px #000; border-radius: 2px;
}
#aviso div { display: flex; gap: 10px; justify-content: center; }
#aviso .boton { min-width: 0; margin-top: 8px; padding: 6px 14px; font-size: 13px; }

/* ---------- pantalla completa: aparece al arrimar el mouse a la esquina */
#pantalla {
	position: fixed; right: 10px; top: 10px; z-index: 15; width: 34px; height: 34px; padding: 0; cursor: pointer; opacity: 0; transition: opacity .2s; border-radius: 2px;
	background: linear-gradient(#32302e, #1c1b1a); border: 1px solid #cbbfb2; box-shadow: inset 0 0 0 1px #000, 0 2px 8px #000;
}
#pantalla.se-ve, #pantalla:hover, #pantalla:focus-visible { opacity: .92; }
#pantalla::before, #pantalla::after { content: ""; position: absolute; width: 9px; height: 9px; border: solid var(--oro); border-width: 2px 0 0 2px; }
#pantalla::before { left: 7px; top: 7px; }
#pantalla::after { right: 7px; bottom: 7px; transform: rotate(180deg); }
#pantalla.entera::before { left: 4px; top: 4px; transform: rotate(180deg); }
#pantalla.entera::after { right: 4px; bottom: 4px; transform: none; }
#pantalla:hover::before, #pantalla:hover::after { border-color: #fcd040; }

#sinjs { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: #111110; color: var(--valor); text-align: center; }
@media (max-height: 520px) { #logo { width: min(260px, 46vh); margin-bottom: 4px; } #carga-que { margin-top: 6px; font-size: 17px; } }
@media (max-width: 520px) {
	.barra { border-width: 0 97px; height: 36px; border-image: url(barra.webp) 0 220 fill / 0 97px stretch; }
	.canal { left: -37px; right: -37px; top: 15px; bottom: 5px; }
	.marco { border-width: 88px 44px 60px; border-image: url(marco.webp) 110 69 87 fill / 88px 55px 70px stretch; }
	.marco h1 { top: -50px; height: 34px; left: -26px; right: -26px; font-size: 16px; }
	.cuerpo { margin: -6px -12px -24px; }
}
@media (prefers-reduced-motion: reduce) { #carga, #relleno, #pantalla { transition: none; } }

/* ---------- W34: los carteles de Windows del juego (MessageBox): encima del juego, que sigue andando abajo; afuera del marco el clic le llega al juego */
#juego-cartel { position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; padding: 12px; pointer-events: none; }
#juego-cartel .marco { pointer-events: auto; }
.marco.chico { width: min(540px, 100%); }
#juego-cartel-texto { white-space: pre-line; overflow-wrap: anywhere; max-height: 40vh; overflow: auto; color: var(--valor); }
#juego-cartel-mas { margin-top: 8px; color: var(--apagado); font-size: 12px; }
.botones { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.enlace-boton { display: block; margin: 4px auto 0; padding: 2px 8px; background: none; border: 0; color: var(--suave); font: 12px/1.4 Tahoma, Verdana, sans-serif; text-decoration: underline; cursor: pointer; }
.enlace-boton:hover { color: var(--valor); }

/* ---------- W34: la galeria de capturas de la sesion */
#capturas {
	position: fixed; right: 12px; bottom: 12px; z-index: 22; max-width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; padding: 12px 14px;
	background: #0b0a09f2; border: 1px solid var(--metal-s); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000, 0 8px 24px #000; border-radius: 2px;
}
#capturas-titulo { margin-bottom: 8px; font: 700 16px/1.3 Cinzel, Georgia, serif; color: var(--grabado); text-shadow: 0 1px 2px #000; }
#capturas-lista { display: flex; flex-wrap: wrap; gap: 10px; }
.captura { display: flex; flex-direction: column; gap: 4px; width: 198px; padding: 2px; background: var(--hundido); border: 1px solid #3a332b; color: var(--suave); font: 11px/1.3 Tahoma, Verdana, sans-serif; cursor: pointer; text-align: left; }
.captura:hover, .captura:focus-visible { border-color: var(--grabado); color: var(--valor); outline: 0; }
.captura img { display: block; width: 192px; height: auto; }
.captura span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#capturas-cerrar { min-width: 0; margin-top: 10px; padding: 6px 16px; font-size: 13px; }

/* ---------- W43: la calidad (Auto / Alto / Medio / Bajo): un boton al lado del de pantalla completa, que aparece igual que el (al arrimar el mouse a la esquina
   o unos segundos al llegar al juego), y su panel. Afuera del lienzo: nada nuevo se dibuja adentro del juego */
#calidad {
	position: fixed; right: 52px; top: 10px; z-index: 15; height: 34px; padding: 0 12px; cursor: pointer; opacity: 0; transition: opacity .2s; border-radius: 2px;
	font: 700 12px/32px Cinzel, Georgia, serif; color: var(--oro); white-space: nowrap; text-shadow: 0 1px 2px #000;
	background: linear-gradient(#32302e, #1c1b1a); border: 1px solid #cbbfb2; box-shadow: inset 0 0 0 1px #000, 0 2px 8px #000;
}
#calidad.se-ve, #calidad.abierto, #calidad:focus-visible { opacity: .92; pointer-events: auto; }
#calidad { pointer-events: none; }		/* invisible no le quita clics al juego (es mas ancho que el de pantalla completa) */
#calidad:hover { color: #fcd040; }
#calidad-panel {
	position: fixed; right: 10px; top: 52px; z-index: 22; width: min(360px, calc(100vw - 20px)); max-height: calc(100vh - 64px); overflow: auto; padding: 12px 14px;
	background: #0b0a09f2; border: 1px solid var(--metal-s); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000, 0 8px 24px #000; border-radius: 2px;
}
#calidad-titulo { margin-bottom: 8px; font: 700 16px/1.3 Cinzel, Georgia, serif; color: var(--grabado); text-shadow: 0 1px 2px #000; }
#calidad-modos { display: flex; flex-direction: column; gap: 6px; }
.calidad-modo {
	display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 7px 10px 7px 30px; position: relative; cursor: pointer; text-align: left;
	background: var(--hundido); border: 1px solid #3a332b; border-radius: 2px; color: var(--suave); font: 12px/1.35 Tahoma, Verdana, sans-serif;
}
.calidad-modo b { font: 700 14px/1.2 Cinzel, Georgia, serif; color: var(--valor); }
.calidad-modo::before { content: ""; position: absolute; left: 10px; top: 10px; width: 9px; height: 9px; transform: rotate(45deg); border: 1px solid #6d635a; background: #000; }
.calidad-modo[aria-checked="true"] { border-color: var(--grabado); }
.calidad-modo[aria-checked="true"]::before { border-color: #000; background: linear-gradient(135deg, #f7dd82, #9f621e); box-shadow: 0 0 0 1px #000; }
.calidad-modo:hover, .calidad-modo:focus-visible { border-color: var(--grabado); color: var(--texto); outline: 0; }
#calidad-ahora { margin-top: 10px; color: var(--valor); font-size: 13px; }
#calidad-nota { margin-top: 6px; color: #ffb06a; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { #calidad { transition: none; } }
