:root {
	--fondo: #2b1d14;
	--fondo2: #3d2a1c;
	--crema: #f6e7c8;
	--naranja: #e8833a;
	--verde: #6fae4b;
	--texto: #fff6e6;
	--sombra: rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--texto); overflow: hidden; }
body {
	font: 600 16px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	user-select: none; -webkit-user-select: none; touch-action: manipulation;
	background: radial-gradient(circle at 50% 0, #4a3322, var(--fondo) 70%);
}
#app { position: relative; height: 100%; max-width: 560px; margin: 0 auto; }
.pantalla {
	position: absolute; inset: 0; display: none; flex-direction: column; align-items: center;
	padding: max(10px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.pantalla.activa { display: flex; animation: entra .25s ease-out; }
.capa { background: rgba(20, 12, 6, .72); justify-content: center; z-index: 5; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1 { font-size: 2.6rem; margin: .2em 0 0; color: var(--crema); text-shadow: 0 4px 0 var(--sombra); letter-spacing: .02em; }
.lema { margin: .3em 0 1.6em; opacity: .85; text-align: center; }
#pantalla-inicio { justify-content: center; }
#logo { width: 288px; height: 192px; image-rendering: pixelated; }

.btn {
	font: inherit; color: var(--fondo); background: var(--crema); border: 0; border-radius: 14px;
	padding: .7em 1em; box-shadow: 0 4px 0 #b9a07a; cursor: pointer; transition: transform .08s;
	min-height: 44px;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b9a07a; }
.btn:disabled { opacity: .45; }
.btn.grande { font-size: 1.3rem; padding: .8em 2.2em; background: var(--naranja); color: #fff; box-shadow: 0 5px 0 #a8551c; margin: .3em; }
.btn.chico { min-width: 44px; padding: .5em .7em; }
#btn-sonido-inicio { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px; }

.barra { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.titulo { font-size: 1.25rem; color: var(--crema); }
.titulo small { font-size: .85rem; opacity: .85; margin-left: .3em; }
.marcador { width: 100%; display: flex; justify-content: space-around; margin: 10px 0 6px; font-size: .95rem; opacity: .95; }
.marcador b { color: var(--crema); font-size: 1.15rem; }

#zona { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
#tablero { touch-action: none; display: block; border-radius: 10px; box-shadow: 0 8px 0 var(--sombra); }
.controles { width: 100%; display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.controles .btn { flex: 1; max-width: 160px; padding: .7em .3em; font-size: .95rem; }

.mapa {
	width: 100%; flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(5, 1fr);
	gap: 10px; padding: 12px 2px 20px; align-content: start; -webkit-overflow-scrolling: touch;
}
.nivel {
	aspect-ratio: 1; border-radius: 14px; border: 0; font: inherit; font-size: 1.15rem; color: var(--fondo);
	background: var(--crema); box-shadow: 0 4px 0 #b9a07a; display: flex; flex-direction: column;
	align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 0;
}
.nivel small { font-size: .6rem; letter-spacing: 1px; color: #c77a14; min-height: .8em; }
.nivel.bloq { background: #5a4433; color: #8d7560; box-shadow: 0 4px 0 #3a2a1d; }
.nivel.actual { background: var(--naranja); color: #fff; box-shadow: 0 4px 0 #a8551c; animation: late 1.2s ease-in-out infinite; }
.nivel.actual small { color: #fff3c4; }
@keyframes late { 50% { transform: scale(1.06); } }
.seccion { grid-column: 1 / -1; text-align: center; font-size: .9rem; opacity: .8; margin-top: 6px; }

.tarjeta {
	background: var(--fondo2); border-radius: 20px; padding: 22px 26px; text-align: center;
	box-shadow: 0 10px 0 var(--sombra); display: flex; flex-direction: column; gap: 8px; min-width: 260px;
	animation: salta .35s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes salta { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
#cuy-feliz { width: 200px; height: 100px; align-self: center; image-rendering: pixelated; margin-top: -8px; }
.tarjeta h2 { margin: 0; font-size: 2rem; color: var(--crema); }
.estrellas { font-size: 2.6rem; letter-spacing: .1em; min-height: 1.3em; }
.estrellas span { display: inline-block; color: #5a4433; }
.estrellas span.si { color: #ffd23f; animation: brilla .4s ease-out backwards; }
.estrellas span.si:nth-child(2) { animation-delay: .15s; }
.estrellas span.si:nth-child(3) { animation-delay: .3s; }
@keyframes brilla { from { transform: scale(0) rotate(-90deg); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
