/* Zekthor — estilos. Móvil en vertical primero (se ve bien en escritorio).
   Estilo de juego casual: botones gruesos azules, texto con contorno y tarjetas crema. */
@font-face { font-family: 'Lilita'; src: url('../fonts/LilitaOne-Regular.ttf') format('truetype'); font-display: swap; }
:root {
  --azul: #3d8ef0; --azul2: #2563c9; --marino: #1c2f5e; --crema: #fff8e6; --crema2: #f3e6c4; --tinta: #2a2340;
  --oro: #ffd43b; --oro2: #f59f00; --rojo: #e03131; --verde: #37b24d;
  --pie-h: 84px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --titulo: 'Lilita', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2fb4e2; color: var(--tinta);
  font: 15px/1.35 'Trebuchet MS', 'Segoe UI', sans-serif; -webkit-tap-highlight-color: transparent; user-select: none; }
button { font: inherit; cursor: pointer; }
img { -webkit-user-drag: none; }
/* texto de juego: letra redonda, blanca, con contorno oscuro */
.tj, #res b, #poder, #pie span, .ph b, button.pri, .mw h2 {
  font-family: var(--titulo); font-weight: normal; letter-spacing: .3px; color: #fff;
  -webkit-text-stroke: 4px var(--marino); paint-order: stroke fill;
}
.ico { width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -.28em; }

#mapa { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

/* --- encabezado ------------------------------------------------------- */
#hud { position: fixed; top: 0; left: 0; right: 0; z-index: 5; pointer-events: none;
  padding: calc(8px + var(--safe-t)) 6px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
#hud > * { pointer-events: auto; }
#res { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding-left: 6px; width: 100%; max-width: 520px; }
.rs { position: relative; display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  min-width: 0; height: 40px; padding: 0 6px 0 22px; border-radius: 12px; background: rgba(22, 44, 92, .62);
  border: 2px solid rgba(255, 255, 255, .35); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.rs img { position: absolute; left: -9px; top: 50%; width: 30px; height: 30px; transform: translateY(-50%);
  object-fit: contain; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .3)); }
.rs b { font-size: 15px; line-height: 1; white-space: nowrap; -webkit-text-stroke-width: 3.5px; }
.rs small { margin-top: 2px; padding: 0 5px; border-radius: 6px; font: bold 10px/14px sans-serif; white-space: nowrap;
  background: var(--oro); color: #5b3b00; }
.rs small.neg { background: #ff8787; color: #5c0000; }
#poder { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 18px 0 8px; font-size: 19px;
  border-radius: 20px; border: 3px solid #fff; background: linear-gradient(#5aa5ff, var(--azul2));
  box-shadow: 0 3px 0 var(--marino), inset 0 2px 0 rgba(255, 255, 255, .35); }
#poder img { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .3)); }
#poder small { font-size: 13px; opacity: .95; }

/* --- pie: botones gruesos ------------------------------------------- */
#pie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; align-items: flex-end; justify-content: center;
  gap: 5px; padding: 0 6px calc(8px + var(--safe-b)); pointer-events: none; }
#pie button { pointer-events: auto; position: relative; flex: 1; max-width: 96px; height: 70px; padding: 4px 2px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  border: 3px solid #fff; border-radius: 16px; background: linear-gradient(#6fb3ff, var(--azul) 45%, var(--azul2));
  box-shadow: 0 4px 0 var(--marino), 0 6px 10px rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .4);
  transition: transform .06s; }
#pie button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--marino), inset 0 2px 0 rgba(255, 255, 255, .4); }
#pie button img { position: absolute; top: -16px; width: 52px; height: 52px; object-fit: contain;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3)); }
#pie span { font-size: 13px; -webkit-text-stroke-width: 3px; }
#pie .grande { flex: 1.35; max-width: 120px; height: 82px; background: linear-gradient(#ffe27a, var(--oro) 45%, var(--oro2));
  box-shadow: 0 4px 0 #9c5d00, 0 6px 10px rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .5); }
#pie .grande img { width: 66px; height: 66px; top: -22px; }
#pie .grande span { font-size: 16px; -webkit-text-stroke-color: #7a4300; }
#pie i { position: absolute; top: -8px; right: -6px; padding: 1px 6px; border-radius: 9px; border: 2px solid #fff;
  background: var(--rojo); color: #fff; font: bold 10px/14px sans-serif; font-style: normal; }

/* --- panel del hex (tarjeta sobre el pie) --------------------------- */
#panel { position: fixed; left: 6px; right: 6px; bottom: calc(var(--pie-h) + 10px + var(--safe-b)); z-index: 6;
  max-height: 52%; overflow-y: auto; margin: 0 auto; max-width: 520px; padding: 0 12px 12px;
  background: var(--crema); color: var(--tinta); border: 3px solid var(--marino); border-radius: 18px;
  box-shadow: 0 5px 0 var(--marino), 0 10px 24px rgba(0, 0, 0, .3);
  transform: translateY(calc(100% + var(--pie-h) + 40px)); transition: transform .2s cubic-bezier(.2, .9, .3, 1.2); }
#panel.on { transform: none; }
.ph { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; margin: 0 -12px 8px; padding: 8px 10px 8px 14px;
  background: linear-gradient(#5aa5ff, var(--azul2)); border-bottom: 3px solid var(--marino); border-radius: 14px 14px 0 0; }
.ph b { font-size: 21px; }
.tier { font: bold 12px/18px sans-serif; padding: 0 8px; border-radius: 9px; background: var(--oro); color: #5b3b00; border: 2px solid #fff; }
.x { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; background: var(--rojo);
  color: #fff; font: bold 16px/1 sans-serif; box-shadow: 0 2px 0 #7a1010; }
#panel p { margin: 4px 2px 10px; }
.bl { display: grid; gap: 7px; }
.bl button, .bh { display: flex; gap: 10px; align-items: center; text-align: left; padding: 6px 10px 6px 6px; border-radius: 14px;
  border: 2px solid var(--crema2); background: #fff; color: var(--tinta); box-shadow: 0 3px 0 var(--crema2); }
.bl button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--crema2); }
.bl b, .bh b { font-family: var(--titulo); font-weight: normal; font-size: 17px; color: var(--marino); }
.bl small { display: block; font-size: 13px; }
.bi { width: 56px; height: 48px; object-fit: contain; flex: none; font-size: 30px; text-align: center; }
.ady { margin: 8px 0; padding: 6px 10px 6px 26px; font-size: 13px; color: #2b8a3e; background: #ebfbee; border-radius: 10px; }
button.pri { display: block; width: 100%; margin-top: 10px; padding: 10px; font-size: 19px; border-radius: 14px;
  border: 3px solid #fff; background: linear-gradient(#8ce99a, var(--verde) 50%, #2b8a3e);
  box-shadow: 0 4px 0 #1b5e2a, inset 0 2px 0 rgba(255, 255, 255, .4); -webkit-text-stroke-color: #1b4d24; }
button.pri:active { transform: translateY(3px); box-shadow: 0 1px 0 #1b5e2a; }
button.pri .falta { -webkit-text-stroke: 0; }
button.sec { display: block; width: 100%; margin-top: 8px; padding: 8px; border: 2px solid var(--crema2); border-radius: 12px;
  background: none; color: #8a7a5a; font-weight: bold; }
button:disabled { filter: grayscale(.85); opacity: .6; cursor: default; }
.falta { color: var(--rojo); font-weight: bold; }

/* --- avisos y ventanas ---------------------------------------------- */
#toasts { position: fixed; z-index: 8; top: calc(104px + var(--safe-t)); left: 0; right: 0; display: flex; flex-direction: column;
  align-items: center; gap: 4px; pointer-events: none; }
.toast { background: rgba(28, 47, 94, .9); color: #fff; padding: 6px 14px; border-radius: 14px; border: 2px solid #fff;
  font-size: 14px; font-weight: bold; animation: ent .25s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes ent { from { opacity: 0; transform: translateY(-10px) scale(.9); } }

.mw { position: fixed; inset: 0; z-index: 9; display: none; align-items: center; justify-content: center; background: rgba(10, 25, 55, .55); padding: 20px; }
.mw.on { display: flex; }
.mw .cnt { width: 100%; max-width: 380px; background: var(--crema); color: var(--tinta); border-radius: 20px; padding: 0 16px 16px;
  border: 3px solid var(--marino); box-shadow: 0 6px 0 var(--marino), 0 14px 30px rgba(0, 0, 0, .35); overflow: hidden;
  animation: ent .25s cubic-bezier(.2, .9, .3, 1.4); }
.mw h2 { margin: 0 -16px 12px; padding: 12px 16px; font-size: 24px; text-align: center;
  background: linear-gradient(#5aa5ff, var(--azul2)); border-bottom: 3px solid var(--marino); }
.mw ul { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.mw li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #fff; border-radius: 12px; border: 2px solid var(--crema2); }
.mw li b { margin-left: auto; }

#dev { position: fixed; z-index: 7; left: 8px; top: calc(110px + var(--safe-t)); font-size: 12px; opacity: .6; }
