/* ============================================================
   WITIGAME — Shell de juego (paleta optimizada)
   ============================================================ */

:root {
	--witi-primary: #3B82F6;
	--witi-primary-dark: #2563EB;
	--witi-secondary: #06B6D4;
	--witi-secondary-dark: #0891B2;
	--witi-heading: #1E40AF;
	--witi-text: #0A1628;
	--witi-bg2: #F0F7FF;
	--witi-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--witi-heading-font: 'Poppins', 'Inter', sans-serif;
	--witi-zoom: 1;
	--witi-pad: 20px;
	--witi-radius: 14px;
	--witi-border-w: 2px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
	height: 100%;
	background: linear-gradient(135deg, #FFFFFF 0%, #F0F7FF 100%);
	color: var(--witi-text);
	font-family: var(--witi-font);
	overflow: hidden;
}

/* ---- barra superior ---- */
.witi-bar {
	height: 52px;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 0 14px;
	background: #FFFFFF;
	border-bottom: var(--witi-border-w) solid #DBEAFE;
	box-shadow: 0 2px 12px rgba(30, 64, 175, .08);
	position: relative;
	z-index: 5;
}
.witi-back {
	font-family: var(--witi-font);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	color: var(--witi-primary);
	background: #FFFFFF;
	border: 2px solid var(--witi-primary);
	border-radius: 999px;
	padding: 7px 16px;
	transition: all .2s ease;
	white-space: nowrap;
}
.witi-back:hover { background: #EFF6FF; }
.witi-bar-title {
	flex: 1;
	text-align: center;
	font-family: var(--witi-heading-font);
	font-size: 16px;
	font-weight: 600;
	color: var(--witi-heading);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.witi-bar-user { display: flex; align-items: center; gap: 8px; }
.witi-user-chip {
	font-size: 12px;
	font-weight: 600;
	color: var(--witi-primary-dark);
	background: #EFF6FF;
	border: 1px solid #DBEAFE;
	border-radius: 999px;
	padding: 6px 12px;
	white-space: nowrap;
}
.witi-bar-btn {
	font-family: var(--witi-font);
	font-size: 12px;
	font-weight: 700;
	color: #FFFFFF;
	background: linear-gradient(135deg, var(--witi-primary) 0%, var(--witi-primary-dark) 100%);
	border: 0;
	border-radius: 999px;
	padding: 8px 14px;
	cursor: pointer;
	transition: all .2s ease;
	white-space: nowrap;
}
.witi-bar-btn:hover { box-shadow: 0 4px 14px rgba(37, 99, 235, .4); transform: translateY(-1px); }

/* ---- escenario del juego ---- */
.witi-stage { position: absolute; top: 52px; left: 0; right: 0; bottom: 0; }
#witi-frame { width: 100%; height: 100%; border: 0; display: block; background: #000; }

/* ---- overlay de preguntas ----
   DISEÑO UNIFICADO: mismo modal 3D para todos los juegos y para todos los
   tipos de pregunta (inicio, por tiempo y rescate de vidas) */
.witi-overlay {
	position: fixed;
	inset: 0;
	background: rgba(5, 4, 14, .9);
	backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 50;
	padding: 16px;
}
.witi-overlay.hidden { display: none; }
#witi-category-step.hidden, #witi-question-step.hidden, #witi-q-actions.hidden { display: none; }
.witi-modal {
	width: min(560px, 94vw);
	max-height: 86vh;
	overflow: auto;
	background: linear-gradient(165deg, var(--wq-bg, #2b2150) 0%, #1a1433 55%, #120e24 100%);
	border-radius: 22px;
	border: 2px solid var(--wq-border, #ffb347);
	box-shadow:
		0 26px 70px rgba(0, 0, 0, .7),
		0 0 0 1px rgba(0, 0, 0, .5),
		inset 0 2px 0 rgba(255, 255, 255, .1),
		inset 0 -18px 40px rgba(0, 0, 0, .35),
		0 0 50px var(--wq-glow, rgba(255, 179, 71, .22));
	padding: 26px 30px;
	animation: witi-pop .25s ease;
}
@keyframes witi-pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.witi-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.witi-modal-title {
	font-family: 'Orbitron', var(--witi-heading-font), sans-serif;
	font-weight: 800;
	font-size: 17px;
	letter-spacing: 1.5px;
	color: var(--wq-title, #ffd24d);
	text-shadow: 0 2px 0 rgba(0, 0, 0, .6), 0 0 20px var(--wq-glow, rgba(255, 210, 77, .45));
}
.witi-modal-timer {
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	font-size: 13px;
	color: var(--wq-title, #ffd24d);
	background: #241b3e;
	border: 2px solid var(--wq-border, #ffb347);
	border-radius: 999px;
	padding: 5px 14px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.witi-modal-timer.urgent { color: #FFFFFF; background: #b3333f; border-color: #ff8a8a; box-shadow: 0 0 18px rgba(255, 80, 80, .55); }
.witi-modal-timer.hidden { display: none; }

.witi-cat-help { font-size: 14px; color: #b9c6ff; margin-bottom: 10px; }
.witi-cats { display: flex; flex-wrap: wrap; gap: 10px; }
.witi-cat {
	font-family: var(--witi-font);
	font-size: 14px;
	font-weight: 800;
	color: #ffffff;
	background: linear-gradient(180deg, var(--wq-btn, #453a72) 0%, #2c2350 55%, var(--wq-btn-dark, #241d42) 100%);
	border: 2px solid var(--wq-border, #ffb347);
	border-bottom-width: 5px;
	border-radius: 14px;
	padding: 12px 20px;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, filter .12s ease;
	box-shadow: 0 10px 22px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.witi-cat:hover {
	transform: translateY(-2px);
	border-color: var(--wq-border, #ffb347);
	filter: brightness(1.15);
	box-shadow: 0 14px 26px rgba(0, 0, 0, .55), 0 0 22px var(--wq-glow, rgba(255, 179, 71, .35)), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.witi-cat:active { transform: translateY(2px); border-bottom-width: 2px; box-shadow: 0 4px 10px rgba(0, 0, 0, .5); }

.witi-q-text {
	font-size: 17px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.45;
	margin-bottom: 14px;
	background: rgba(255, 255, 255, .06);
	border: 1px solid var(--wq-border, #ffb347);
	border-radius: 14px;
	padding: 14px 18px;
	box-shadow: inset 0 2px 8px rgba(0, 0, 0, .4);
}
.witi-q-opts { display: grid; gap: 10px; }
.witi-opt {
	font-family: var(--witi-font);
	text-align: left;
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
	background: linear-gradient(180deg, var(--wq-btn, #453a72) 0%, #2c2350 55%, var(--wq-btn-dark, #241d42) 100%);
	border: 2px solid var(--wq-border, #ffb347);
	border-bottom: 5px solid rgba(8, 5, 20, .95);
	border-radius: 14px;
	padding: 13px 18px;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, filter .12s ease;
	box-shadow: 0 10px 22px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.witi-opt:hover:not(:disabled) {
	transform: translateY(-2px);
	border-color: var(--wq-border, #ffb347);
	filter: brightness(1.15);
	box-shadow: 0 14px 26px rgba(0, 0, 0, .55), 0 0 22px var(--wq-glow, rgba(255, 179, 71, .35)), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.witi-opt:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; box-shadow: 0 4px 10px rgba(0, 0, 0, .5); }
.witi-opt.good {
	background: linear-gradient(180deg, #2fae5f, #1b7a41);
	border-color: #7dff8a;
	box-shadow: 0 10px 22px rgba(0, 0, 0, .5), 0 0 26px rgba(80, 255, 130, .45);
}
.witi-opt.bad {
	background: linear-gradient(180deg, #b3333f, #7c1f2a);
	border-color: #ff8a8a;
	box-shadow: 0 10px 22px rgba(0, 0, 0, .5), 0 0 22px rgba(255, 80, 80, .4);
}

.witi-q-feedback {
	margin-top: 14px;
	font-size: 15px;
	font-weight: 700;
	border-radius: 14px;
	padding: 12px 14px;
}
.witi-q-feedback.hidden { display: none; }
.witi-q-feedback.good { background: rgba(80, 255, 130, .12); color: #7dff8a; border: 1px solid rgba(125, 255, 138, .45); }
.witi-q-feedback.bad { background: rgba(255, 80, 80, .12); color: #ff9d9d; border: 1px solid rgba(255, 138, 138, .45); }

.witi-q-actions { margin-top: 16px; text-align: center; }
.witi-q-actions.hidden { display: none; }
.witi-btn-primary {
	font-family: var(--witi-font);
	font-size: 15px;
	font-weight: 700;
	color: #3a2500;
	background: linear-gradient(180deg, #ffd24d 0%, #d99a1a 100%);
	border: 2px solid #ffe9a8;
	border-bottom: 5px solid #8a5c00;
	border-radius: 14px;
	padding: 12px 30px;
	cursor: pointer;
	transition: all .15s ease;
	letter-spacing: .5px;
	box-shadow: 0 10px 22px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.witi-btn-primary:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0, 0, 0, .55), 0 0 26px rgba(255, 210, 77, .4); }
.witi-btn-primary:active { transform: translateY(2px); border-bottom-width: 2px; box-shadow: 0 4px 10px rgba(0, 0, 0, .5); }

/* ---- toast ---- */
.witi-toast {
	position: fixed;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--witi-text);
	color: #FFFFFF;
	font-size: 14px;
	font-weight: 600;
	border-radius: 999px;
	padding: 11px 22px;
	box-shadow: 0 8px 24px rgba(10, 22, 40, .4);
	z-index: 60;
	animation: witi-toast-in .25s ease;
}
.witi-toast.hidden { display: none; }
@keyframes witi-toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---- móvil ---- */
/* en cualquier teléfono (táctil o pantalla baja) el juego ocupa TODA la
   pantalla sin barra superior: se sale con el botón atrás del móvil */
@media (pointer: coarse), (max-height: 520px) {
	.witi-bar { display: none; }
	.witi-stage { top: 0; height: 100vh; height: 100dvh; }
}
@media (max-width: 820px) {
	/* móvil: pantalla completa, sin barra superior (se sale con el botón atrás) */
	.witi-bar { display: none; }
	.witi-stage { top: 0; height: 100vh; height: 100dvh; }
	.witi-overlay { padding-top: 0; }
}
@media (max-width: 640px) {
	.witi-bar { height: 46px; padding: 0 8px; gap: 8px; }
	.witi-stage { top: 46px; }
	.witi-bar-title { font-size: 13px; }
	.witi-user-chip { display: none; }
	.witi-back { padding: 6px 12px; font-size: 12px; }
	.witi-modal { padding: 18px; border-radius: 18px; }
	.witi-q-text { font-size: 15px; }
	.witi-opt { font-size: 14px; padding: 11px 14px; }
}

/* ---- juego abierto: fondo oscuro (evita franja blanca superior) ---- */
body[data-witigame]:not([data-witigame=""]) {
	background: #0b0610 !important;
}
.witi-stage { background: #0b0610; }
