/* ============================================================
   TEMA OSCURO v6.29 — madera vieja, hierro forjado y oro
   Barra de arriba con escudos, panel del rey a la izquierda y
   barra de abajo con 7 botones redondos. Todo centrado.
   ============================================================ */
:root {
  --to-madera: #2a1c12;
  --to-madera2: #3b2717;
  --to-hierro: #4a4a4c;
  --to-hierro2: #1f1f21;
  --to-oro: #e8c46a;
  --to-oro2: #a8782a;
  --to-oro-claro: #ffe9a8;
  --to-letra: 'UnifrakturCook', 'Cinzel', Georgia, serif;
  --to-num: 'Cinzel', Georgia, serif;
}

/* madera oscura con vetas + borde de hierro con remaches */
body.tema-oscuro .to-madera {
  background:
    radial-gradient(circle at 10px 10px, #8a8a8e 0 2.6px, #2a2a2c 3.2px, transparent 3.8px) 0 0 / 100% 100% no-repeat,
    radial-gradient(circle at calc(100% - 10px) 10px, #8a8a8e 0 2.6px, #2a2a2c 3.2px, transparent 3.8px) 0 0 / 100% 100% no-repeat,
    radial-gradient(circle at 10px calc(100% - 10px), #8a8a8e 0 2.6px, #2a2a2c 3.2px, transparent 3.8px) 0 0 / 100% 100% no-repeat,
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), #8a8a8e 0 2.6px, #2a2a2c 3.2px, transparent 3.8px) 0 0 / 100% 100% no-repeat,
    repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 23px, rgba(255,220,160,.04) 23px 25px, transparent 25px 47px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.10) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, var(--to-madera2), var(--to-madera) 55%, #1c120b) !important;
  border: 3px solid var(--to-hierro) !important;
  outline: 2px solid var(--to-oro2);
  outline-offset: -7px;
  box-shadow: 0 0 0 2px var(--to-hierro2), 0 6px 16px rgba(0,0,0,.6), inset 0 0 18px rgba(0,0,0,.7) !important;
  border-radius: 10px !important;
}

/* ---------------- BARRA DE ARRIBA ---------------- */
body.tema-oscuro #arriba {
  left: 50% !important; right: auto !important; transform: translateX(-50%);
  width: min(760px, calc(100vw - 16px)) !important;
  top: calc(6px + env(safe-area-inset-top)) !important;
  padding: 0 !important; display: block !important; background: none !important; box-shadow: none !important;
}
body.tema-oscuro #arriba > .espacio { display: none !important; }
body.tema-oscuro #recursos {
  display: flex !important; flex-wrap: nowrap !important; justify-content: space-around !important; align-items: flex-start;
  gap: 2px !important; max-width: none !important; width: 100% !important; padding: 7px 10px 6px !important; box-sizing: border-box;
}
body.tema-oscuro #recursos .pill.r:not(.boton-top) {
  flex: 1 1 0; min-width: 0; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: flex-start;
  background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; height: auto !important; border-radius: 0 !important;
  cursor: pointer; position: relative;
}
body.tema-oscuro #recursos .pill.r .ico, body.tema-oscuro #recursos .pill.r .emo { display: none !important; }
body.tema-oscuro .esc-img { width: 44px; height: 49px; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.7)); pointer-events: none; }
body.tema-oscuro .esc-et { display: block; font-family: var(--to-letra); font-weight: 700; font-size: 13px; line-height: 1; color: var(--to-oro-claro); text-shadow: 0 1px 2px #000; margin-top: 1px; white-space: nowrap; }
body.tema-oscuro #recursos .pill.r b {
  display: block; font-family: var(--to-num) !important; font-weight: 900 !important; font-size: 15px !important; line-height: 1.1;
  color: var(--to-oro) !important; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.8) !important; white-space: nowrap; min-width: 0 !important; background: none !important;
}
body.tema-oscuro #pill-gemas b { color: #c99aff !important; }
body.tema-oscuro #pill-gemas .gemas-mas {
  position: absolute; top: 0; right: calc(50% - 30px); width: 17px; height: 17px; border-radius: 50%; line-height: 15px; font-size: 14px; font-weight: 900;
  background: radial-gradient(#ffe27a, #b07a14); color: #3a2000; border: 1px solid #4a2a00; text-align: center; padding: 0 !important; margin: 0 !important;
}
/* orden como en el diseño: poder, comida, madera, piedra, oro, gemas */
body.tema-oscuro #pill-poder { order: 0; }
body.tema-oscuro #pill-comida { order: 1; }
body.tema-oscuro #pill-madera { order: 2; }
body.tema-oscuro #pill-piedra { order: 3; }
body.tema-oscuro #pill-monedas { order: 4; }
body.tema-oscuro #pill-gemas { order: 5; }
/* idioma y salir viven en el panel del rey */
body.tema-oscuro #recursos .boton-top { display: none !important; }

/* ---------------- PANEL DEL REY (izquierda) ---------------- */
body.tema-oscuro #panel-rey {
  position: fixed; left: 8px; z-index: 30; width: 150px; box-sizing: border-box;
  padding: 0 10px 10px; display: flex; flex-direction: column; align-items: stretch; gap: 5px; text-align: center;
}
body.tema-oscuro #panel-rey .pr-banner {
  width: 56px; height: 62px; margin: -3px auto 0; position: relative; cursor: pointer;
  background: linear-gradient(180deg, #f2d27a, #c08a2a 70%, #8a5a14);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
  box-shadow: inset 0 0 0 3px #7a4f10; display: flex; align-items: center; justify-content: center;
}
body.tema-oscuro #panel-rey .pr-banner::before { content: ''; position: absolute; left: -6px; right: -6px; top: 0; height: 5px; background: linear-gradient(#9a9aa0, #3a3a3e); }
body.tema-oscuro #panel-rey .pr-banner span { font-size: 26px; margin-top: -6px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
body.tema-oscuro #panel-rey .pr-banner b {
  position: absolute; bottom: 9px; left: 0; right: 0; font-family: var(--to-num); font-weight: 900; font-size: 13px; color: #3a2000; text-shadow: 0 1px 0 #ffe9a8;
}
/* el perfil de siempre, dentro del panel */
body.tema-oscuro #panel-rey #perfil {
  position: static !important; display: block !important; max-width: none !important; width: auto !important; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; transform: none !important;
}
body.tema-oscuro #panel-rey #perfil .avatar { display: none !important; }
body.tema-oscuro #panel-rey #perfil .poder { display: block !important; background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; width: auto !important; min-width: 0 !important; }
body.tema-oscuro #panel-rey #perfil-nombre { display: block; font-family: var(--to-num); font-weight: 700; font-size: 12px !important; color: #f6ead0 !important; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.tema-oscuro #panel-rey #perfil .poder span { display: block; font-family: var(--to-letra); font-size: 15px !important; color: var(--to-oro-claro) !important; text-shadow: 0 1px 2px #000; margin-top: 4px; border-top: 1px solid rgba(232,196,106,.35); padding-top: 4px; }
body.tema-oscuro #panel-rey #poder { display: block; font-family: var(--to-num) !important; font-weight: 900 !important; font-size: 19px !important; color: var(--to-oro) !important; text-shadow: 0 1px 2px #000 !important; }
body.tema-oscuro #panel-rey #xp-barra { margin: 4px 0 0 !important; height: 6px !important; width: auto !important; border-radius: 4px; background: #120b06 !important; border: 1px solid var(--to-oro2) !important; }
body.tema-oscuro #panel-rey #xp-relleno { background: linear-gradient(90deg, #6ab0ff, #2a6ad0) !important; }
/* vida del castillo */
body.tema-oscuro #panel-rey #vida-castillo {
  position: static !important; width: auto !important; left: auto !important; top: auto !important; transform: none !important; margin: 0 !important; padding: 5px 0 0 !important;
  border-top: 1px solid rgba(232,196,106,.35); background: none !important; box-shadow: none !important; text-align: center !important;
}
body.tema-oscuro #panel-rey #vida-castillo .etq { font-family: var(--to-num); font-weight: 700; font-size: 11px !important; color: #f6ead0 !important; text-shadow: 0 1px 2px #000; white-space: normal; line-height: 1.2; background: none !important; padding: 0 !important; }
body.tema-oscuro #panel-rey #vida-castillo .barra { height: 11px !important; margin-top: 3px !important; border-radius: 7px !important; background: #120b06 !important; border: 2px solid var(--to-oro) !important; box-shadow: 0 0 0 1px #3a2000, inset 0 1px 3px #000 !important; overflow: hidden; }
body.tema-oscuro #panel-rey #vida-castillo-fill { background: linear-gradient(180deg, #7fe07a, #2f9a3a 60%, #1f6a28) !important; border-radius: 4px; }
/* nombre del reino */
body.tema-oscuro #panel-rey #ciudad-nombre { position: static !important; top: auto !important; left: auto !important; transform: none !important; margin: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; padding: 2px 0 0 !important; display: flex !important; justify-content: center; gap: 4px; cursor: pointer; max-width: none !important; }
body.tema-oscuro #panel-rey #ciudad-nombre .cn-ico { display: none; }
body.tema-oscuro #panel-rey #ciudad-nombre b, body.tema-oscuro #panel-rey #ciudad-nombre small { font-family: var(--to-num); color: #e8d8b0 !important; font-size: 11px !important; text-shadow: 0 1px 2px #000; }
/* idioma y salir */
body.tema-oscuro #panel-rey .pr-botones { display: flex; justify-content: center; gap: 8px; margin-top: 2px; }
body.tema-oscuro #panel-rey .pr-botones button {
  position: static !important; width: 34px !important; height: 30px !important; min-width: 0 !important; padding: 0 !important; margin: 0 !important; display: block !important;
  border-radius: 8px !important; border: 2px solid var(--to-oro2) !important; background: linear-gradient(#3a2a1a, #1c120b) !important; color: var(--to-oro-claro) !important;
  font-family: var(--to-num); font-weight: 900; font-size: 12px !important; box-shadow: 0 2px 0 #000 !important;
}

/* ---------------- BARRA DE ABAJO ---------------- */
body.tema-oscuro #abajo {
  left: 50% !important; right: auto !important; transform: translateX(-50%);
  width: min(760px, calc(100vw - 12px)) !important;
  bottom: calc(4px + env(safe-area-inset-bottom)) !important;
  height: auto !important; padding: 6px 8px 5px !important; box-sizing: border-box;
  display: flex !important; justify-content: space-around !important; align-items: flex-end !important; gap: 2px !important; grid-template-columns: none !important;
}
body.tema-oscuro #abajo > button {
  flex: 1 1 0; min-width: 0; width: auto !important; height: auto !important; margin: 0 !important; padding: 0 !important;
  background: none !important; border: 0 !important; box-shadow: none !important; transform: none !important; border-radius: 0 !important;
  display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: flex-end; position: relative; top: auto !important;
}
body.tema-oscuro #abajo > button::before, body.tema-oscuro #abajo > button::after { display: none !important; }
body.tema-oscuro #abajo > button .icono { display: none !important; }
body.tema-oscuro .bot-img { width: 58px; height: 58px; display: block; border-radius: 50%; filter: drop-shadow(0 3px 4px rgba(0,0,0,.75)); transition: transform .12s, filter .12s; pointer-events: none; }
body.tema-oscuro #abajo > button:active .bot-img { transform: scale(.92); }
body.tema-oscuro #abajo > button.activo .bot-img { filter: drop-shadow(0 0 8px rgba(255,200,90,.95)) drop-shadow(0 3px 4px rgba(0,0,0,.75)); transform: translateY(-3px); }
body.tema-oscuro #abajo #btn-construir .bot-img { width: 66px; height: 66px; }
body.tema-oscuro #abajo .txt {
  font-family: var(--to-letra) !important; font-weight: 700 !important; font-size: 15px !important; color: var(--to-oro) !important; letter-spacing: 0 !important;
  text-shadow: 0 1px 2px #000, 0 0 4px rgba(0,0,0,.9) !important; margin-top: 2px; text-transform: none !important;
}
body.tema-oscuro #abajo > button.activo .txt { color: var(--to-oro-claro) !important; }
body.tema-oscuro #abajo .badge { position: absolute !important; top: -2px !important; right: calc(50% - 32px) !important; left: auto !important; z-index: 2; }
/* el botón ▲ del menú y la vista quedan encima de la barra nueva */
body.tema-oscuro #btn-menu-mas { bottom: calc(100px + env(safe-area-inset-bottom)) !important; }

/* ---------------- TELÉFONO ---------------- */
@media (max-width: 600px) {
  body.tema-oscuro #recursos { padding: 6px 6px 5px !important; }
  body.tema-oscuro .esc-img { width: 34px; height: 38px; }
  body.tema-oscuro .esc-et { font-size: 10.5px; }
  body.tema-oscuro #recursos .pill.r b { font-size: 12px !important; }
  body.tema-oscuro #pill-gemas .gemas-mas { right: calc(50% - 25px); width: 15px; height: 15px; line-height: 13px; font-size: 12px; }
  body.tema-oscuro #panel-rey { width: 118px; padding: 0 7px 8px; gap: 3px; }
  body.tema-oscuro #panel-rey .pr-banner { width: 44px; height: 50px; }
  body.tema-oscuro #panel-rey .pr-banner span { font-size: 20px; }
  body.tema-oscuro #panel-rey .pr-banner b { font-size: 11px; bottom: 7px; }
  body.tema-oscuro #panel-rey #poder { font-size: 15px !important; }
  body.tema-oscuro #panel-rey #perfil .poder span { font-size: 13px !important; }
  body.tema-oscuro #panel-rey #perfil-nombre { font-size: 10.5px !important; }
  body.tema-oscuro #panel-rey #vida-castillo .etq { font-size: 10px !important; }
  body.tema-oscuro #abajo { padding: 5px 4px 4px !important; }
  body.tema-oscuro .bot-img { width: 44px; height: 44px; }
  body.tema-oscuro #abajo #btn-construir .bot-img { width: 50px; height: 50px; }
  body.tema-oscuro #abajo .txt { font-size: 11.5px !important; }
  body.tema-oscuro #abajo .badge { right: calc(50% - 25px) !important; }
  body.tema-oscuro #btn-menu-mas { bottom: calc(82px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 380px) {
  body.tema-oscuro .esc-et { font-size: 9.5px; }
  body.tema-oscuro #recursos .pill.r b { font-size: 11px !important; }
  body.tema-oscuro #abajo .txt { font-size: 10px !important; }
}

/* la barra de arriba tapa las etiquetas del mapa (pero queda debajo del mundo y de los paneles) */
body.tema-oscuro #arriba { z-index: 30 !important; }
/* botón de vista (Ciudad / Campos / Mundo) y botón ▲ en madera y oro */
body.tema-oscuro #btn-vista {
  background: radial-gradient(circle at 50% 40%, #4a3220, #1c120b 75%) !important;
  border: 3px solid var(--to-oro2) !important; box-shadow: 0 0 0 2px var(--to-hierro2), 0 4px 10px rgba(0,0,0,.6), inset 0 0 10px rgba(0,0,0,.7) !important;
}
body.tema-oscuro #btn-vista, body.tema-oscuro #btn-vista * { color: var(--to-oro-claro) !important; font-family: var(--to-letra) !important; text-shadow: 0 1px 2px #000 !important; }
body.tema-oscuro #btn-menu-mas {
  background: linear-gradient(#3b2717, #1c120b) !important; border: 2px solid var(--to-oro2) !important; color: var(--to-oro-claro) !important; box-shadow: 0 0 0 2px var(--to-hierro2), 0 3px 8px rgba(0,0,0,.6) !important;
}
/* avisos y misión con el mismo estilo */
body.tema-oscuro #consejo, body.tema-oscuro #mision {
  background: linear-gradient(180deg, rgba(59,39,23,.96), rgba(28,18,11,.96)) !important; border: 2px solid var(--to-oro2) !important;
  box-shadow: 0 0 0 2px var(--to-hierro2), 0 4px 10px rgba(0,0,0,.55) !important; color: #f6ead0 !important;
}
body.tema-oscuro #consejo { font-family: var(--to-num); }

/* ============================================================
   VENTANA DE TROPAS / CUARTEL — madera oscura, hierro y oro
   ============================================================ */
body.tema-oscuro #panel.tropas-oscuro {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 2px, transparent 2px 26px, rgba(255,220,160,.035) 26px 28px, transparent 28px 52px),
    linear-gradient(180deg, #33231a, #21160e 60%, #170f09) !important;
  border: 3px solid var(--to-hierro) !important; outline: 2px solid var(--to-oro2); outline-offset: -8px;
  box-shadow: 0 0 0 2px var(--to-hierro2), 0 -6px 22px rgba(0,0,0,.6), inset 0 0 26px rgba(0,0,0,.65) !important;
  color: #f0e2c0 !important;
}
body.tema-oscuro #panel.tropas-oscuro #panel-titulo { font-family: var(--to-letra) !important; font-size: 28px !important; color: var(--to-oro) !important; text-shadow: 0 2px 3px #000 !important; }
body.tema-oscuro #panel.tropas-oscuro #panel-cerrar { background: linear-gradient(#3b2717, #1c120b) !important; border: 2px solid var(--to-oro2) !important; color: var(--to-oro-claro) !important; }
/* pestañas */
body.tema-oscuro #panel.tropas-oscuro .subtabs button {
  background: linear-gradient(#3b2717, #1f140c) !important; border: 2px solid #6a4a22 !important; color: #d9c49a !important;
  font-family: var(--to-num); font-weight: 900 !important; box-shadow: inset 0 1px 0 rgba(255,220,160,.12), 0 2px 0 #000 !important; border-radius: 10px !important;
}
body.tema-oscuro #panel.tropas-oscuro .subtabs button.activo {
  background: linear-gradient(#f2d27a, #c08a2a 70%, #8a5a14) !important; border-color: #ffe9a8 !important; color: #2a1800 !important; text-shadow: 0 1px 0 rgba(255,240,200,.6);
}
/* escenario con las tropas: piedra oscura con luz dorada y marco de oro */
body.tema-oscuro #panel.tropas-oscuro .tropa-escena {
  background:
    radial-gradient(ellipse at 50% 74%, rgba(255,200,110,.38) 0%, rgba(160,100,40,.18) 32%, transparent 60%),
    radial-gradient(ellipse at 50% 40%, #3a2d24 0%, #1e1611 60%, #0e0a07 100%) !important;
  border: 3px solid var(--to-oro2) !important; box-shadow: 0 0 0 2px var(--to-hierro2), inset 0 0 30px rgba(0,0,0,.85) !important; border-radius: 14px !important;
}
body.tema-oscuro #panel.tropas-oscuro .tropa-nombre h3 { font-family: var(--to-letra) !important; font-size: 24px !important; color: var(--to-oro) !important; text-shadow: 0 2px 3px #000 !important; }
body.tema-oscuro #panel.tropas-oscuro .tropa-cuenta span { background: rgba(20,12,7,.85) !important; border: 1px solid var(--to-oro2) !important; color: #f0e2c0 !important; }
body.tema-oscuro #panel.tropas-oscuro .tropa-elegir button {
  background: radial-gradient(circle at 50% 40%, #3b2a1c, #150e08) !important; border: 2px solid #6a4a22 !important; box-shadow: 0 2px 4px rgba(0,0,0,.6) !important;
}
body.tema-oscuro #panel.tropas-oscuro .tropa-elegir button.activo { border-color: var(--to-oro) !important; box-shadow: 0 0 0 2px #3a2000, 0 0 10px rgba(255,200,90,.8) !important; }
/* rangos I-V: medallas de metal con borde de hierro */
body.tema-oscuro #panel.tropas-oscuro .rangos { gap: 7px !important; }
body.tema-oscuro #panel.tropas-oscuro .rangos button {
  min-width: 52px !important; height: 46px !important; border-radius: 12px !important; border: 3px solid #2a2a2c !important;
  box-shadow: 0 0 0 2px var(--to-oro2), 0 4px 8px rgba(0,0,0,.6), inset 0 2px 0 rgba(255,255,255,.25), inset 0 -3px 0 rgba(0,0,0,.35) !important;
  font-family: var(--to-num) !important; text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
body.tema-oscuro #panel.tropas-oscuro .rangos button b { font-size: 17px; }
body.tema-oscuro #panel.tropas-oscuro .r0 { background: linear-gradient(#a8724a, #5e3a1e) !important; color: #ffe9cf !important; }
body.tema-oscuro #panel.tropas-oscuro .r1 { background: linear-gradient(#c9d0d8, #6b747e) !important; color: #1c2228 !important; text-shadow: 0 1px 0 rgba(255,255,255,.5) !important; }
body.tema-oscuro #panel.tropas-oscuro .r2 { background: linear-gradient(#6f8fc0, #2a4370) !important; color: #e8f0ff !important; }
body.tema-oscuro #panel.tropas-oscuro .r3 { background: linear-gradient(#ffe27a, #b07a14) !important; color: #3a2000 !important; text-shadow: 0 1px 0 rgba(255,240,200,.6) !important; }
body.tema-oscuro #panel.tropas-oscuro .r4 { background: linear-gradient(#e0402a, #5a0a0a) !important; color: #ffe9a8 !important; }
body.tema-oscuro #panel.tropas-oscuro .rangos button.activo { transform: translateY(-5px) !important; box-shadow: 0 0 0 2px var(--to-oro-claro), 0 0 14px rgba(255,200,90,.9), 0 6px 10px rgba(0,0,0,.6) !important; }
body.tema-oscuro #panel.tropas-oscuro .rangos button.bloq { filter: grayscale(.85) brightness(.6) !important; opacity: .85 !important; }
body.tema-oscuro #panel.tropas-oscuro .rango-chapa { font-family: var(--to-num); border: 2px solid #2a2a2c !important; box-shadow: 0 0 0 1px var(--to-oro2) !important; }
/* textos, estadísticas y tarjetas */
body.tema-oscuro #panel.tropas-oscuro .nota, body.tema-oscuro #panel.tropas-oscuro p { color: #e0cfa8 !important; }
body.tema-oscuro #panel.tropas-oscuro .aviso-rojo { color: #ff9a7a !important; }
body.tema-oscuro #panel.tropas-oscuro .stats span {
  background: linear-gradient(#2a1c12, #1a110a) !important; border: 1px solid #6a4a22 !important; color: #f0e2c0 !important; border-radius: 8px !important;
}
body.tema-oscuro #panel.tropas-oscuro .stats span.nivel-arm { border-color: var(--to-oro) !important; color: var(--to-oro-claro) !important; }
body.tema-oscuro #panel.tropas-oscuro .carta {
  background: linear-gradient(180deg, rgba(59,39,23,.95), rgba(28,18,11,.95)) !important; border: 2px solid var(--to-oro2) !important; box-shadow: 0 0 0 1px #000, inset 0 0 14px rgba(0,0,0,.5) !important; color: #f0e2c0 !important;
}
body.tema-oscuro #panel.tropas-oscuro .carta h3 { color: var(--to-oro) !important; font-family: var(--to-num); }
/* cantidad, barra y botones */
body.tema-oscuro #panel.tropas-oscuro .tropa-cantidad { background: rgba(15,10,6,.6); border: 1px solid #6a4a22; border-radius: 12px; padding: 6px 8px; }
body.tema-oscuro #panel.tropas-oscuro .tropa-cantidad .redondo { background: linear-gradient(#3b2717, #1c120b) !important; border: 2px solid var(--to-oro2) !important; color: var(--to-oro-claro) !important; }
body.tema-oscuro #panel.tropas-oscuro .tropa-num { color: var(--to-oro) !important; font-family: var(--to-num); font-weight: 900; }
body.tema-oscuro #panel.tropas-oscuro input[type=range] { accent-color: #d8a840; }
body.tema-oscuro #panel.tropas-oscuro .tropa-total, body.tema-oscuro #panel.tropas-oscuro .tropa-total * { color: #f0e2c0 !important; }
body.tema-oscuro #panel.tropas-oscuro button.comprar:not(.morado):not(.rojo):not(.armadura) {
  background: linear-gradient(#f2d27a, #c08a2a 65%, #8a5a14) !important; color: #2a1800 !important; border: 2px solid #ffe9a8 !important;
  box-shadow: 0 0 0 2px #3a2000, 0 4px 0 #2a1800 !important; text-shadow: 0 1px 0 rgba(255,240,200,.5) !important; font-family: var(--to-num); font-weight: 900 !important;
}
body.tema-oscuro #panel.tropas-oscuro button.comprar.armadura { background: linear-gradient(#e0402a, #6a0e0e) !important; color: #ffe9a8 !important; border: 2px solid var(--to-oro) !important; }
body.tema-oscuro #panel.tropas-oscuro .cola, body.tema-oscuro #panel.tropas-oscuro .cola * { color: #f0e2c0; }
/* cabecera del panel y espacio para la barra de abajo nueva */
body.tema-oscuro #panel.tropas-oscuro .panel-cab { background: linear-gradient(180deg, #3b2717, #24170e) !important; border-bottom: 2px solid var(--to-oro2) !important; box-shadow: 0 2px 6px rgba(0,0,0,.5) !important; }
body.tema-oscuro #panel { bottom: calc(90px + env(safe-area-inset-bottom)) !important; max-height: calc(100vh - 190px - env(safe-area-inset-bottom)) !important; }
@media (max-width: 600px) { body.tema-oscuro #panel { bottom: calc(86px + env(safe-area-inset-bottom)) !important; max-height: calc(100vh - 176px - env(safe-area-inset-bottom)) !important; } }
body.tema-oscuro #panel.tropas-oscuro .nota, body.tema-oscuro #panel.tropas-oscuro .cola, body.tema-oscuro #panel.tropas-oscuro .tropa-desc, body.tema-oscuro #panel.tropas-oscuro .stats {
  background: rgba(15,10,6,.55) !important; border-color: #5a3e1e !important;
}
body.tema-oscuro #panel.tropas-oscuro .inv-tropa-btn {
  background: linear-gradient(#3b2717, #1c120b) !important; color: var(--to-oro-claro) !important; border: 2px solid var(--to-oro2) !important;
  box-shadow: 0 0 0 2px #000, 0 3px 0 #000 !important; font-family: var(--to-num); font-weight: 900 !important; text-shadow: 0 1px 2px #000 !important;
}
body.tema-oscuro #panel.tropas-oscuro .tropa-cantidad .comprar.mini { background: linear-gradient(#f2d27a, #c08a2a 65%, #8a5a14) !important; color: #2a1800 !important; border: 2px solid #ffe9a8 !important; }

/* ============================================================
   VENTANA CAFÉ DE LOS EDIFICIOS (v6.33): madera café, pestañas,
   foto grande, siguiente nivel, Mejorando... y tabla de pergamino
   ============================================================ */
body.tema-oscuro #panel.cafe {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 2px, transparent 2px 30px, rgba(255,220,160,.04) 30px 32px, transparent 32px 60px),
    linear-gradient(180deg, #4a3220, #2e1f14 55%, #24180f) !important;
  border: 3px solid #2a1c12 !important; outline: 2px solid #a8782a; outline-offset: -8px;
  box-shadow: 0 0 0 2px #120b06, 0 -6px 22px rgba(0,0,0,.6), inset 0 0 26px rgba(0,0,0,.6) !important; color: #f3e6c8 !important;
}
body.tema-oscuro #panel.cafe .panel-cab { background: linear-gradient(180deg, #5a3d26, #3a2717) !important; border-bottom: 3px solid #a8782a !important; box-shadow: 0 3px 8px rgba(0,0,0,.5) !important; }
body.tema-oscuro #panel.cafe #panel-titulo { font-family: var(--to-letra) !important; font-size: 27px !important; color: #f6dc8a !important; text-shadow: 0 2px 3px #000 !important; }
body.tema-oscuro #panel.cafe #panel-cerrar { background: linear-gradient(#5a3d26, #2a1c12) !important; border: 2px solid #a8782a !important; color: #ffe9a8 !important; }
body.tema-oscuro #panel.cafe .cafe-mas {
  margin-left: auto; margin-right: 8px; padding: 6px 12px; border-radius: 10px; border: 2px solid #c9e89a; display: flex; align-items: center; gap: 5px;
  background: linear-gradient(#7ac04a, #3f8a26 60%, #2a6a18); color: #fff; font-family: var(--to-num); font-weight: 900; font-size: 15px; text-shadow: 0 1px 2px #000; box-shadow: 0 3px 0 #1a3a0c;
}
body.tema-oscuro #panel.cafe .cafe-tabs { display: flex; gap: 8px; margin: 2px 0 10px; }
body.tema-oscuro #panel.cafe .cafe-tabs button, body.tema-oscuro #panel.cafe .subtabs button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; border-radius: 10px !important;
  background: linear-gradient(#6a5a48, #4a3e32) !important; border: 2px solid #2a1c12 !important; color: #d8ccb4 !important;
  font-family: var(--to-num); font-weight: 900 !important; font-size: 17px !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 3px 0 #120b06 !important; text-shadow: 0 1px 2px #000;
}
body.tema-oscuro #panel.cafe .cafe-tabs button.activo, body.tema-oscuro #panel.cafe .subtabs button.activo {
  background: linear-gradient(#f0a050, #c8641c 60%, #9a4410) !important; border-color: #ffd68a !important; color: #fff3d6 !important; box-shadow: 0 0 0 2px #5a2a08, 0 0 12px rgba(255,160,60,.6) !important;
}
body.tema-oscuro #panel.cafe .cafe-tabs button.bloq { opacity: .7; }
body.tema-oscuro #panel.cafe .cafe-tabs .ct-foto img { width: 34px; height: 34px; object-fit: contain; display: block; }
body.tema-oscuro #panel.cafe .carta { background: linear-gradient(180deg, rgba(58,39,23,.92), rgba(36,24,15,.95)) !important; border: 2px solid #6a4a22 !important; box-shadow: inset 0 0 18px rgba(0,0,0,.5) !important; color: #f3e6c8 !important; }
body.tema-oscuro #panel.cafe .cafe-det { display: grid; grid-template-columns: 46% 1fr; gap: 10px; align-items: stretch; margin-bottom: 10px; }
body.tema-oscuro #panel.cafe .cafe-foto {
  border-radius: 10px; border: 3px solid #c9a46a; box-shadow: 0 0 0 2px #2a1c12, inset 0 0 20px rgba(0,0,0,.4); min-height: 170px;
  background: radial-gradient(ellipse at 50% 70%, #f6e7c4, #c9a87a 60%, #8a6a44); display: flex; align-items: center; justify-content: center; font-size: 70px; overflow: hidden;
}
body.tema-oscuro #panel.cafe .cafe-foto img { width: 100%; height: 100%; max-height: 210px; object-fit: contain; }
body.tema-oscuro #panel.cafe .cafe-lado { display: flex; flex-direction: column; gap: 7px; }
body.tema-oscuro #panel.cafe .cafe-desc { margin: 0; font-size: 14px; line-height: 1.35; color: #f3e6c8 !important; background: rgba(20,12,7,.45); border: 1px solid #5a3e1e; border-radius: 8px; padding: 7px 8px; }
body.tema-oscuro #panel.cafe .cafe-sig { background: linear-gradient(#e8a85a, #b8742e); color: #2a1400; border: 2px solid #ffd68a; box-shadow: 0 0 0 1px #5a3008; border-radius: 6px; padding: 7px 8px; font-weight: 800; font-size: 14px; line-height: 1.3; }
body.tema-oscuro #panel.cafe .cafe-mejorando { color: #ff6a50; font-family: var(--to-num); font-weight: 900; font-size: 17px; text-shadow: 0 1px 2px #000; }
body.tema-oscuro #panel.cafe .cafe-reloj { background: rgba(20,12,7,.7); border: 2px solid #6a4a22; border-radius: 10px; padding: 6px 10px; text-align: center; font-family: var(--to-num); font-weight: 900; font-size: 20px; color: #ffe9a8; }
body.tema-oscuro #panel.cafe .reloj-panel { font-family: var(--to-num); font-weight: 900; font-size: 20px; color: #ffe9a8 !important; background: rgba(20,12,7,.7); border: 2px solid #6a4a22; border-radius: 10px; padding: 4px 10px; display: inline-block; }
body.tema-oscuro #panel.cafe .nota b { color: #ff7a5c; }
body.tema-oscuro #panel.cafe .cafe-oculto { display: none !important; }
body.tema-oscuro #panel.cafe .stats span { background: linear-gradient(#3a2717, #24180f) !important; border: 1px solid #6a4a22 !important; color: #f3e6c8 !important; }
body.tema-oscuro #panel.cafe .obra-botones { display: flex !important; gap: 10px; margin: 8px 0 10px; flex-wrap: wrap; }
body.tema-oscuro #panel.cafe .obra-botones > button { flex: 1 1 30%; min-height: 54px; font-size: 19px !important; font-family: var(--to-num); font-weight: 900 !important; border-radius: 12px !important; text-shadow: 0 1px 2px #000 !important; }
body.tema-oscuro #panel.cafe button.comprar.azul { background: linear-gradient(#5a9ae8, #2a62b8 60%, #1a4288) !important; border: 2px solid #a8d0ff !important; color: #fff !important; box-shadow: 0 0 0 2px #0c2448, 0 4px 0 #0c2448 !important; }
body.tema-oscuro #panel.cafe button.comprar.verde { background: linear-gradient(#7ac04a, #3f8a26 60%, #2a6a18) !important; border: 2px solid #c9e89a !important; color: #fff !important; box-shadow: 0 0 0 2px #1a3a0c, 0 4px 0 #1a3a0c !important; }
body.tema-oscuro #panel.cafe button.comprar.morado { background: linear-gradient(#9a6ad8, #6a3aa8) !important; border: 2px solid #d8b8ff !important; color: #fff !important; }
body.tema-oscuro #panel.cafe button.comprar.rojo { background: linear-gradient(#d8503a, #8a1e12) !important; border: 2px solid #ffb0a0 !important; color: #fff !important; }
body.tema-oscuro #panel.cafe .banner-rojo { background: linear-gradient(#c8402a, #8a1e12) !important; color: #fff !important; border: 2px solid #ffb0a0 !important; border-radius: 8px; font-weight: 900; text-shadow: 0 1px 2px #000; }
body.tema-oscuro #panel.cafe table.req { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: 10px; overflow: hidden; border: 3px solid #5a3d26; box-shadow: 0 0 0 2px #2a1c12; background: linear-gradient(#efe0bc, #d9c393) !important; }
body.tema-oscuro #panel.cafe table.req th { background: linear-gradient(#5a3d26, #3a2717) !important; color: #f6dc8a !important; font-family: var(--to-num); font-size: 16px; padding: 8px 6px; border: 0 !important; }
body.tema-oscuro #panel.cafe table.req td { color: #2a1a0c !important; font-weight: 800; font-size: 15px; padding: 8px 6px; border: 0 !important; border-top: 1px solid rgba(90,60,30,.35) !important; background: transparent !important; }
body.tema-oscuro #panel.cafe table.req tr.no td { color: #9a1e12 !important; }
body.tema-oscuro #panel.cafe table.req tr.tiempo td { background: rgba(90,60,30,.15) !important; }
@media (max-width: 600px) {
  body.tema-oscuro #panel.cafe .cafe-det { grid-template-columns: 1fr; }
  body.tema-oscuro #panel.cafe .cafe-foto { min-height: 140px; }
  body.tema-oscuro #panel.cafe #panel-titulo { font-size: 22px !important; }
  body.tema-oscuro #panel.cafe .cafe-tabs button { font-size: 14px !important; min-height: 46px; }
}
body.tema-oscuro #panel-rey .pr-pob { font-family: var(--to-num); font-weight: 900; font-size: 12px; color: #f0e2c0; text-shadow: 0 1px 2px #000; border-top: 1px solid rgba(232,196,106,.35); padding-top: 4px; }
body.tema-oscuro #panel-rey .pr-pob.llena { color: #ff8a6a; }

/* ============================================================
   VENTANA DEL EDIFICIO (v6.38): como la foto del dueño
   ============================================================ */
body.tema-oscuro #panel.cafe .ve-icono { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 8px; border: 2px solid #c9a46a; background: linear-gradient(#5a3d26, #2a1c12); box-shadow: 0 0 0 2px #120b06; display: flex; align-items: center; justify-content: center; margin-right: 8px; }
body.tema-oscuro #panel.cafe .ve-icono img { width: 36px; height: 36px; object-fit: contain; }
body.tema-oscuro #panel.cafe .ve { display: flex; flex-direction: column; gap: 10px; }
body.tema-oscuro #panel.cafe .ve-arriba { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start; position: relative; padding-right: 4px; }
body.tema-oscuro #panel.cafe .ve-foto { width: 96px; height: 80px; border-radius: 6px; border: 2px solid #c9a46a; box-shadow: 0 0 0 2px #2a1c12; overflow: hidden; background: radial-gradient(ellipse at 50% 70%, #f6e7c4, #c9a87a 60%, #8a6a44); display: flex; align-items: center; justify-content: center; font-size: 40px; }
body.tema-oscuro #panel.cafe .ve-foto img { width: 100%; height: 100%; object-fit: cover; }
body.tema-oscuro #panel.cafe .ve-desc { margin: 0; font-size: 14px; line-height: 1.35; color: #f3e6c8 !important; padding-bottom: 28px; }
body.tema-oscuro #panel.cafe .ve-info { position: absolute; right: 2px; bottom: 0; width: 30px; height: 30px; border-radius: 4px; border: 1px solid #6a4a22; background: linear-gradient(#4a3424, #2a1c12); color: #f0c040; font: 900 18px Georgia, serif; box-shadow: inset 0 0 0 1px rgba(255,220,150,.15); cursor: pointer; }
body.tema-oscuro #panel.cafe .ve-stats.oculto { display: none; }
body.tema-oscuro #panel.cafe .ve-sig { display: grid; grid-template-columns: 96px 1fr; gap: 10px; }
body.tema-oscuro #panel.cafe .ve-sig-n, body.tema-oscuro #panel.cafe .ve-sig-t { background: rgba(20,12,7,.62); border: 1px solid #4a3220; border-radius: 8px; box-shadow: inset 0 0 12px rgba(0,0,0,.6); color: #f3e6c8; }
body.tema-oscuro #panel.cafe .ve-sig-n { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 15px; padding: 10px 4px; min-height: 76px; }
body.tema-oscuro #panel.cafe .ve-sig-n b { font-size: 20px; font-weight: 600; margin-top: 4px; }
body.tema-oscuro #panel.cafe .ve-sig-t { padding: 12px; font-size: 14px; line-height: 1.35; }
body.tema-oscuro #panel.cafe .ve-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-left: 106px; }
body.tema-oscuro #panel.cafe .ve-botones > .bloqueado-tr { grid-column: 1 / -1; }
body.tema-oscuro #panel.cafe .ve-botones > button { min-height: 60px; border-radius: 6px !important; font-family: Georgia, 'Times New Roman', serif !important; font-weight: 700 !important; font-size: 19px !important; text-shadow: 0 1px 2px #000 !important; padding: 6px 4px !important; }
body.tema-oscuro #panel.cafe .ve-botones > button.azul { background: linear-gradient(#2f6fb4, #1c4f8c 60%, #143a6a) !important; border: 2px solid #0c2448 !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 0 #08182e !important; color: #fff !important; }
body.tema-oscuro #panel.cafe .ve-botones > button.verde { background: linear-gradient(#2fa034, #1d7a22 60%, #145a18) !important; border: 2px solid #0c3a0e !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 0 #082a0a !important; color: #fff !important; }
body.tema-oscuro #panel.cafe .ve-botones > button .costo, body.tema-oscuro #panel.cafe .ve-botones > button .ico { font-size: 13px; }
body.tema-oscuro #panel.cafe .ve-tiempo { display: flex; justify-content: space-between; align-items: center; margin-left: 106px; color: #f3e6c8; font-size: 14px; }
body.tema-oscuro #panel.cafe .ve-gemas { display: flex; align-items: center; gap: 4px; font-weight: 800; }
body.tema-oscuro #panel.cafe .ve-mejorando { margin: 0 0 0 106px; color: #ff8a6a; font-weight: 800; }
body.tema-oscuro #panel.cafe table.ve-tabla { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: 8px; overflow: hidden; border: 2px solid #4a3220; background: rgba(20,12,7,.55); box-shadow: inset 0 0 14px rgba(0,0,0,.6); }
body.tema-oscuro #panel.cafe table.ve-tabla th { background: linear-gradient(#4a3020, #2e1d12); color: #f3e6c8; font-weight: 500; font-size: 16px; padding: 9px 6px; border-right: 1px solid #1a100a; }
body.tema-oscuro #panel.cafe table.ve-tabla th:last-child { border-right: 0; }
body.tema-oscuro #panel.cafe table.ve-tabla td { color: #f3e6c8; font-size: 15px; padding: 8px 8px; border-top: 1px solid rgba(90,60,30,.35); white-space: nowrap; }
body.tema-oscuro #panel.cafe table.ve-tabla tr.no td { color: #ff8a6a; }
body.tema-oscuro #panel.cafe .ve-r { width: 22px; height: 22px; vertical-align: middle; margin-right: 6px; object-fit: contain; }
body.tema-oscuro #panel.cafe .ve-ok { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; margin-right: 6px; font-size: 13px; font-weight: 900; color: #fff; vertical-align: middle; }
body.tema-oscuro #panel.cafe .ve-ok.si { background: radial-gradient(circle at 35% 30%, #c8f27a, #5aa81e 60%, #2e6a0c); box-shadow: 0 0 0 1px #1a3a06; }
body.tema-oscuro #panel.cafe .ve-ok.no { background: radial-gradient(circle at 35% 30%, #ff9a7a, #c8301e 60%, #7a140c); }
body.tema-oscuro #panel.cafe .ve-demoler, body.tema-oscuro #panel.cafe .ve-cancelar { align-self: flex-start; width: 46%; min-height: 54px; border-radius: 6px !important; font-family: Georgia, 'Times New Roman', serif !important; font-weight: 700 !important; font-size: 19px !important; background: linear-gradient(#b8281e, #8a1810 60%, #6a100a) !important; border: 2px solid #3a0806 !important; color: #fff !important; text-shadow: 0 1px 2px #000; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 3px 0 #2a0604 !important; }
body.tema-oscuro #panel.cafe .ve-tabs button { min-height: 46px; font-family: Georgia, 'Times New Roman', serif !important; font-weight: 500 !important; }
@media (max-width: 420px) {
  body.tema-oscuro #panel.cafe .ve-botones, body.tema-oscuro #panel.cafe .ve-tiempo, body.tema-oscuro #panel.cafe .ve-mejorando { margin-left: 0; }
  body.tema-oscuro #panel.cafe .ve-botones > button { font-size: 17px !important; }
  body.tema-oscuro #panel.cafe table.ve-tabla td { font-size: 13px; padding: 7px 5px; }
}

/* ---------------- v6.48: BARRA DE ARRIBA NUEVA (jugador | ciudad | gemas + recursos) ----------------
   azul noche con borde dorado; las gemas en verde. Sin café. */
body.tk-barra-nueva #arriba { opacity: 0 !important; pointer-events: none !important; }
body.tk-barra-nueva #panel-rey #perfil, body.tk-barra-nueva #panel-rey #ciudad-nombre, body.tk-barra-nueva #panel-rey .pr-banner { display: none !important; }
#tk-arriba { position: fixed; z-index: 31; left: 50%; transform: translateX(-50%); top: calc(4px + env(safe-area-inset-top)); width: min(760px, calc(100vw - 10px)); display: flex; flex-direction: column; gap: 3px; font-family: var(--to-num, sans-serif); }
#tk-arriba .tk-fila1 { display: grid; grid-template-columns: 1fr 1.25fr 0.85fr; gap: 4px; }
#tk-arriba button { display: flex; align-items: center; gap: 6px; min-width: 0; height: 44px; padding: 3px 8px; border-radius: 9px; cursor: pointer; color: #fff; text-align: left;
  background: linear-gradient(#2b3a5c, #18223a); border: 2px solid #c9a24a; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 2px 6px rgba(0,0,0,.55); }
#tk-arriba button:active { transform: scale(.97); }
#tk-arriba .tk-dat { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
#tk-arriba .tk-dat b { font-size: 13px; font-weight: 900; color: #fff4d0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
#tk-arriba .tk-dat small { font-size: 11px; font-weight: 700; color: #ffd86a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tk-jugador .tk-nv { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 7px; font-size: 9px; font-weight: 800; color: #ffe9a0;
  background: radial-gradient(#3e5585, #1a2440); border: 1px solid #c9a24a; }
#tk-jugador .tk-nv b { font-size: 15px; color: #fff; line-height: 1; }
#tk-ciudad { justify-content: center; }
#tk-ciudad img { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 1px 2px #000); }
#tk-ciudad .tk-dat { align-items: center; }
#tk-gemas { justify-content: space-between; background: linear-gradient(#5ccf4e, #22882a) !important; border-color: #b8f0a0 !important; }
#tk-gemas .tk-dat b { font-size: 15px; color: #fff; }
#tk-gemas .tk-dat small { color: #eaffdc; font-size: 12px; }
#tk-gemas img { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 0 3px #fff); }
#tk-arriba .tk-fila2 { display: flex; justify-content: space-around; align-items: center; gap: 4px; height: 24px; padding: 0 6px; border-radius: 7px;
  background: linear-gradient(#1d2944, #121a2e); border: 1px solid rgba(201,162,74,.75); box-shadow: 0 2px 5px rgba(0,0,0,.5); }
#tk-arriba .tk-rec { display: flex; align-items: center; gap: 3px; cursor: pointer; min-width: 0; }
#tk-arriba .tk-rec img { width: 18px; height: 18px; object-fit: contain; flex: none; }
#tk-arriba .tk-rec b { font-size: 12px; font-weight: 900; color: #fff4d0; white-space: nowrap; text-shadow: 0 1px 2px #000; }
#tk-arriba .tk-hierro { display: inline-block; width: 18px; height: 11px; flex: none; border-radius: 2px; transform: skewX(-12deg);
  background: linear-gradient(#e6ecf3, #8d99a8 55%, #55606e); border: 1px solid #2f3742; box-shadow: inset 0 1px 0 #fff; }
@media (max-width: 420px) { #tk-arriba .tk-dat b { font-size: 12px; } #tk-arriba .tk-rec b { font-size: 11px; } #tk-arriba .tk-rec img { width: 15px; height: 15px; } }

/* ---------------- v6.48: MENÚ EN CUADRÍCULA (azul noche, no café) ---------------- */
#menu-grande { background: linear-gradient(#22304f, #121a2e) !important; border-top: 3px solid #c9a24a !important; }
#menu-grande .mg-cab { background: linear-gradient(#2b3a5c, rgba(27,38,62,.97)) !important; border-bottom: 1px solid rgba(201,162,74,.6); }
#menu-grande .mg-rejilla { grid-template-columns: repeat(6, 1fr) !important; gap: 8px 4px !important; padding: 10px 8px 14px; }
@media (max-width: 520px) { #menu-grande .mg-rejilla { grid-template-columns: repeat(5, 1fr) !important; } }
#menu-grande .mg-item { background: none !important; border: 0 !important; padding: 4px 0 !important; }
#menu-grande .mg-ico { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 12px;
  background: radial-gradient(#3e5585, #1a2440); border: 2px solid #c9a24a; box-shadow: 0 2px 5px rgba(0,0,0,.5); }
#menu-grande .mg-img { width: 44px; height: 44px; object-fit: contain; }
#menu-grande .mg-emoji { font-size: 28px; }
#menu-grande .mg-txt { font-size: 12px; font-weight: 800; color: #f2ead6; text-shadow: 0 1px 2px #000; text-align: center; white-space: nowrap; }
#tk-arriba, #tk-arriba * { text-transform: none !important; letter-spacing: 0 !important; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important; }

/* ---------------- v6.50: DISEÑO FINO (como pidió el dueño) ----------------
   barras de lado a lado de la pantalla, sin el cuadro del Castillo, gema de verdad,
   botones oscuros y finos con dorado suave; menú café oscuro elegante */
:root { --tk-fondo1: #1c2233; --tk-fondo2: #10141f; --tk-oro-suave: rgba(214,178,108,.55); --tk-texto: #f2e6c8; }
body.tk-barra-nueva #panel-rey { display: none !important; }
#tk-arriba { left: 0 !important; transform: none !important; width: 100vw !important; top: env(safe-area-inset-top) !important; gap: 0 !important;
  background: linear-gradient(var(--tk-fondo1), var(--tk-fondo2)); border-bottom: 1px solid var(--tk-oro-suave); box-shadow: 0 2px 8px rgba(0,0,0,.45); }
#tk-arriba .tk-fila1 { grid-template-columns: 1.1fr 1.2fr 0.8fr auto !important; gap: 4px !important; padding: 3px 6px 2px; }
#tk-arriba button { height: 38px !important; border-radius: 7px !important; background: linear-gradient(#262e45, #161b2a) !important; border: 1px solid var(--tk-oro-suave) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 3px rgba(0,0,0,.4) !important; }
#tk-gemas { background: linear-gradient(#262e45, #161b2a) !important; border-color: var(--tk-oro-suave) !important; }
#tk-gemas .tk-dat b { color: #e6ccff !important; }
#tk-gemas .tk-dat small { color: #d6b26c !important; }
#tk-arriba .tk-gema { width: 26px; height: 23px; flex: none; filter: drop-shadow(0 0 3px rgba(190,130,255,.6)) drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
#tk-jugador .tk-nv { background: linear-gradient(#2f3a58, #1a2032) !important; border: 1px solid var(--tk-oro-suave) !important; width: 30px !important; height: 30px !important; }
#tk-arriba .tk-botones { display: flex; gap: 4px; align-items: center; }
#tk-arriba .tk-botones button { width: 38px; padding: 0 !important; justify-content: center; font-size: 12px !important; font-weight: 800; color: var(--tk-texto) !important; }
#tk-arriba .tk-fila2 { border-radius: 0 !important; border: 0 !important; border-top: 1px solid rgba(214,178,108,.25) !important; box-shadow: none !important; background: rgba(8,11,18,.55) !important; height: 22px !important; padding: 0 10px !important; }
/* vida del castillo: barrita fina debajo de la barra de arriba, solo cuando está herido */
#vida-castillo.tk-vida { position: fixed !important; z-index: 30; left: 50% !important; right: auto !important; transform: translateX(-50%) !important;
  width: min(320px, 70vw) !important; display: none !important; background: rgba(16,20,31,.85) !important; border: 1px solid var(--tk-oro-suave) !important; border-radius: 8px !important; padding: 3px 8px !important; }
#vida-castillo.tk-vida.tk-ver { display: block !important; }
/* barra de abajo de lado a lado, con el botón Castillo a la izquierda */
body.tema-oscuro #abajo { left: 0 !important; transform: none !important; width: 100vw !important; bottom: 0 !important; border-radius: 0 !important;
  background: linear-gradient(var(--tk-fondo1), var(--tk-fondo2)) !important; border: 0 !important; border-top: 1px solid var(--tk-oro-suave) !important; box-shadow: 0 -2px 8px rgba(0,0,0,.45) !important;
  padding-bottom: calc(5px + env(safe-area-inset-bottom)) !important; outline: none !important; }
body.tema-oscuro #abajo #tk-castillo .tk-cas-ico { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; font-size: 28px; border-radius: 50%;
  background: radial-gradient(#2f3a58, #151a28); border: 1px solid var(--tk-oro-suave); box-shadow: 0 2px 5px rgba(0,0,0,.5); }
/* botones de la derecha: oscuros y finos */
body.tema-oscuro #lateral .redondo, body.tema-oscuro #lateral .pill { background: linear-gradient(#262e45, #161b2a) !important; border: 1px solid var(--tk-oro-suave) !important;
  color: var(--tk-texto) !important; box-shadow: 0 1px 4px rgba(0,0,0,.45) !important; }
body.tema-oscuro #lateral .pill b, body.tema-oscuro #lateral .redondo b { color: var(--tk-texto) !important; }
/* menú: café oscuro elegante, iconos redondeados con sombra suave, sin bordes gruesos */
#menu-grande { background: linear-gradient(#2a1e15, #150e09) !important; border-top: 1px solid var(--tk-oro-suave) !important; }
#menu-grande .mg-cab { background: linear-gradient(#33251a, rgba(32,23,16,.97)) !important; border-bottom: 1px solid rgba(214,178,108,.3) !important; }
#menu-grande .mg-cab b { color: #e9d3a0 !important; font-weight: 700; }
#menu-grande .mg-ico { border: 1px solid rgba(214,178,108,.35) !important; border-radius: 14px !important; background: radial-gradient(#3a2c20, #1d150e) !important; box-shadow: 0 3px 8px rgba(0,0,0,.55) !important; }
#menu-grande .mg-txt { color: #eadcbc !important; font-weight: 700 !important; }
/* el aviso del tutorial va debajo de la barra de arriba, no encima */
body.tk-barra-nueva #consejo { top: calc(env(safe-area-inset-top) + 76px) !important; }
/* la barra vieja de arriba queda apagada del todo (no roba toques) */
body.tk-barra-nueva #arriba, body.tk-barra-nueva #arriba * { pointer-events: none !important; visibility: hidden !important; }
/* teléfono: barra de arriba más compacta */
@media (max-width: 520px) {
  #tk-arriba .tk-fila1 { grid-template-columns: 1fr 1.05fr 0.75fr auto !important; gap: 3px !important; padding: 3px 4px 2px; }
  #tk-arriba button { padding: 2px 5px !important; gap: 4px !important; }
  #tk-jugador .tk-nv { width: 24px !important; height: 26px !important; font-size: 8px !important; }
  #tk-ciudad img { width: 24px !important; height: 24px !important; }
  #tk-arriba .tk-gema { width: 20px; height: 18px; }
  #tk-arriba .tk-botones button { width: 28px !important; font-size: 10px !important; }
}
#vida-castillo.tk-vida { left: 8px !important; transform: none !important; width: min(230px, 56vw) !important; }

/* ---------------- v6.53: CHAT DEL MUNDO SIEMPRE VISIBLE ABAJO ---------------- */
#chat-barra { position: fixed; left: 0; right: 0; z-index: 41; display: flex; align-items: stretch; gap: 6px; padding: 3px 6px; box-sizing: border-box;
  background: linear-gradient(rgba(16,20,31,.92), rgba(10,13,21,.95)); border-top: 1px solid var(--tk-oro-suave, rgba(214,178,108,.55)); }
#chat-barra .cb-ico { position: relative; flex: none; width: 38px; border-radius: 8px; border: 1px solid var(--tk-oro-suave, rgba(214,178,108,.55)); background: linear-gradient(#262e45, #161b2a); font-size: 19px; cursor: pointer; color: #fff; }
#chat-barra .cb-ico .badge { position: absolute; top: -5px; right: -5px; }
#chat-barra .cb-ico .badge:empty { display: none; }
#chat-barra .cb-msgs { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; cursor: pointer; }
#chat-barra .cb-m { font: 600 12px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #e9e2cf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chat-barra .cb-m b { color: #ffd86a; font-weight: 800; }
#chat-barra .cb-m small { margin-left: 6px; color: #9aa3b5; font-size: 11px; }
#chat-barra .cb-mundo { margin-right: 3px; font-size: 11px; }
#chat-barra .cb-vacio { color: #9aa3b5; font-weight: 600; }
#chat-barra .cb-escribir { flex: 0 0 34%; display: flex; gap: 4px; align-items: center; margin: 0; }
#chat-barra .cb-escribir input { flex: 1; min-width: 0; height: 30px; border-radius: 7px; border: 1px solid rgba(214,178,108,.4); background: #0d111b; color: #fff; padding: 0 8px; font: 13px system-ui, sans-serif; }
#chat-barra .cb-escribir button { flex: none; width: 34px; height: 30px; border-radius: 7px; border: 1px solid var(--tk-oro-suave, rgba(214,178,108,.55)); background: linear-gradient(#3a4a72, #1d2640); color: #ffd86a; font-size: 15px; cursor: pointer; }
@media (max-width: 520px) { #chat-barra .cb-escribir { flex: none; } #chat-barra .cb-escribir input { display: none; } #chat-barra .cb-escribir button { width: 38px; height: 34px; } #chat-barra .cb-m { font-size: 11.5px; } }
/* lo que flota justo encima de la barra de abajo sube para dejar ver el chat */
body.con-chat-barra #btn-vista, body.con-chat-barra #btn-menu-mas, body.con-chat-barra #barra-acciones { translate: 0 calc(-1 * var(--alto-chat, 0px)); }
body.mg-abierto #chat-barra { display: none; }

/* ---------------- v6.54: CABALLEROS (equipo con números que suben, salón, guía) ---------------- */
#eq-guia { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 8, 6, .6); }
#eq-guia .ac-caja { max-width: 440px; }
#eq-guia p { margin: 8px 2px; line-height: 1.45; }
.eq-numeros { display: flex; gap: 8px; align-items: stretch; margin: 6px 0 10px; }
.eqn { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 10px; background: rgba(0,0,0,.28); border: 1px solid rgba(214,178,108,.45); position: relative; }
.eqn .eqn-ico { font-size: 20px; line-height: 1; }
.eqn small { font-size: 11px; opacity: .85; }
.eqn b { font-size: 20px; font-weight: 900; }
.eqn b s { font-size: 14px; opacity: .6; font-weight: 700; }
.eqn em { position: absolute; top: 4px; right: 8px; font-style: normal; font-weight: 900; font-size: 15px; }
.eqn.sube { border-color: #5fd35a; box-shadow: 0 0 10px rgba(95,211,90,.45); animation: eqnSube 1.2s ease-out; }
.eqn.sube b, .eqn.sube em { color: #6fe36a; }
.eqn.baja { border-color: #e0605a; }
.eqn.baja b, .eqn.baja em { color: #ff8a80; }
@keyframes eqnSube { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
.eq-guia-btn { flex: none; width: 34px; border-radius: 10px; border: 1px solid rgba(214,178,108,.6); background: linear-gradient(#3a4a72, #1d2640); color: #ffd86a; font-weight: 900; font-size: 18px; cursor: pointer; }
.hf-foto { position: relative; }
.hf-piezas { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; justify-content: center; gap: 3px; flex-wrap: wrap; pointer-events: none; }
.hfp { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 14px; border-radius: 6px; background: rgba(0,0,0,.45); opacity: .35; filter: grayscale(1); }
.hfp.puesta { opacity: 1; filter: none; background: rgba(40,30,10,.8); box-shadow: 0 0 0 1px #d6b26c; }
.hfp.puesta.raro { box-shadow: 0 0 0 1px #5aa8ff; } .hfp.puesta.epico { box-shadow: 0 0 0 1px #c07aff; } .hfp.puesta.legendario { box-shadow: 0 0 0 1px #ffb23a; }
.salon-lista { display: flex; flex-direction: column; gap: 8px; }
.salon-fila { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; background: rgba(0,0,0,.25); border: 1px solid rgba(214,178,108,.35); }
.salon-foto { flex: none; width: 54px; height: 54px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(214,178,108,.6); }
.salon-foto img, .salon-foto > * { width: 100%; height: 100%; object-fit: cover; }
.salon-dat { flex: 1; min-width: 0; }
.salon-dat > b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.salon-st { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; margin: 2px 0 4px; }
.salon-exp { height: 14px; }
.salon-bts { flex: none; display: flex; flex-direction: column; gap: 4px; }
.salon-bts button { min-width: 74px; }

/* v6.54: la ficha de otro reino no borronea el mapa: se ve su castillo detrás (solo la tarjeta es de vidrio) */
body #ficha-ciudad { background: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border: 0 !important; box-shadow: none !important; pointer-events: none; }
body #ficha-ciudad .fc-caja { pointer-events: auto; }

/* ---------------- v6.54: MUNDO — tarjeta encima de la casilla y coordenadas X/Y en cajitas ---------------- */
.tarjeta-anclada { position: fixed !important; z-index: 45 !important; width: min(340px, calc(100vw - 16px)) !important; max-width: none !important; margin: 0 !important; transform: none !important; right: auto !important; bottom: auto !important; }
.tarjeta-anclada::after { content: ''; position: absolute; left: var(--flecha-x, 50%); bottom: -12px; transform: translateX(-50%); border: 12px solid transparent; border-bottom: 0; border-top-color: rgba(214,178,108,.85); }
.tarjeta-anclada.abajo::after { bottom: auto; top: -12px; border-top: 0; border-bottom: 12px solid rgba(214,178,108,.85); }
#mundo-xy .mxy-et { font-size: 12px; font-weight: 800; color: #ffd86a; margin: 0 4px 0 6px; }
#mundo-xy .mxy-v { display: inline-block; min-width: 46px; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.92); color: #3a2a14; font-weight: 900; text-align: center; }
#mundo-xy { white-space: nowrap; }
@media (max-width: 520px) { #mundo-xy .mxy-v { min-width: 34px; padding: 1px 5px; } #mundo-xy .mxy-et { margin: 0 3px 0 4px; } .tarjeta-anclada .fc-cab { font-size: 14px; } }
/* v6.54: Ciudad / Mundo dentro de la barra de abajo, en la esquina izquierda */
body.tema-oscuro #abajo #btn-vista { position: relative !important; left: auto !important; bottom: auto !important; translate: none !important; flex: none; width: 58px !important; height: 58px !important; margin: -14px 4px 0 2px !important; z-index: 2; }
/* tarjeta del mundo más compacta en el teléfono, para que quepa encima del castillo */
@media (max-width: 520px) { .tarjeta-anclada .fc-retrato { width: 54px !important; height: 54px !important; font-size: 26px !important; } .tarjeta-anclada .fc-fila { padding-top: 1px !important; padding-bottom: 1px !important; font-size: 12px !important; } .tarjeta-anclada .fc-botones button { padding-top: 6px !important; padding-bottom: 6px !important; } }
/* la tarjeta del mundo va por encima de la barra de acciones */
.tarjeta-anclada { z-index: 60 !important; }
.tarjeta-anclada { overflow: visible !important; }

/* ---------------- v6.54: TARJETA DEL MUNDO estilo pergamino claro (como pidió el dueño) ---------------- */
body .tarjeta-anclada, body .tarjeta-anclada.casilla-info, body #mundo-info .tarjeta-anclada {
  width: min(360px, 76vw) !important; padding: 12px 14px 14px !important; border-radius: 16px !important;
  background: linear-gradient(180deg, #faf1d6, #e8d6aa) !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  border: 2px solid #c8a764 !important; box-shadow: 0 6px 18px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.5) !important;
  color: #2b1d0e !important; font-family: Georgia, "Times New Roman", serif !important;
}
body .tarjeta-anclada * { color: #2b1d0e !important; text-shadow: none !important; }
body .tarjeta-anclada::after { border-top-color: #e3cf9f !important; }
body .tarjeta-anclada.abajo::after { border-bottom-color: #f6ecd2 !important; }
/* título y subtítulo centrados */
body .tarjeta-anclada .fc-cab, body .tarjeta-anclada .perg-tit { text-align: center !important; font: 700 19px/1.2 Georgia, "Times New Roman", serif !important; background: none !important; border: 0 !important; padding: 2px 30px 6px !important; margin: 0 !important; border-bottom: 1px solid rgba(120,90,40,.35) !important; }
body .tarjeta-anclada .fc-cab small, body .tarjeta-anclada .perg-sub { display: block; font: 400 13px/1.3 Georgia, serif !important; color: #5a4626 !important; text-align: center; }
/* filas de datos: sin cajas, texto simple */
body .tarjeta-anclada .fc-fila, body .tarjeta-anclada .casilla-tabla > * { background: none !important; border: 0 !important; font: 400 14px/1.45 Georgia, serif !important; padding: 0 !important; }
body .tarjeta-anclada .fc-datos { background: none !important; border: 0 !important; }
body .tarjeta-anclada .fc-nombre { color: #1f6fb8 !important; font: 700 16px Georgia, serif !important; }
body .tarjeta-anclada .fc-nivel { background: none !important; color: #1f6fb8 !important; }
body .tarjeta-anclada .fc-retrato { border: 2px solid #c8a764 !important; border-radius: 6px !important; }
body .tarjeta-anclada .fc-aviso { background: rgba(170,40,30,.12) !important; border: 1px solid rgba(170,40,30,.4) !important; color: #8a2a1a !important; font-size: 12px !important; }
body .tarjeta-anclada .fc-aviso * { color: #8a2a1a !important; }
/* botones grandes azul marino, como en la foto */
body .tarjeta-anclada .fc-botones, body .tarjeta-anclada .perg-botones { display: flex !important; gap: 18px !important; justify-content: center !important; margin-top: 10px !important; }
body .tarjeta-anclada button.comprar, body .tarjeta-anclada .fc-botones button, body .tarjeta-anclada .perg-botones button {
  flex: 1 1 0 !important; min-height: 50px !important; border-radius: 9px !important;
  background: linear-gradient(180deg, #2f5d9a 0%, #1b3d6e 55%, #10264a 100%) !important;
  border: 2px solid #0b1a33 !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 6px rgba(0,0,0,.35) !important;
  color: #fff !important; font: 700 18px Georgia, "Times New Roman", serif !important;
}
body .tarjeta-anclada button.comprar *, body .tarjeta-anclada .fc-botones button * { color: #fff !important; }
body .tarjeta-anclada button.comprar:disabled { filter: grayscale(.6) brightness(.85); }
body .tarjeta-anclada .fc-x, body .tarjeta-anclada .cerrar { background: rgba(120,90,40,.15) !important; color: #5a4626 !important; border: 1px solid rgba(120,90,40,.4) !important; }

/* v6.54: tarjeta del reino como la foto del dueño: nombre arriba, coordenadas debajo, datos "Poder: 123" alineados a la izquierda */
body .tarjeta-anclada .fc-cab { font-size: 22px !important; }
body .tarjeta-anclada .fc-cuerpo { display: flex !important; gap: 14px !important; align-items: center !important; margin-top: 10px !important; }
body .tarjeta-anclada .fc-retrato { flex: 0 0 86px !important; width: 86px !important; height: 100px !important; border: 3px solid #d4a94a !important; border-radius: 6px !important; box-shadow: 0 2px 5px rgba(0,0,0,.35) !important; }
body .tarjeta-anclada .fc-retrato, body .tarjeta-anclada .fc-retrato * { color: #fff4d0 !important; }
body .tarjeta-anclada .fc-nombre { font: 400 18px/1.3 Georgia, serif !important; color: #2a8ad8 !important; margin-bottom: 4px !important; }
body .tarjeta-anclada .fc-fila { display: block !important; text-align: left !important; font: 400 15px/1.5 Georgia, serif !important; }
@media (max-width: 520px) {
  body .tarjeta-anclada .fc-cab { font-size: 19px !important; }
  body .tarjeta-anclada .fc-retrato { flex-basis: 66px !important; width: 66px !important; height: 78px !important; }
  body .tarjeta-anclada .fc-nombre { font-size: 15px !important; }
  body .tarjeta-anclada .fc-fila { font-size: 13px !important; line-height: 1.45 !important; }
}
body .tarjeta-anclada .fc-fila span { font-weight: 400 !important; opacity: 1 !important; }

/* ---------------- v6.54: BARRAS en color pergamino crema (como la tarjeta del mundo, pedido del dueño) ---------------- */
:root { --perg-1: #faf1d6; --perg-2: #e8d6aa; --perg-borde: #c8a764; --perg-letra: #2b1d0e; --perg-suave: #5a4626; }
/* barra de arriba */
body.tema-oscuro #tk-arriba { background: linear-gradient(180deg, var(--perg-1), var(--perg-2)) !important; border-bottom: 2px solid var(--perg-borde) !important; box-shadow: 0 2px 8px rgba(0,0,0,.35) !important; }
body.tema-oscuro #tk-arriba button { background: linear-gradient(180deg, #fff8e4, #efdfb6) !important; border: 1px solid var(--perg-borde) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.7) !important; }
body.tema-oscuro #tk-arriba .tk-fila2 { background: rgba(255,248,228,.6) !important; border: 1px solid rgba(200,167,100,.6) !important; }
body.tema-oscuro #tk-arriba, body.tema-oscuro #tk-arriba * { color: var(--perg-letra) !important; text-shadow: none !important; }
body.tema-oscuro #tk-arriba .tk-dat small { color: var(--perg-suave) !important; }
body.tema-oscuro #tk-arriba .tk-nv { background: linear-gradient(180deg, #2f5d9a, #10264a) !important; border-color: #0b1a33 !important; }
body.tema-oscuro #tk-arriba .tk-nv, body.tema-oscuro #tk-arriba .tk-nv * { color: #fff !important; }
/* misión de arriba a la izquierda */
body.tema-oscuro #mision { background: linear-gradient(180deg, var(--perg-1), var(--perg-2)) !important; border: 2px solid var(--perg-borde) !important; box-shadow: 0 2px 6px rgba(0,0,0,.35) !important; }
body.tema-oscuro #mision, body.tema-oscuro #mision * { color: var(--perg-letra) !important; text-shadow: none !important; }
/* botones de la derecha */
body.tema-oscuro #lateral .pill, body.tema-oscuro #lateral .redondo, body.tema-oscuro #btn-menu-mas {
  background: linear-gradient(180deg, var(--perg-1), var(--perg-2)) !important; border: 2px solid var(--perg-borde) !important; box-shadow: 0 2px 6px rgba(0,0,0,.35) !important; }
body.tema-oscuro #lateral .pill, body.tema-oscuro #lateral .pill *, body.tema-oscuro #lateral .redondo, body.tema-oscuro #btn-menu-mas { color: var(--perg-letra) !important; text-shadow: none !important; }
/* barra del chat */
body.tema-oscuro #chat-barra { background: linear-gradient(180deg, var(--perg-1), var(--perg-2)) !important; border-top: 2px solid var(--perg-borde) !important; border-bottom: 1px solid var(--perg-borde) !important; }
body.tema-oscuro #chat-barra, body.tema-oscuro #chat-barra * { color: var(--perg-letra) !important; text-shadow: none !important; }
body.tema-oscuro #chat-barra input { background: #fffaf0 !important; border: 1px solid var(--perg-borde) !important; }
body.tema-oscuro #chat-barra input::placeholder { color: #8a7650 !important; }
body.tema-oscuro #chat-barra button { background: linear-gradient(180deg, #2f5d9a, #10264a) !important; border: 1px solid #0b1a33 !important; }
body.tema-oscuro #chat-barra button, body.tema-oscuro #chat-barra button * { color: #fff !important; }
/* barra de abajo */
body.tema-oscuro #abajo { background: linear-gradient(180deg, var(--perg-1), var(--perg-2)) !important; border-top: 2px solid var(--perg-borde) !important; box-shadow: 0 -2px 8px rgba(0,0,0,.3) !important; }
body.tema-oscuro #abajo button, body.tema-oscuro #abajo button * { color: var(--perg-letra) !important; text-shadow: none !important; }
/* el botón Ciudad / Mundo queda dentro de la barra, igual que los demás botones */
body.tema-oscuro #abajo #btn-vista { width: 68px !important; height: 68px !important; margin: 0 !important; border-radius: 50% !important; background: radial-gradient(circle at 50% 40%, #fff8e4, #e3cd96) !important; border: 2px solid var(--perg-borde) !important; }
body.tema-oscuro #abajo #btn-vista::after { background: #10264a !important; color: #fff !important; }
body.tema-oscuro #lateral .pill b, body.tema-oscuro #lateral .pill b#escudo-t, body.tema-oscuro #lateral .pill b#tropas, body.tema-oscuro #lateral .pill b#oleada, body.tema-oscuro #lateral .pill b#entreno-t { color: #2b1d0e !important; -webkit-text-fill-color: #2b1d0e !important; text-shadow: none !important; }
body.tema-oscuro #lateral .redondo svg path { fill: #4a2a00 !important; }
body.tema-oscuro #lateral .redondo svg path[fill="none"] { fill: none !important; stroke: #4a2a00 !important; }
@media (max-width: 520px) {
  body.tema-oscuro #abajo #btn-vista { width: 50px !important; height: 50px !important; margin: 0 2px 0 0 !important; }
  body.tema-oscuro #abajo #btn-vista .bv-ico { font-size: 20px !important; }
}

/* ---------------- v6.55: pantalla más limpia en el celular ---------------- */
/* cajón de botones de la derecha */
#cajon-lateral { display: none; flex-direction: column; align-items: flex-end; gap: inherit; }
#cajon-lateral.abierto { display: flex; animation: cajonAbre .18s ease-out; }
@keyframes cajonAbre { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
body.tema-oscuro #btn-cajon.activo { background: linear-gradient(180deg, #2f5d9a, #10264a) !important; border-color: #0b1a33 !important; }
body.tema-oscuro #btn-cajon.activo path { stroke: #fff !important; }
/* recuadro de tropas: se ve que se puede tocar */
body.tema-oscuro #pill-tropas { cursor: pointer; }
/* el letrero de ayuda se desvanece suave */
#consejo { transition: opacity .35s ease; }
#consejo:empty { opacity: 0; }
/* letras de la barra de abajo: blancas con borde negro, se leen en cualquier fondo */
body.tema-oscuro #abajo button, body.tema-oscuro #abajo button span, body.tema-oscuro #abajo button small {
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  text-shadow: 0 1px 2px #000, 0 0 3px #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000 !important; }
/* el letrero de ayuda también en crema */
body.tema-oscuro #consejo { background: linear-gradient(180deg, #faf1d6, #e8d6aa) !important; border: 2px solid #c8a764 !important; color: #2b1d0e !important; text-shadow: none !important; box-shadow: 0 3px 10px rgba(0,0,0,.35) !important; }
body.tema-oscuro #consejo * { color: #2b1d0e !important; text-shadow: none !important; }

/* ---------------- v6.56: cuadrito de obras (crema) ---------------- */
#colas-obras { position: fixed; left: 8px; z-index: 30; display: flex; flex-direction: column; gap: 5px; width: min(250px, 60vw); pointer-events: auto; }
#colas-obras .co-fila { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 10px; background: linear-gradient(180deg, #faf1d6, #e8d6aa); border: 2px solid #c8a764; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-family: Georgia, "Times New Roman", serif; }
#colas-obras .co-ico { font-size: 18px; flex: none; width: 22px; text-align: center; }
#colas-obras .co-dat { flex: 1; min-width: 0; }
#colas-obras .co-dat b { display: block; font-size: 12px; color: #2b1d0e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#colas-obras .co-barra { position: relative; height: 14px; margin-top: 2px; border-radius: 7px; background: rgba(90,70,38,.25); overflow: hidden; border: 1px solid rgba(120,90,40,.45); }
#colas-obras .co-barra i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #7fd36a, #3c9a2e); transition: width .3s linear; }
#colas-obras .co-barra span { position: relative; display: block; text-align: center; font: 700 10px/14px system-ui, sans-serif; color: #1c1408; }
#colas-obras .co-acel { flex: none; padding: 5px 8px; border-radius: 8px; border: 1px solid #1f5e17; background: linear-gradient(180deg, #6fd25a, #2f8a22); color: #fff; font: 700 12px Georgia, serif; text-shadow: 0 1px 1px rgba(0,0,0,.5); cursor: pointer; }
#colas-obras .co-acel:active { transform: scale(.96); }
@media (max-width: 520px) { #colas-obras { width: min(220px, 58vw); } #colas-obras .co-acel { padding: 4px 6px; font-size: 11px; } }

/* ---------------- v6.57: CHAT y PERFIL DEL JUGADOR en pergamino crema con botones azules ---------------- */
body.tema-oscuro #panel.perg { background: linear-gradient(180deg, #f6ead0, #e6d3a6) !important; border: 2px solid #c8a764 !important; color: #2b1d0e !important; }
body.tema-oscuro #panel.perg #panel-titulo, body.tema-oscuro #panel.perg .nota, body.tema-oscuro #panel.perg #panel-cuerpo { color: #2b1d0e !important; text-shadow: none !important; font-family: Georgia, "Times New Roman", serif; }
body.tema-oscuro #panel.perg #panel-titulo { font: 700 20px Georgia, serif !important; }
#panel.perg .chat-tabs { display: flex !important; gap: 6px !important; }
#panel.perg .chat-tabs button { flex: 1 1 0; padding: 9px 4px !important; border-radius: 8px 8px 4px 4px !important; background: linear-gradient(180deg, #8a5a30, #5e3a1c) !important; border: 1px solid #3a2410 !important; color: #f6e6c0 !important; font: 600 15px Georgia, serif !important; text-shadow: 0 1px 1px #000 !important; }
#panel.perg .chat-tabs button.activo { background: linear-gradient(180deg, #e0a23c, #b06f1c) !important; color: #fff !important; }
#panel.perg .chat-lista { background: rgba(255,250,236,.55) !important; border: 1px solid rgba(160,120,60,.45) !important; }
#panel.perg .chat-lista, #panel.perg .chat-lista * { color: #2b1d0e !important; text-shadow: none !important; }
#panel.perg .chat-quien { color: #1f6fb8 !important; background: none !important; border: 0 !important; font-weight: 700; }
#panel.perg .chat-escribir input { background: #fffaf0 !important; border: 1px solid #c8a764 !important; color: #2b1d0e !important; }
#panel.perg button.comprar.naranja, #panel.perg button.comprar.azul, #panel.perg .pv-cab button { background: linear-gradient(180deg, #2f5d9a, #10264a) !important; border: 1px solid #0b1a33 !important; color: #fff !important; font-family: Georgia, serif !important; }
/* lista de conversaciones privadas */
.pv-lista { display: flex; flex-direction: column; gap: 6px; min-height: 180px; }
.pv-fila { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px; border-radius: 6px; cursor: pointer; background: linear-gradient(180deg, rgba(120,80,40,.28), rgba(90,60,30,.18)); border: 1px solid rgba(90,60,30,.5); font-family: Georgia, serif; }
.pv-fila.nuevo { box-shadow: inset 4px 0 0 #c0302a; }
.pv-av { flex: none; width: 48px; height: 48px; border-radius: 6px; display: grid; place-items: center; font: 700 24px Georgia, serif; color: #fff4d0; background: linear-gradient(#5a7fd0, #2a4a8a); border: 2px solid #d4a94a; }
.pv-dat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pv-top { display: flex; justify-content: space-between; gap: 6px; }
.pv-top b { color: #2b1d0e; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-top small { color: #5a4626; font-size: 12px; flex: none; }
.pv-txt { color: #8a5a1a; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-fila i { font-style: normal; font-size: 26px; color: #c8901e; flex: none; }
.pv-pie { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #2a1d10; }
.pv-pie span { color: #f3e3bd !important; font: 14px/1.4 Georgia, serif; } .pv-pie b { color: #e0a23c !important; }
.pv-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; } .pv-cab b { font: 700 16px Georgia, serif; color: #2b1d0e; }
/* perfil del jugador */
#perfil-jugador { position: fixed; inset: 0; z-index: 320; display: grid; place-items: center; background: rgba(0,0,0,.45); padding: 16px; }
#perfil-jugador .pj-caja { position: relative; width: min(400px, 100%); padding: 16px 16px 18px; border-radius: 14px; background: linear-gradient(180deg, #faf1d6, #e8d6aa); border: 2px solid #c8a764; box-shadow: 0 8px 24px rgba(0,0,0,.5); font-family: Georgia, "Times New Roman", serif; color: #2b1d0e; }
#perfil-jugador h3 { margin: 0 34px 10px; text-align: center; font: 700 20px Georgia, serif; color: #2b1d0e; padding-bottom: 8px; border-bottom: 1px solid rgba(120,90,40,.4); }
#perfil-jugador .pj-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 6px; border: 1px solid #0b1a33; background: linear-gradient(180deg, #2f5d9a, #10264a); color: #ffd84a; font-size: 18px; cursor: pointer; }
#perfil-jugador .pj-cuerpo { display: flex; gap: 14px; align-items: center; }
#perfil-jugador .pj-av { flex: none; width: 80px; height: 92px; border-radius: 6px; display: grid; place-items: center; font: 700 38px Georgia, serif; color: #fff4d0; background: linear-gradient(#5a7fd0, #2a4a8a); border: 3px solid #d4a94a; }
#perfil-jugador .pj-dat { display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: #5a4626; }
#perfil-jugador .pj-dat b { color: #1f6fb8; font-size: 17px; font-weight: 400; }
#perfil-jugador .pj-al { margin: 12px 0; padding: 10px 12px; border-radius: 10px; border: 2px solid #c8a764; background: rgba(255,250,236,.5); display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #5a4626; }
#perfil-jugador .pj-al b { color: #1f6fb8; font-weight: 400; }
#perfil-jugador .pj-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#perfil-jugador .pj-botones button { min-height: 46px; border-radius: 8px; border: 2px solid #0b1a33; background: linear-gradient(180deg, #2f5d9a 0%, #1b3d6e 55%, #10264a 100%); color: #fff; font: 700 16px Georgia, serif; box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 2px 5px rgba(0,0,0,.35); cursor: pointer; }
#perfil-jugador .pj-botones button:disabled { background: linear-gradient(180deg, #6a6a6a, #3a3a3a); border-color: #222; opacity: .85; cursor: default; }
#perfil-jugador .pj-botones button.rojo { grid-column: 1 / -1; background: linear-gradient(180deg, #c0402a, #7a1c10); }
/* cabecera de las ventanas: café oscuro como las fotos, con el botón verde de gemas */
body.tema-oscuro #panel.perg .panel-cab { background: linear-gradient(180deg, #3a2a1a, #23180d) !important; border-bottom: 2px solid #c8a764 !important; }
body.tema-oscuro #panel.perg #panel-titulo { color: #f3e3bd !important; text-align: center; flex: 1; }
#panel-gemas { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 8px; padding: 4px 8px 4px 12px; min-width: 96px; height: 42px; border-radius: 8px; border: 2px solid #c8e6a0; background: linear-gradient(180deg, #5cc24a, #2e8a22); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 5px rgba(0,0,0,.4); cursor: pointer; }
#panel-gemas .pg-dat { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
#panel-gemas b { color: #fff; font: 700 15px Georgia, serif; text-shadow: 0 1px 1px rgba(0,0,0,.5); }
#panel-gemas small { color: #fff; font: 600 13px Georgia, serif; text-shadow: 0 1px 1px rgba(0,0,0,.5); }
#panel-gemas .pg-gema { width: 30px; height: 26px; }
/* burbujas del chat en crema */
#panel.perg .chat-m { background: rgba(255,248,230,.95) !important; border: 1px solid rgba(160,120,60,.45) !important; box-shadow: 0 1px 2px rgba(0,0,0,.12) !important; }
#panel.perg .chat-m.mio { background: #e3edf8 !important; border-color: rgba(47,93,154,.4) !important; }
#panel.perg .chat-m small, #panel.perg .chat-m .hora { color: #7a6440 !important; }
#panel.perg .chat-normas { background: none !important; color: #5a4626 !important; font-size: 12px !important; }
#perfil-jugador .pj-botones button:disabled { color: #e6e6e6 !important; }
.pv-top small { color: #6a5434 !important; }

/* ---------------- v6.58: tarjeta de terreno igual a la del reino ---------------- */
body .tarjeta-anclada.tarjeta-terreno .perg-tit { font-size: 22px !important; }
body .tarjeta-anclada .tt-datos { display: flex; flex-direction: column; gap: 2px; margin: 10px 4px 4px; text-align: left; }
body .tarjeta-anclada .tt-datos > div { font: 400 15px/1.5 Georgia, serif !important; color: #2b1d0e !important; }
body .tarjeta-anclada .tt-datos > div.tt-dueno { color: #1f6fb8 !important; font-size: 17px !important; }
body .tarjeta-anclada .casilla-botones { display: flex; justify-content: center; margin-top: 8px; }
body .tarjeta-anclada .casilla-botones button { flex: 1; min-height: 40px !important; font-size: 14px !important; }
@media (max-width: 520px) { body .tarjeta-anclada .tt-datos > div { font-size: 13px !important; line-height: 1.45 !important; } body .tarjeta-anclada.tarjeta-terreno .perg-tit { font-size: 19px !important; } }
body #mundo-info:has(> .tarjeta-anclada) { transform: none !important; } /* v6.58: si no, la tarjeta del terreno queda corrida abajo */
/* con una tarjeta abierta en el mundo, el letrero de ayuda no la tapa */
body:has(.tarjeta-anclada) #consejo { display: none !important; }
body .tarjeta-anclada button.comprar.azul, body .tarjeta-anclada button.comprar.morado { background: linear-gradient(180deg, #2f5d9a 0%, #1b3d6e 55%, #10264a 100%) !important; }

/* ---------------- v6.58: INVENTARIO como las fotos (café oscuro, filas con icono, Tienes: X y botón azul Usa) ---------------- */
body.tema-oscuro #panel.iv-panel { background: linear-gradient(180deg, #2e2014, #20160d) !important; border: 2px solid #6a4a2a !important; }
body.tema-oscuro #panel.iv-panel .panel-cab { background: linear-gradient(180deg, #3a2a1a, #23180d) !important; border-bottom: 2px solid #6a4a2a !important; }
body.tema-oscuro #panel.iv-panel #panel-titulo { color: #f3e3bd !important; font: 700 20px Georgia, serif !important; text-align: center; flex: 1; text-shadow: none !important; }
.iv-modos { display: flex; gap: 8px; margin-bottom: 8px; }
.iv-modos button { flex: 1; padding: 10px 6px; border-radius: 8px 8px 3px 3px; border: 1px solid #120b05; background: linear-gradient(180deg, #4a2c16, #2a170a); color: #f1e2c0; font: 600 16px Georgia, serif; cursor: pointer; }
.iv-modos button.activo { background: linear-gradient(180deg, #c06a2a, #8a4416); color: #fff; }
.iv-cats { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.iv-flecha { flex: none; width: 26px; height: 36px; border: 0; background: none; color: #e0a23c; font: 700 28px/1 Georgia, serif; cursor: pointer; }
.iv-carril { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.iv-carril::-webkit-scrollbar { display: none; }
.iv-carril button { flex: none; scroll-snap-align: center; padding: 8px 14px; border-radius: 6px; border: 1px solid #120b05; background: linear-gradient(180deg, #3a2414, #24150a); color: #e8d6b0; font: 500 14px Georgia, serif; cursor: pointer; }
.iv-carril button.activo { background: linear-gradient(180deg, #7a4f2c, #5a3518); color: #fff; border-color: #a77a4a; }
.iv-lista { display: flex; flex-direction: column; border-top: 1px solid #120b05; }
.iv-fila { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid #120b05; box-shadow: 0 1px 0 rgba(255,220,160,.06); }
.iv-ico { position: relative; flex: none; width: 54px; height: 54px; border-radius: 6px; display: grid; place-items: center; font-size: 30px; background: linear-gradient(180deg, #8fd0f0, #4a96c8); border: 2px solid #d4a94a; }
.iv-i { position: absolute; top: -3px; left: -3px; width: 18px; height: 18px; border-radius: 4px; background: #2f6fc8; color: #fff; font: italic 700 12px/18px Georgia, serif; text-align: center; border: 1px solid #fff; }
.iv-dat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.iv-dat b { color: #f1e6d0; font: 500 14px Georgia, serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-dat small { color: #e07a2a; font: 500 13px Georgia, serif; }
.iv-boton { flex: none; min-width: 92px; min-height: 40px; padding: 4px 10px; border-radius: 6px; border: 1px solid #0b1a33; background: linear-gradient(180deg, #2f5d9a 0%, #1b3d6e 55%, #10264a 100%); color: #fff; font: 700 16px Georgia, serif; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.iv-boton:disabled { background: linear-gradient(180deg, #5a5a5a, #3a3a3a); color: #ddd; }
.iv-vacio { color: #d9c7a0; text-align: center; padding: 24px 10px; font: 15px Georgia, serif; }
.iv-diario { padding: 8px 0; border-bottom: 1px solid #120b05; }
@media (max-width: 520px) { .iv-boton { min-width: 76px; font-size: 15px; } .iv-ico { width: 48px; height: 48px; font-size: 26px; } }
body.tema-oscuro #panel.iv-panel .iv-dat small { color: #e8842e !important; }
body.tema-oscuro #panel.iv-panel .iv-dat b { color: #f1e6d0 !important; }

/* ---------------- v6.58: AZAR con la Capitana Coral y 9 cofres ---------------- */
.az-guia { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.az-cara { position: relative; flex: none; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 54px; background: radial-gradient(circle at 50% 40%, #ffd86a, #e07a2a 60%, #6a2a10); border: 3px solid #d4a94a; box-shadow: 0 0 18px rgba(255,190,80,.55); }
.az-gorro { position: absolute; top: -10px; right: -6px; font-size: 26px; }
.az-globo { position: relative; flex: 1; padding: 10px 12px; border-radius: 10px; background: #1e140b; border: 1px solid #6a4a2a; color: #f1e2c0; font: 14px/1.4 Georgia, serif; }
.az-globo::before { content: ''; position: absolute; left: -9px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-right-color: #6a4a2a; border-left: 0; }
.az-globo small { display: block; margin-top: 4px; color: #e0a23c; font-style: italic; }
.az-tablero { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px; border-radius: 8px; background: #140d07; border: 2px solid #4a3220; }
.az-celda { aspect-ratio: 1; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: radial-gradient(circle at 50% 40%, #3a2a1c, #1a110a); border: 1px solid #4a3220; overflow: hidden; }
.az-cofre { width: 70%; height: auto; filter: drop-shadow(0 3px 3px rgba(0,0,0,.6)); }
.az-celda.abierta { background: radial-gradient(circle at 50% 45%, #fff2c0, #e0a23c 55%, #6a3a10); border-color: #f2c45a; animation: azAbre .5s ease-out both; }
.az-celda.rara { background: radial-gradient(circle at 50% 45%, #f4e1ff, #a65ef0 55%, #3a1060); border-color: #e0b0ff; box-shadow: 0 0 14px rgba(200,140,255,.8); }
.az-premio { font-size: 34px; }
.az-celda small { color: #2b1d0e; font: 700 11px/1.1 Georgia, serif; text-align: center; padding: 0 3px; }
.az-celda.rara small { color: #fff; }
@keyframes azAbre { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: none; } }
.az-cinta { position: absolute; left: -4px; right: -4px; top: 50%; transform: translateY(-50%); padding: 12px 10px; text-align: center; background: linear-gradient(180deg, rgba(150,95,30,.95), rgba(100,60,15,.95)); border-top: 2px solid #f2c45a; border-bottom: 2px solid #f2c45a; color: #fff6d8; font: 600 16px/1.4 Georgia, serif; text-shadow: 0 1px 2px #000; }
.az-raros span { display: block; font-size: 14px; } .az-raros div { display: flex; justify-content: center; gap: 10px; margin: 6px 0 8px; }
.az-raros b { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; font-size: 28px; background: linear-gradient(180deg, #8fd0f0, #4a96c8); border: 2px solid #d4a94a; }
.az-tienes { text-align: center; color: #e0c890; font: 14px Georgia, serif; margin: 8px 0; } .az-tienes b { color: #fff; }
.az-botones { display: flex; gap: 14px; justify-content: center; }
.az-b { min-width: 120px; min-height: 46px; padding: 6px 14px; border-radius: 6px; color: #fff; font: 700 17px Georgia, serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 5px rgba(0,0,0,.5); }
.az-b.verde { background: linear-gradient(180deg, #5cc24a, #2e8a22); border: 1px solid #1f5e17; }
.az-b.azul { background: linear-gradient(180deg, #2f6fc8, #10264a); border: 1px solid #0b1a33; }
.az-b:disabled { filter: grayscale(.7) brightness(.75); cursor: default; }
@media (max-width: 520px) { .az-cara { width: 70px; height: 70px; font-size: 44px; } .az-premio { font-size: 28px; } .az-cinta { font-size: 14px; } }
body.tema-oscuro #panel.az-panel .az-celda small { color: #2b1d0e !important; text-shadow: none !important; }
body.tema-oscuro #panel.az-panel .az-celda.rara small { color: #fff !important; }
body.tema-oscuro #panel.az-panel .az-globo { color: #f1e2c0 !important; }

/* ---------------- v6.58: CENTRO DE PROMOCIONES ---------------- */
.pr-nota { color: #d9c7a0; font: 14px/1.4 Georgia, serif; margin: 2px 0 8px; text-align: center; }
.pr-lista { display: flex; flex-direction: column; gap: 8px; }
.pr-fila { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 8px; background: linear-gradient(180deg, #3a2716, #24180c); border: 1px solid #5a3d22; }
.pr-fila.lista { border-color: #e0a23c; box-shadow: 0 0 10px rgba(224,162,60,.35); }
.pr-ico { position: relative; flex: none; width: 54px; height: 54px; border-radius: 8px; display: grid; place-items: center; font-size: 30px; background: radial-gradient(circle at 50% 40%, #ffe9a8, #d08a2a 70%); border: 2px solid #d4a94a; }
.pr-ico .punto-rojo { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: #e02a1e; border: 2px solid #fff; }
.pr-dat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pr-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
body.tema-oscuro #panel.pr-panel .pr-top b { color: #f6e6c0 !important; font: 700 15px Georgia, serif; }
body.tema-oscuro #panel.pr-panel .pr-reloj { color: #ff9a5a !important; font: 600 12px Georgia, serif; flex: none; }
body.tema-oscuro #panel.pr-panel .pr-dat small { color: #cdb88e !important; font: 13px/1.3 Georgia, serif; }
.pr-barra { position: relative; height: 14px; border-radius: 7px; background: #140d07; border: 1px solid #5a3d22; overflow: hidden; }
.pr-barra i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #7fd36a, #3c9a2e); }
.pr-barra span { position: relative; display: block; text-align: center; font: 700 10px/14px system-ui, sans-serif; color: #fff; text-shadow: 0 1px 1px #000; }
body.tema-oscuro #panel.pr-panel .pr-premio { color: #f2c45a !important; font: 13px Georgia, serif; }
.pr-b { min-width: 92px !important; min-height: 40px !important; font-size: 15px !important; }
#btn-promos .badge:empty { display: none; }
.pr-top { flex-direction: column; align-items: flex-start; gap: 1px; }
@media (max-width: 520px) { .pr-ico { width: 46px; height: 46px; font-size: 26px; } .pr-b, .pr-fila .iv-boton { min-width: 80px !important; } }

/* ---------------- v6.59: ALIANZA (Info, Miembros, Alianzas, Muro) café oscuro como las fotos ---------------- */
.al-tabs button { font-size: 15px !important; padding: 9px 4px !important; }
body.tema-oscuro #panel.al-panel, body.tema-oscuro #panel.al-panel #panel-cuerpo { color: #f1e2c0 !important; }
.al-info { display: flex; gap: 10px; padding: 10px; border-radius: 8px; border: 1px solid #5a3d22; background: rgba(0,0,0,.18); }
.al-info-dat { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.al-if { display: grid; grid-template-columns: 22px 92px 1fr; align-items: center; gap: 4px; font: 14px Georgia, serif; }
body.tema-oscuro #panel.al-panel .al-if b { color: #f6e6c0 !important; font-weight: 600; } body.tema-oscuro #panel.al-panel .al-if span { color: #e8d6b0 !important; }
body.tema-oscuro #panel.al-panel .al-azul, body.tema-oscuro #panel.al-panel .al-nom { color: #4aa8ff !important; }
.al-bandera { flex: none; width: 74px; height: 96px; display: grid; place-items: center; background: linear-gradient(135deg, #f4f4f4 0 40%, #1d4fa0 40% 60%, #f4f4f4 60%); border: 2px solid #d4a94a; clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); }
.al-bandera span { font: 700 18px Georgia, serif; color: #10264a; background: rgba(255,255,255,.85); padding: 2px 6px; border-radius: 4px; }
.al-desc { margin: 8px 2px; font: 13px Georgia, serif; color: #f2c45a; }
.al-nivel { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.al-nv-ic { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; position: relative; background: radial-gradient(circle, #6a4a2a, #2a1a0c); border: 2px solid #d4a94a; }
.al-nv-ic b { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); font: 700 11px Georgia, serif; color: #f6e6c0; background: #2a1a0c; border: 1px solid #d4a94a; padding: 0 5px; border-radius: 6px; }
.al-nv-barra { flex: 1; height: 20px !important; } .al-nv-barra i { background: linear-gradient(180deg, #ffb74a, #e07a1a) !important; } .al-nv-barra span { line-height: 20px !important; font-size: 12px !important; }
.al-3b { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.al-3b button { min-height: 48px; border-radius: 8px; border: 2px solid #0b1a33; background: linear-gradient(180deg, #2f5d9a 0%, #1b3d6e 55%, #10264a 100%); color: #fff; font: 700 15px Georgia, serif; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.al-filas { display: flex; flex-direction: column; }
.al-fila { display: flex; align-items: center; gap: 8px; padding: 10px 4px; border: 0; border-bottom: 1px solid #120b05; background: none; text-align: left; cursor: pointer; }
.al-fila span { flex: 1; display: flex; flex-direction: column; gap: 3px; }
body.tema-oscuro #panel.al-panel .al-fila b { color: #e8d6b0 !important; font: 500 14px Georgia, serif; } body.tema-oscuro #panel.al-panel .al-fila small { color: #b8a27a !important; font: 13px Georgia, serif; }
.al-new { font-style: normal; color: #fff; background: #c0281e; border-radius: 8px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.al-chev { font-style: normal; color: #e0a23c; font: 700 30px/1 Georgia, serif; background: none; border: 0; cursor: pointer; }
.al-sub { display: flex; gap: 8px; margin-bottom: 10px; }
.al-sub button { flex: 1; padding: 9px 4px; border-radius: 6px; border: 1px solid #120b05; background: linear-gradient(180deg, #3a2414, #24150a); color: #e8d6b0; font: 500 14px Georgia, serif; cursor: pointer; }
.al-sub button.activo { background: linear-gradient(180deg, #7a4f2c, #5a3518); color: #fff; border-color: #a77a4a; }
.al-tabla { border: 1px solid #5a3d22; border-radius: 8px; overflow: hidden; }
.al-th, .al-tr { display: grid; grid-template-columns: 26px 1.4fr .7fr 1fr; align-items: center; gap: 6px; padding: 8px 6px; text-align: center; font: 13px Georgia, serif; }
.al-th3 { grid-template-columns: .8fr 1.6fr .8fr 34px !important; }
.al-th { background: linear-gradient(180deg, #4a2c16, #2e1a0c); } body.tema-oscuro #panel.al-panel .al-th span { color: #f1e2c0 !important; font-weight: 600; }
.al-tr { border-top: 1px solid #120b05; } body.tema-oscuro #panel.al-panel .al-tr span, body.tema-oscuro #panel.al-panel .al-tr small { color: #e8d6b0 !important; }
.al-tr small { display: block; }
.al-nom { background: none; border: 0; padding: 0; cursor: pointer; font: 14px Georgia, serif; }
.al-chk { width: 18px; height: 18px; display: inline-grid; place-items: center; }
.al-haz { grid-template-columns: 26px 1fr !important; text-align: left; }
.al-carta { background: none; border: 0; font-size: 22px; cursor: pointer; }
.al-pag { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 10px; }
.al-pag button { background: none; border: 0; color: #e0a23c; font: 700 24px Georgia, serif; cursor: pointer; }
.al-pag span { padding: 6px 18px; border-radius: 8px; border: 1px solid #6a4a2a; background: #1a110a; color: #f1e2c0; font: 15px Georgia, serif; }
.al-busca { display: flex; gap: 6px; margin-bottom: 10px; }
.al-busca input { flex: 1; background: #f6ead0 !important; color: #2b1d0e !important; border: 1px solid #c8a764 !important; }
.al-x { width: 40px; border-radius: 6px; border: 1px solid #6a4a2a; background: #3a2414; color: #f2c45a; font-size: 18px; cursor: pointer; }
.al-ok { font-style: normal; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #3c9a2e; color: #fff; font-size: 12px; }
.al-al { display: flex !important; align-items: center; gap: 8px; text-align: left; }
.al-ban { flex: none; width: 30px; height: 40px; display: grid; place-items: center; font: 700 9px Georgia, serif; color: #fff; background: linear-gradient(135deg, #1d4fa0, #c0281e); border: 1px solid #d4a94a; clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%); }
.al-al small { color: #e0a23c !important; }
.al-muro { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 8px; background: linear-gradient(180deg, #f3e3bd, #e2c996); min-height: 220px; }
.al-aviso { display: flex; gap: 8px; padding-bottom: 8px; border-bottom: 2px solid rgba(120,90,40,.4); }
body.tema-oscuro #panel.al-panel .al-aviso b { color: #c0281e !important; font: 600 14px Georgia, serif; } body.tema-oscuro #panel.al-panel .al-aviso p { color: #8a1c10 !important; margin: 2px 0 0; font: 14px Georgia, serif; }
.al-post-c { display: flex; justify-content: space-between; } body.tema-oscuro #panel.al-panel .al-post-c span, body.tema-oscuro #panel.al-panel .al-post-c small { color: #6a5434 !important; font: 13px Georgia, serif; }
.al-post-t { margin-top: 3px; padding: 8px 10px; border-radius: 8px; background: #fff8dc; border: 2px solid #b8862e; font: 14px Georgia, serif; }
body.tema-oscuro #panel.al-panel .al-post-t, body.tema-oscuro #panel.al-panel .al-muro .iv-vacio { color: #2b1d0e !important; }
.al-escribe { display: flex; gap: 8px; margin-top: 8px; padding: 8px; border-radius: 8px; background: linear-gradient(180deg, #8a5a30, #5e3a1c); }
.al-escribe input { flex: 1; padding: 8px; border-radius: 6px; border: 1px solid #2a1a0c; background: #3a2414; color: #f1e2c0; font: 14px Georgia, serif; }

/* ---------------- v6.60: PUNTO DE REUNIÓN ---------------- */
.ru-caja { padding: 6px 2px; }
.ru-tabla { width: 100%; border-collapse: collapse; border: 1px solid #5a3d22; border-radius: 8px; overflow: hidden; font: 14px Georgia, serif; }
.ru-tabla th { background: linear-gradient(180deg, #4a2c16, #2e1a0c); color: #f1e2c0 !important; padding: 8px 6px; font-weight: 600; }
.ru-tabla td { padding: 8px 6px; border-top: 1px solid #120b05; color: #e8d6b0 !important; text-align: center; }
.ru-tabla td:first-child { text-align: left; }
.ru-res { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font: 14px Georgia, serif; color: #e8d6b0 !important; }
.ru-res b, .ru-nota b { color: #f2c45a !important; }
.ru-nota { font: 13px Georgia, serif; color: #cdb88e !important; margin: 4px 0 10px; }
.ru-marcha { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid #120b05; }
.ru-ic { font-size: 26px; flex: none; }
.ru-dat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ru-dat b { color: #f1e6d0 !important; font: 600 14px Georgia, serif; } .ru-dat small { color: #e8842e !important; font: 13px Georgia, serif; }
.ru-t { color: #ff9a5a !important; font: 600 13px Georgia, serif; flex: none; }
#panel:has(.cafe-mas) #panel-gemas { display: none !important; } /* v6.60: las ventanas de edificio ya traen su botón de gemas */

/* ---------------- v6.61: MARCHA EN 5 PASOS ---------------- */
.mc-pasos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin: -2px 0 10px; }
.mc-pasos button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; border-radius: 6px; border: 1px solid #120b05; background: linear-gradient(180deg, #3a2414, #24150a); color: #cdb88e; font: 11px Georgia, serif; cursor: pointer; }
.mc-pasos i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #1a110a; border: 1px solid #6a4a2a; color: #e8d6b0; font: 700 12px Georgia, serif; }
.mc-pasos button.activo { background: linear-gradient(180deg, #c06a2a, #8a4416); color: #fff; } .mc-pasos button.activo i { background: #fff; color: #8a4416; }
.mc-pasos button.hecho i { background: #3c9a2e; color: #fff; border-color: #2a6a20; }
.mc-obj { display: flex; justify-content: center; margin: 6px 0 10px; }
.mc-obj-c { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 18px; border-radius: 10px; background: linear-gradient(180deg, #faf1d6, #e8d6aa); border: 2px solid #c8a764; }
.mc-obj-c b { color: #1f6fb8; font: 700 17px Georgia, serif; } .mc-obj-c span { color: #2b1d0e; font: 14px Georgia, serif; } .mc-obj-c i { font-style: normal; display: inline-block; min-width: 36px; padding: 1px 6px; border-radius: 4px; background: #fff; border: 1px solid #c8a764; } .mc-obj-c small { color: #5a4626; }
.mc-sub { text-align: center; color: #e8d6b0; font: 14px Georgia, serif; margin: 6px 0; }
.mc-tipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mc-tipo { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border-radius: 8px; border: 2px solid #0b1a33; background: linear-gradient(180deg, #2f5d9a 0%, #1b3d6e 55%, #10264a 100%); color: #fff; font-size: 24px; cursor: pointer; }
.mc-tipo b { font: 700 14px Georgia, serif; } .mc-tipo small { font: 11px Georgia, serif; color: #cfe0ff; }
.mc-tipo:disabled { filter: grayscale(.8) brightness(.7); cursor: default; }
.mc-fav-add { width: 100%; margin-bottom: 8px; }
.mc-fav { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid rgba(0,0,0,.3); }
.mc-fav b { flex: 1; color: #f1e6d0; font: 14px Georgia, serif; } .mc-fav small { color: #e8842e; font: 12px Georgia, serif; }
.mc-botin { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 10px; }
.mc-botin div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 8px; background: rgba(0,0,0,.25); border: 1px solid #5a3d22; }
.mc-botin span { font-size: 22px; } .mc-botin b { color: #f2c45a; font: 700 14px Georgia, serif; } .mc-botin small { color: #cdb88e; font: 11px Georgia, serif; }

/* ---------------- v6.62: TIENDA (Paquetes, Gemas, Objetos) ---------------- */
.tg-tabs button { font-size: 15px !important; }
.tg-paq { margin-bottom: 10px; padding: 10px; border-radius: 10px; background: linear-gradient(180deg, #4a2c16, #2a170a); border: 2px solid #d4a94a; box-shadow: 0 0 10px rgba(212,169,74,.25); }
.tg-paq-cab { display: flex; align-items: center; gap: 10px; }
.tg-paq-ico { flex: none; width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center; font-size: 30px; background: radial-gradient(circle at 50% 40%, #ffe9a8, #d08a2a 70%); border: 2px solid #f2c45a; }
.tg-paq-cab div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
body.tema-oscuro #panel.tg-panel .tg-paq-cab b { color: #f6e6c0 !important; font: 700 16px Georgia, serif; }
body.tema-oscuro #panel.tg-panel .tg-paq-cab small { color: #ff9a5a !important; font: 12px Georgia, serif; }
.tg-valor { font-style: normal; flex: none; padding: 3px 8px; border-radius: 12px; background: #c0281e; color: #fff; font: 700 12px Georgia, serif; transform: rotate(4deg); }
.tg-paq-cosas { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tg-paq-cosas > span { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 64px; padding: 6px 4px; border-radius: 8px; background: rgba(0,0,0,.3); border: 1px solid #6a4a2a; font-size: 22px; }
body.tema-oscuro #panel.tg-panel .tg-paq-cosas b { color: #f2c45a !important; font: 700 13px Georgia, serif; } body.tema-oscuro #panel.tg-panel .tg-paq-cosas small { color: #cdb88e !important; font: 10px/1.1 Georgia, serif; text-align: center; max-width: 76px; }
.tg-comprar { width: 100%; }
body.tema-oscuro #panel.tg-panel .tienda-saldo { background: rgba(0,0,0,.3) !important; border: 1px solid #6a4a2a !important; }
body.tema-oscuro #panel.tg-panel .tienda-saldo, body.tema-oscuro #panel.tg-panel .tienda-saldo * { color: #f6e6c0 !important; }
body.tema-oscuro #panel.tg-panel .nota { color: #cdb88e !important; }
body.tema-oscuro #panel.tg-panel .gema-paq { background: linear-gradient(180deg, #3a2716, #24180c) !important; border: 1px solid #6a4a2a !important; }
body.tema-oscuro #panel.tg-panel .gema-paq b, body.tema-oscuro #panel.tg-panel .gema-paq .gp-n { color: #f6e6c0 !important; }
body.tema-oscuro #panel.tg-panel .gema-paq .gp-extra { color: #7fd36a !important; }
body.tema-oscuro #panel.tg-panel .fila-tienda { background: none !important; border: 0 !important; border-bottom: 1px solid #120b05 !important; border-radius: 0 !important; }
body.tema-oscuro #panel.tg-panel .fila-tienda b { color: #f1e6d0 !important; } body.tema-oscuro #panel.tg-panel .fila-tienda .ft-tienes { color: #e8842e !important; } body.tema-oscuro #panel.tg-panel .fila-tienda small { color: #b8a27a !important; }
body.tema-oscuro #panel.tg-panel .ft-ico { background: linear-gradient(180deg, #8fd0f0, #4a96c8) !important; border: 2px solid #d4a94a !important; }
body.tema-oscuro #panel.tg-panel .tienda-tabs button { background: linear-gradient(180deg, #3a2414, #24150a) !important; border: 1px solid #120b05 !important; color: #e8d6b0 !important; }
body.tema-oscuro #panel.tg-panel .tienda-tabs button.activo { background: linear-gradient(180deg, #7a4f2c, #5a3518) !important; color: #fff !important; }
#panel.tg-panel .tienda-top { display: none !important; } /* v6.62: ya están las pestañas de arriba */

/* ---------------- v6.63: BARRAS OSCURAS CON DORADO e ICONOS CON MARCO DE ORO (pedido del dueño) ---------------- */
:root { --bo-1: #3a2614; --bo-2: #1c1209; --bo-oro: #c8a764; --bo-letra: #f3e3bd; }
/* barra de arriba */
body.barra-oro #tk-arriba { background: linear-gradient(180deg, #2a1a0c, #140c05) !important; border-bottom: 2px solid var(--bo-oro) !important; box-shadow: 0 2px 10px rgba(0,0,0,.6) !important; }
body.barra-oro #tk-arriba button { background: linear-gradient(180deg, #b0702a 0%, #7a4416 55%, #4a2608 100%) !important; border: 1px solid #e0b060 !important; box-shadow: inset 0 1px 0 rgba(255,230,160,.45), 0 1px 3px rgba(0,0,0,.6) !important; }
body.barra-oro #tk-arriba #tk-gemas { background: linear-gradient(180deg, #5cc24a, #2e8a22) !important; border-color: #c8e6a0 !important; }
body.barra-oro #tk-arriba .tk-fila2 { background: rgba(0,0,0,.35) !important; border: 1px solid rgba(200,167,100,.45) !important; }
body.barra-oro #tk-arriba, body.barra-oro #tk-arriba * { color: var(--bo-letra) !important; text-shadow: 0 1px 2px #000 !important; }
body.barra-oro #tk-arriba .tk-dat small { color: #ffd98a !important; }
body.barra-oro #tk-arriba .tk-nv, body.barra-oro #tk-arriba .tk-nv * { color: #fff !important; }
/* barra del chat */
body.barra-oro #chat-barra { background: linear-gradient(180deg, rgba(30,20,10,.92), rgba(15,10,5,.92)) !important; border-top: 1px solid rgba(200,167,100,.5) !important; border-bottom: 0 !important; }
body.barra-oro #chat-barra, body.barra-oro #chat-barra * { color: var(--bo-letra) !important; text-shadow: none !important; }
body.barra-oro #chat-barra input { background: #2a1a0c !important; border: 1px solid #6a4a2a !important; color: var(--bo-letra) !important; }
body.barra-oro #chat-barra input::placeholder { color: #a08a60 !important; }
/* barra de abajo: baja y compacta, botones rectangulares café con icono chico de marco dorado y letra crema */
body.barra-oro #abajo { background: linear-gradient(180deg, #2e1d0e, #120a04) !important; border-top: 2px solid var(--bo-oro) !important; box-shadow: 0 -2px 10px rgba(0,0,0,.6) !important; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)) !important; gap: 3px !important; height: auto !important; display: flex !important; align-items: stretch !important; }
body.barra-oro #abajo > button { flex: 1 1 0 !important; min-width: 0 !important; height: auto !important; margin: 0 !important; padding: 4px 2px 3px !important; border-radius: 6px !important; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 2px !important;
  background: linear-gradient(180deg, #5a3a1e, #2e1a0a) !important; border: 1px solid #120a04 !important; box-shadow: inset 0 1px 0 rgba(255,220,150,.25) !important; translate: none !important; transform: none !important; }
body.barra-oro #abajo > button.activo { background: linear-gradient(180deg, #8a5a2a, #4a2c12) !important; border-color: #e0b060 !important; }
body.barra-oro #abajo .bot-io { display: block; width: 38px; height: 38px; }
body.barra-oro #abajo .bot-io svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
body.barra-oro #abajo .bot-img { display: none !important; }
body.barra-oro #abajo > button, body.barra-oro #abajo > button span, body.barra-oro #abajo > button small { color: var(--bo-letra) !important; -webkit-text-fill-color: var(--bo-letra) !important; text-shadow: 0 1px 2px #000 !important; font: 600 11px/1.1 Georgia, "Times New Roman", serif !important; letter-spacing: 0 !important; }
body.barra-oro #abajo > button .icono { display: none !important; }
body.barra-oro #abajo #btn-vista { width: auto !important; height: auto !important; border-radius: 6px !important; background: linear-gradient(180deg, #8a5a2a, #3a2410) !important; border: 1px solid #e0b060 !important; }
body.barra-oro #abajo #btn-vista .bv-ico { font-size: 26px !important; line-height: 1 !important; }
body.barra-oro #abajo #btn-vista::after { top: 1px !important; right: 1px !important; width: 15px !important; height: 15px !important; font-size: 10px !important; }
/* menú grande: iconos con marco dorado */
#menu-grande .mg-ico svg.io { width: 56px; height: 56px; display: block; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
#menu-grande .mg-ico:has(svg.io) { background: none !important; border: 0 !important; box-shadow: none !important; }
@media (max-width: 520px) { body.barra-oro #abajo .bot-io { width: 32px; height: 32px; } body.barra-oro #abajo > button, body.barra-oro #abajo > button span { font-size: 10px !important; } #menu-grande .mg-ico svg.io { width: 50px; height: 50px; } }

/* ---------------- v6.64: DETALLES DE EDIFICIO como las fotos ---------------- */
body.tema-oscuro #panel.cafe .panel-cab { display: flex !important; align-items: center !important; gap: 8px !important; }
body.tema-oscuro #panel.cafe #panel-titulo { flex: 1 1 auto !important; min-width: 0 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; text-align: center !important; font: 700 19px Georgia, "Times New Roman", serif !important; color: #f3e3bd !important; }
body.tema-oscuro #panel.cafe #panel-titulo::before { content: '★ '; color: #f2c45a; }
body.tema-oscuro #panel.cafe .cafe-mas { flex: none !important; }
.ve-max { margin: 12px 0 12px 22%; padding: 14px 12px; border-radius: 8px; background: rgba(0,0,0,.35); border: 1px solid #5a3d22; color: #e8d6b0; font: 14px Georgia, serif; }
.ve-rojos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0 6px; }
.ve-rojo { min-height: 48px; border-radius: 6px; border: 1px solid #2a0806; background: linear-gradient(180deg, #c8402e 0%, #8a1e14 55%, #5a0e08 100%); color: #fff; font: 700 17px Georgia, "Times New Roman", serif; box-shadow: inset 0 1px 0 rgba(255,200,180,.4), 0 2px 5px rgba(0,0,0,.5); cursor: pointer; }
.ve-rojo:active { transform: scale(.97); }
@media (max-width: 520px) { body.tema-oscuro #panel.cafe #panel-titulo { font-size: 16px !important; } }
body.tema-oscuro #panel.cafe .cafe-mas { padding: 4px 8px !important; font-size: 13px !important; min-width: 0 !important; }
body.tema-oscuro #panel.cafe .ve-icono img { width: 34px !important; height: 34px !important; }
@media (max-width: 760px) { body.tema-oscuro #panel.cafe { min-height: calc(100dvh - 190px) !important; } }
@media (max-width: 520px) { body.tema-oscuro #panel.cafe #panel-titulo { white-space: normal !important; font-size: 15px !important; line-height: 1.15 !important; } }

/* ---------------- v6.65: CUARTEL — lista de tropas en filas como la foto ---------------- */
.cq2-sub { justify-content: center; margin: 8px 0 10px !important; } .cq2-sub button { flex: 0 1 46% !important; }
.cq2-lista { display: flex; flex-direction: column; gap: 6px; }
.cq2-fila { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; text-align: left; border-radius: 6px; cursor: pointer; background: linear-gradient(180deg, #3a2716, #24180c); border: 1px solid #120b05; box-shadow: inset 0 1px 0 rgba(255,220,160,.08); }
.cq2-foto { position: relative; flex: none; width: 78px; height: 78px; border-radius: 6px; overflow: hidden; background: linear-gradient(180deg, #6a5a48, #2a2018); border: 2px solid #d4a94a; display: grid; place-items: center; }
.cq2-foto img, .cq2-foto canvas { width: 100%; height: 100%; object-fit: cover; }
.cq2-foto .cq-emoji { font-size: 40px; }
.cq2-est { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 4px; background: rgba(0,0,0,.6); color: #f2c45a; font: normal 11px/1.2 Georgia, serif; text-align: left; }
.cq2-candado { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 28px; background: rgba(0,0,0,.35); }
.cq2-ent { position: absolute; top: 2px; right: 2px; font-style: normal; font: 700 10px Georgia, serif; color: #fff; background: #2f6fc8; border-radius: 6px; padding: 0 4px; }
.cq2-dat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cq2-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
body.tema-oscuro #panel .cq2-top b { color: #f1e6d0 !important; font: 600 15px Georgia, serif; }
body.tema-oscuro #panel .cq2-top small { color: #e8842e !important; font: 600 13px Georgia, serif; flex: none; }
body.tema-oscuro #panel .cq2-frase { color: #cdb88e !important; font: 13px/1.35 Georgia, serif; }
.cq2-flecha { flex: none; font-style: normal; color: #e0a23c; font: 700 34px/1 Georgia, serif; }
.cq2-fila.bloq .cq2-top b { opacity: .8; }

/* ---------------- v6.66: CASTILLO con 5 pestañas ---------------- */
.cs-tabs { display: flex !important; overflow-x: auto; scrollbar-width: none; gap: 3px !important; }
.cs-tabs::-webkit-scrollbar { display: none; }
.cs-tabs button { flex: 1 0 auto !important; padding: 9px 8px !important; font-size: 13px !important; white-space: nowrap; }
.cs-banner { position: relative; display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 12px; border-radius: 8px; background: linear-gradient(180deg, #8fc8f0 0%, #cfe8f4 45%, #6aa84a 46%, #3a7a2a 100%); border: 1px solid #5a3d22; overflow: hidden; }
.cs-banner-img { flex: none; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 2px solid #d4a94a; background: #2a1a0c; display: grid; place-items: center; font-size: 54px; }
.cs-banner-img img, .cs-banner-img canvas { width: 100%; height: 100%; object-fit: cover; }
.cs-banner p { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(20,12,4,.72); color: #f6e6c0; font: 13px/1.4 Georgia, serif; }
.cs-det { margin-top: 6px; }
.cs-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .cs-stats span { padding: 5px 10px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid #5a3d22; color: #e8d6b0; font: 13px Georgia, serif; }
.cs-caja { margin: 8px 0; padding: 12px; border-radius: 8px; background: rgba(0,0,0,.25); border: 1px solid #5a3d22; }
.cs-caja h4 { margin: 0 0 6px; color: #f2c45a; font: 700 16px Georgia, serif; }
.cs-txt { margin: 4px 0 10px; color: #cdb88e; font: 13px/1.4 Georgia, serif; }
.cs-imp { display: flex; align-items: center; gap: 12px; } .cs-imp input { flex: 1; accent-color: #e0a23c; } .cs-imp b { min-width: 48px; text-align: center; color: #fff; font: 700 18px Georgia, serif; background: #2a1a0c; border: 1px solid #d4a94a; border-radius: 6px; padding: 4px; }
.cs-filas { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; } .cs-filas div { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 6px; background: rgba(0,0,0,.25); } .cs-filas span { color: #e8d6b0; font: 14px Georgia, serif; } .cs-filas b { color: #f2c45a; font: 700 14px Georgia, serif; }
.cs-switch { position: relative; width: 120px; height: 44px; border-radius: 22px; border: 2px solid #5a3d22; background: linear-gradient(180deg, #5a2a1a, #3a160e); cursor: pointer; }
.cs-switch span { position: absolute; top: 50%; transform: translateY(-50%); right: 16px; color: #fff; font: 700 16px Georgia, serif; }
.cs-switch i { position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #c8c0b0); transition: left .2s; }
.cs-switch.on { background: linear-gradient(180deg, #4caf3a, #1f5e17); } .cs-switch.on span { right: auto; left: 16px; } .cs-switch.on i { left: 82px; }
.cs-colores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cs-color { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 8px; background: rgba(0,0,0,.3); border: 2px solid #3a2414; cursor: pointer; }
.cs-color.activo { border-color: #f2c45a; box-shadow: 0 0 8px rgba(242,196,90,.5); }
.cs-color i { width: 40px; height: 28px; border-radius: 2px 8px 8px 2px; border: 1px solid #000; clip-path: polygon(0 0, 100% 0, 85% 50%, 100% 100%, 0 100%); }
.cs-color span { color: #e8d6b0; font: 12px Georgia, serif; }

/* ---------------- v6.67: LISTA DE HÉROES (pergamino, parrilla de retratos) ---------------- */
body.tema-oscuro #panel.hl-panel { background: linear-gradient(180deg, #f1e2bf, #dcc596) !important; border: 2px solid #8a6a3a !important; }
body.tema-oscuro #panel.hl-panel .panel-cab { background: linear-gradient(180deg, #3a2a1a, #23180d) !important; border-bottom: 2px solid #c8a764 !important; }
body.tema-oscuro #panel.hl-panel #panel-titulo { color: #f3e3bd !important; text-align: center; flex: 1; font: 700 20px Georgia, serif !important; }
body.tema-oscuro #panel.hl-panel .subtabs button { color: #2b1d0e !important; }
.hl-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.hl-tabs button { padding: 10px 6px; border-radius: 6px; border: 2px solid #2a1a0c; background: linear-gradient(180deg, #2e1d0e, #1a1006); color: #f2c45a; font: 600 15px Georgia, serif; cursor: pointer; }
.hl-tabs button.activo { background: linear-gradient(180deg, #8a5a30, #5e3a1c); color: #fff; }
.hl-txt { padding: 10px 12px; margin-bottom: 10px; border-radius: 6px; border: 1px solid #b8955a; border-top: 6px solid #c8a46a; background: rgba(255,248,225,.55); color: #6a4a24; font: 13px/1.4 Georgia, serif; }
body.tema-oscuro #panel.hl-panel .hl-txt b { color: #2b1d0e !important; }
.hl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 6px; }
.hl-card { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0; border: 0; background: none; cursor: pointer; }
.hl-foto { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; border: 3px solid #c8843a; box-shadow: 0 0 0 1px #6a3a10, 0 3px 6px rgba(0,0,0,.35); background: radial-gradient(circle at 50% 70%, #ffd06a, #e0702a 60%, #8a2a10); display: grid; place-items: center; font-size: 34px; }
.hl-card.legendario .hl-foto { border-color: #f2c45a; } .hl-card.raro .hl-foto { border-color: #c8843a; } .hl-card.comun .hl-foto { border-color: #a8a8a8; background: radial-gradient(circle at 50% 70%, #cfe0f0, #5a8ab0 60%, #1a3a5a); }
.hl-foto img, .hl-foto canvas { width: 100%; height: 100%; object-fit: cover; }
.hl-card.bloq .hl-foto img, .hl-card.bloq .hl-foto canvas { filter: grayscale(.85) brightness(.7); }
.hl-corona { position: absolute; top: 2px; right: 2px; font-style: normal; font-size: 16px; line-height: 1; }
.hl-corona b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 9px/1 Georgia, serif; color: #3a2408; padding-top: 3px; }
.hl-torre { position: absolute; left: 2px; bottom: 2px; font-style: normal; font-size: 14px; display: flex; align-items: center; gap: 1px; background: rgba(0,0,0,.45); border-radius: 4px; padding: 0 3px; }
.hl-torre b { color: #fff; font: 700 11px Georgia, serif; }
.hl-candado { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 26px; background: rgba(0,0,0,.25); }
.hl-sube { position: absolute; top: 2px; left: 2px; font-style: normal; font-size: 12px; color: #fff; background: #3c9a2e; border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; }
body.tema-oscuro #panel.hl-panel .hl-nv { color: #3a2a1a !important; font: 13px Georgia, serif; margin-top: 3px; }
body.tema-oscuro #panel.hl-panel .hl-nom { color: #2b1d0e !important; font: 600 13px/1.1 Georgia, serif; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-arbol { display: flex; flex-direction: column; gap: 12px; }
.hl-rama { border: 1px solid #b8955a; border-radius: 8px; padding: 8px; background: rgba(255,248,225,.45); }
body.tema-oscuro #panel.hl-panel .hl-raiz { text-align: center; color: #fff !important; font: 700 15px Georgia, serif; background: linear-gradient(180deg, #8a5a30, #5e3a1c); border-radius: 6px; padding: 6px; margin: 0 auto 10px; width: 60%; position: relative; }
.hl-hojas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; }
.hl-hoja { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; cursor: pointer; }
.hl-hoja span { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; border: 2px solid #c8843a; background: #e0702a; display: grid; place-items: center; font-size: 28px; }
.hl-hoja span img, .hl-hoja span canvas { width: 100%; height: 100%; object-fit: cover; }
.hl-hoja.bloq span { filter: grayscale(.85); }
body.tema-oscuro #panel.hl-panel .hl-hoja b { color: #2b1d0e !important; font: 600 12px Georgia, serif; } body.tema-oscuro #panel.hl-panel .hl-hoja small { color: #6a4a24 !important; font: 11px Georgia, serif; }
body.tema-oscuro #panel.hl-panel .carta { background: rgba(255,248,225,.6) !important; border: 1px solid #b8955a !important; }
body.tema-oscuro #panel.hl-panel .carta, body.tema-oscuro #panel.hl-panel .carta h3, body.tema-oscuro #panel.hl-panel .carta .nota { color: #2b1d0e !important; }
.hl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.hl-card { min-width: 0; width: 100%; }
.hl-foto { width: 100% !important; height: auto !important; }
.hl-foto > *:not(i) { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: grid; place-items: center; }
.hl-nv, .hl-nom { width: 100%; text-align: center; }

/* ---------------- v6.68: FICHA DEL HÉROE (INFO) y ventana ELEVAR ---------------- */
.hi-cab { display: grid; grid-template-columns: 96px 1fr 92px; gap: 8px; align-items: start; margin: 6px 0 10px; }
.hi-foto { position: relative; width: 96px; height: 120px; border-radius: 6px; overflow: hidden; border: 3px solid #c8843a; background: radial-gradient(circle at 50% 70%, #ffd06a, #e0702a 60%, #8a2a10); display: grid; place-items: center; font-size: 46px; }
.hi-foto.legendario { border-color: #f2c45a; } .hi-foto > *:not(i) { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
.hi-nv { position: absolute; left: -2px; bottom: -2px; font-style: normal; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #3a2a1a, #140c05); border: 2px solid #d4a94a; color: #fff; font: 700 12px Georgia, serif; }
.hi-dat { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
body.tema-oscuro #panel.hi-panel .hi-nom { color: #f6e6c0 !important; font: 600 16px Georgia, serif; padding: 2px 6px; background: linear-gradient(90deg, rgba(120,60,20,.6), transparent); }
.hi-num { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; } body.tema-oscuro #panel.hi-panel .hi-num span { color: #e8d6b0 !important; font: 13px Georgia, serif; }
.hi-pod { display: flex; flex-direction: column; gap: 1px; } body.tema-oscuro #panel.hi-panel .hi-pod span { color: #e8d6b0 !important; font: 13px Georgia, serif; } body.tema-oscuro #panel.hi-panel .hi-pod b { color: #f2c45a !important; }
.hi-barra { position: relative; height: 16px; border-radius: 3px; background: #1a110a; border: 1px solid #8a6a3a; overflow: hidden; }
.hi-barra i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #ffd06a, #e0a23c 60%, #a8701a); }
.hi-barra span { position: relative; display: block; text-align: center; color: #2b1d0e; font: 700 11px/16px Georgia, serif; }
.hi-bts { display: flex; flex-direction: column; gap: 8px; }
.hi-bts button { min-height: 40px; border-radius: 6px; border: 2px solid #0b1a33; background: linear-gradient(180deg, #2f5d9a 0%, #1b3d6e 55%, #10264a 100%); color: #fff; font: 700 14px Georgia, serif; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.hi-bts button.dorado { border-color: #f2c45a; box-shadow: 0 0 6px rgba(242,196,90,.7), inset 0 1px 0 rgba(255,255,255,.3); }
.hi-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.hi-tabs button { padding: 9px 4px; border-radius: 6px; border: 1px solid #120b05; background: linear-gradient(180deg, #3a2414, #24150a); color: #e8d6b0; font: 500 14px Georgia, serif; cursor: pointer; }
.hi-tabs button.activo { background: linear-gradient(180deg, #8a5a30, #5e3a1c); color: #fff; border-color: #a77a4a; }
.hi-hab { margin-bottom: 8px; border: 1px solid #5a3d22; border-radius: 6px; background: rgba(0,0,0,.25); overflow: hidden; }
.hi-hab.apagada { opacity: .6; }
.hi-hab-c { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: linear-gradient(90deg, rgba(120,70,30,.45), rgba(0,0,0,0)); border-bottom: 1px solid #5a3d22; }
body.tema-oscuro #panel.hi-panel .hi-hab-c b { color: #f6e6c0 !important; font: 600 14px Georgia, serif; }
body.tema-oscuro #panel.hi-panel .hi-hab p, body.tema-oscuro #panel.hi-panel .hi-hab small { margin: 8px 10px; display: block; color: #e0cfa8 !important; font: 13px/1.4 Georgia, serif; }
.hi-hab .iv-boton, .hi-hab .hi-barra { margin: 0 10px 10px; }
.hi-sube { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #a8701a; background: radial-gradient(circle at 40% 35%, #fff2b8, #e0a23c 60%, #a8701a); color: #6a3a08; font-weight: 700; cursor: pointer; }
/* Elevar */
#elevar-heroe { position: fixed; inset: 0; z-index: 330; display: grid; place-items: center; padding: 14px; background: rgba(0,0,0,.55); }
.el-caja { position: relative; width: min(420px, 100%); max-height: 92vh; overflow-y: auto; padding: 16px; border-radius: 6px; background: linear-gradient(180deg, #f6ead0, #e3cfa2); border: 3px solid #8a6a3a; box-shadow: 0 10px 30px rgba(0,0,0,.6); font-family: Georgia, "Times New Roman", serif; color: #2b1d0e; }
.el-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 4px; border: 2px solid #f2c45a; background: linear-gradient(180deg, #3a2a1a, #140c05); color: #f2c45a; font-size: 18px; cursor: pointer; }
.el-caja h3 { margin: 4px 40px 10px; text-align: center; font: 700 19px Georgia, serif; padding-bottom: 8px; border-bottom: 2px solid rgba(120,90,40,.45); }
.el-txt { color: #4a3a24; font: 14px/1.45 Georgia, serif; margin: 0 4px 12px; }
.el-sec { border: 2px solid #c8a46a; border-radius: 4px; margin-bottom: 12px; background: rgba(255,250,236,.5); }
.el-cinta { text-align: center; padding: 6px; background: linear-gradient(180deg, #c8945a, #a8743a); color: #fff; font: 600 15px Georgia, serif; }
.el-fila { display: flex; align-items: center; gap: 12px; padding: 10px; border-bottom: 1px solid rgba(120,90,40,.25); margin: 0; }
.el-fila p { margin: 0; color: #4a3a24; font: 14px/1.4 Georgia, serif; }
.el-ico { flex: none; width: 64px; display: flex; flex-direction: column; align-items: center; font-size: 30px; } .el-ico small { font: 12px Georgia, serif; color: #4a3a24; }
.el-req { display: flex; gap: 10px; padding: 10px; border-bottom: 1px solid rgba(120,90,40,.25); }
.el-med { position: relative; flex: none; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; border: 2px solid #d4a94a; background: linear-gradient(180deg, #ffd06a, #e0702a); display: grid; place-items: center; font-size: 30px; }
.el-med > *:not(i):not(b) { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
.el-med i { position: absolute; left: 2px; bottom: 0; font-style: normal; font-size: 18px; }
.el-ok { position: absolute; right: 2px; bottom: 2px; width: 20px; height: 20px; border-radius: 50%; background: #3c9a2e; color: #fff; font: 700 12px/20px sans-serif; text-align: center; }
.el-req small { display: block; color: #4a3a24; font: 13px Georgia, serif; } .el-req em { font-style: normal; color: #4a3a24; font: 14px Georgia, serif; } .el-req em.falta { color: #d0201a; font-weight: 700; } .el-req p { margin: 3px 0 0; color: #3a2a14; font: 14px/1.35 Georgia, serif; }
.el-no { text-align: center; color: #e0201a; font: 600 16px Georgia, serif; margin: 6px 0 2px; }
.el-boton { display: block; width: 100%; min-height: 48px; border-radius: 6px; border: 2px solid #0b1a33; background: linear-gradient(180deg, #2f5d9a, #10264a); color: #fff; font: 700 17px Georgia, serif; cursor: pointer; }
.hi-barra span { color: #fff !important; text-shadow: 0 1px 2px #000; }

/* ---------------- v6.69: ÁRBOL DE TALENTOS ---------------- */
.ta-sub { justify-content: center; margin: 8px 0 !important; } .ta-sub button { flex: 0 1 40% !important; }
.ta-curso { margin: 6px 0; padding: 8px 10px; border-radius: 6px; background: rgba(0,0,0,.35); border: 1px solid #5a3d22; color: #e8d6b0; font: 13px Georgia, serif; } .ta-curso b { color: #f2c45a; }
.ta-arbol { display: flex; flex-direction: column; align-items: stretch; padding: 8px 0; }
.ta-fila { display: grid; gap: 8px; justify-items: center; } .ta-fila.n1 { grid-template-columns: 1fr; } .ta-fila.n3 { grid-template-columns: repeat(3, 1fr); }
.ta-lineas { position: relative; height: 22px; }
.ta-lineas::before { content: ''; position: absolute; left: 50%; top: 0; height: 11px; border-left: 3px solid #b8662a; }
.ta-lineas.n3::after, .ta-lineas.p3::after { content: ''; position: absolute; left: 16.6%; right: 16.6%; top: 11px; border-top: 3px solid #b8662a; }
.ta-lineas.n3.p3::before { left: 16.6%; right: 16.6%; height: 22px; border-left: 3px solid #b8662a; border-right: 3px solid #b8662a; width: auto; }
.ta-nodo { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; cursor: pointer; max-width: 110px; }
.ta-ico { position: relative; width: 64px; height: 64px; border-radius: 6px; display: grid; place-items: center; font-size: 30px; background: linear-gradient(135deg, #e86a2a, #8a2a10); border: 2px solid #d4a94a; box-shadow: 0 3px 6px rgba(0,0,0,.5); }
.ta-nodo.lleno .ta-ico { background: linear-gradient(135deg, #4caf3a, #1f5e17); }
.ta-nodo.sel .ta-ico { box-shadow: 0 0 0 3px #fff2b8, 0 0 12px rgba(255,220,120,.9); }
.ta-lv { position: absolute; left: -4px; right: -4px; bottom: -8px; font-style: normal; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 1px 4px; border-radius: 3px; background: linear-gradient(180deg, #3a2a1a, #140c05); border: 1px solid #d4a94a; color: #fff; font: 700 11px Georgia, serif; }
.ta-lv b { color: #f2c45a; font-size: 9px; }
body.tema-oscuro #panel .ta-nodo small { margin-top: 8px; color: #e8d6b0 !important; font: 12px/1.15 Georgia, serif; text-align: center; padding: 2px 6px; border-radius: 3px; background: rgba(0,0,0,.35); }
.ta-det { margin-top: 10px; padding: 10px; border-radius: 8px; background: rgba(0,0,0,.3); border: 1px solid #d4a94a; }
body.tema-oscuro #panel .ta-det b { color: #f6e6c0 !important; font: 600 15px Georgia, serif; } body.tema-oscuro #panel .ta-det p { color: #e0cfa8 !important; font: 13px Georgia, serif; margin: 6px 0; }
body.tema-oscuro #panel .ta-ayuda { text-align: center; color: #cdb88e !important; font: 13px Georgia, serif; }
.ta-lista { display: block; margin: 10px auto 0; background: none; border: 0; color: #e0a23c; font: 600 14px Georgia, serif; cursor: pointer; }
/* ---------------- v6.69: FORTALEZA ---------------- */
.fo-cab { display: flex; gap: 10px; align-items: center; margin: 8px 0; padding: 10px; border-radius: 6px; background: linear-gradient(180deg, #f1e2bf, #dcc596); border: 2px solid #8a6a3a; }
.fo-libro { flex: none; width: 56px; height: 56px; border-radius: 8px; display: grid; place-items: center; font-size: 32px; background: linear-gradient(180deg, #fff2cc, #e0c080); border: 2px solid #c8a764; }
body.tema-oscuro #panel.fo-panel .fo-cab p { margin: 0; color: #3a2a14 !important; font: 13px/1.35 Georgia, serif; text-align: center; }
.fo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fo-card { display: flex; flex-direction: column; gap: 5px; padding: 6px; border-radius: 6px; background: linear-gradient(180deg, #5a1a14, #3a0e0a); border: 2px solid #2a1408; box-shadow: inset 0 0 0 1px #8a5a2a; }
.fo-foto { position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; border: 2px solid #8a6a3a; background: #2a1a0c; cursor: pointer; padding: 0; display: grid; place-items: center; font-size: 34px; }
.fo-foto > *:not(i):not(span) { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
.fo-i { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; font-style: normal; border-radius: 3px; background: #2f6fc8; color: #fff; font: italic 700 11px/16px Georgia, serif; }
.fo-nom { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px; background: rgba(0,0,0,.65); color: #fff; font: 600 11px Georgia, serif; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fo-nv { display: flex; align-items: center; gap: 3px; } .fo-nv > i { font-style: normal; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #3a2a1a, #140c05); border: 2px solid #d4a94a; color: #fff; font: 700 10px Georgia, serif; } .fo-nv .hi-barra { flex: 1; height: 12px; } .fo-nv > b { flex: none; width: 16px; height: 16px; border-radius: 3px; background: #e0a23c; color: #3a2408; font: 700 12px/16px sans-serif; text-align: center; }
.fo-st, .fo-hab { display: flex; flex-direction: column; gap: 1px; } body.tema-oscuro #panel.fo-panel .fo-st span { color: #f1e6d0 !important; font: 12px Georgia, serif; }
body.tema-oscuro #panel.fo-panel .fo-hab span { color: #f6e6c0 !important; font: 12px Georgia, serif; } body.tema-oscuro #panel.fo-panel .fo-hab span.off { color: #b8955a !important; }
.fo-explorar { margin-top: 4px; min-height: 38px; border-radius: 6px; border: 2px solid #0b1a33; background: linear-gradient(180deg, #2f6fc8 0%, #1b3d6e 55%, #10264a 100%); color: #fff; font: 600 14px Georgia, serif; cursor: pointer; }
.fo-explorar:disabled { filter: grayscale(.7) brightness(.75); }
body.tema-oscuro #panel.fo-panel .fo-veces { text-align: center; color: #e8d6b0 !important; font: 11px Georgia, serif; }

/* ---------------- v6.70: MUNDO LIMPIO ---------------- */
#barra-acciones, #mundo-estado, #mundo-coord, #mundo-leyenda, #mundo-volver, #mundo-lupa { display: none !important; }
#mundo-buscar { display: none !important; }
body.mundo-buscando #mundo-buscar { display: flex !important; }
/* coordenadas: franja fina y fija arriba, de lado a lado, que no se monta sobre las tarjetas */
body #mundo #mundo-xy { position: fixed !important; left: 0 !important; right: 0 !important; top: calc(env(safe-area-inset-top) + 52px) !important; transform: none !important; width: 100% !important; height: 36px !important; border-radius: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important;
  background: linear-gradient(180deg, #2a1a0c, #140c05) !important; border: 0 !important; border-top: 1px solid #6a4a2a !important; border-bottom: 2px solid #c8a764 !important; z-index: 70 !important; padding: 0 10px !important; }
#mundo-xy .mxy-bestia { margin-left: 6px; width: 30px; height: 26px; display: grid; place-items: center; border-radius: 5px; background: linear-gradient(180deg, #8a5a2a, #4a2c12); border: 1px solid #e0b060; font-size: 16px; }
body.mundo-buscando #mundo-xy .mxy-bestia { background: linear-gradient(180deg, #e0a23c, #a86a1a); }
body:has(#mundo:not(.oculto)) #consejo { display: none !important; } /* los consejos de la ciudad no salen en el mundo */
body.barra-oro #abajo #btn-mundo { display: none !important; } /* v6.70: «Mundo» salía dos veces: el botón de la izquierda ya cambia Ciudad / Campos / Mundo */
/* v6.71: sin el letrero «Mapa del mundo» ni la X de arriba (para volver se usa el botón Ciudad / Mundo de abajo) */
#mundo .mundo-cab { display: none !important; }
body #mundo #mundo-xy { top: env(safe-area-inset-top) !important; }
/* v6.73: letras de la barra de abajo claras (la letra gótica no se entendía) */
html body.barra-oro #abajo > button .txt, html body.barra-oro #abajo > button span.txt, html body.barra-oro #abajo > button small { font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif !important; font-weight: 700 !important; font-size: 11px !important; letter-spacing: .1px !important; color: #fff4d6 !important; -webkit-text-fill-color: #fff4d6 !important; text-shadow: 0 1px 2px #000, 0 0 2px #000 !important; }
@media (max-width: 520px) { html body.barra-oro #abajo > button .txt { font-size: 10.5px !important; } }
#aviso-version { display: none !important; }
/* v6.76: transición al Mundo suave (sin pantalla oscura) */
#mundo-transicion { background: radial-gradient(circle, rgba(255,255,255,0) 45%, rgba(20,14,6,.55) 100%) !important; transition: opacity .35s ease !important; }

/* ---------------- v6.85: en el teléfono las ventanas son más bajas y compactas (se ve la ciudad arriba) ---------------- */
@media (max-width: 560px) and (orientation: portrait) {
  html body.tema-oscuro #panel#panel { top: auto !important; bottom: calc(112px + env(safe-area-inset-bottom)) !important; max-height: 60vh !important; min-height: 0 !important; height: auto !important; }
  html body.tema-oscuro #panel#panel.cafe { top: auto !important; left: 0 !important; right: 0 !important; min-height: 0 !important; max-height: 60vh !important; }
  html body.tema-oscuro #panel#panel .panel-cab { padding-top: 6px !important; padding-bottom: 6px !important; min-height: 0 !important; }
  html body.tema-oscuro #panel#panel #panel-titulo { font-size: 17px !important; }
  html body.tema-oscuro #panel#panel #panel-cuerpo { font-size: 14px !important; padding: 8px 10px !important; }
  html body.tema-oscuro #panel#panel #panel-gemas { height: 34px !important; min-width: 78px !important; padding: 2px 6px 2px 8px !important; }
  html body.tema-oscuro #panel#panel #panel-gemas .pg-gema { width: 24px !important; height: 20px !important; }
  html body.tema-oscuro #panel#panel .cafe-mas { padding: 3px 7px !important; font-size: 12px !important; }
  html body.tema-oscuro #panel#panel .iv-modos button, html body.tema-oscuro #panel#panel .hi-tabs button, html body.tema-oscuro #panel#panel .ve-tabs button, html body.tema-oscuro #panel#panel .subtabs button { padding: 7px 4px !important; font-size: 13px !important; min-height: 0 !important; }
  html body.tema-oscuro #panel#panel .iv-fila, html body.tema-oscuro #panel#panel .cq2-fila { padding: 5px 4px !important; gap: 8px !important; }
  html body.tema-oscuro #panel#panel .iv-ico { width: 40px !important; height: 40px !important; font-size: 22px !important; }
  html body.tema-oscuro #panel#panel .cq2-foto { width: 60px !important; height: 60px !important; }
  html body.tema-oscuro #panel#panel .iv-boton { min-height: 34px !important; min-width: 70px !important; font-size: 14px !important; }
  html body.tema-oscuro #panel#panel .al-if, html body.tema-oscuro #panel#panel .al-fila b, html body.tema-oscuro #panel#panel .cs-filas span { font-size: 13px !important; }
  html body.tema-oscuro #panel#panel .al-fila { padding: 7px 4px !important; }
  html body.tema-oscuro #panel#panel .al-3b button { min-height: 40px !important; font-size: 14px !important; }
  html body.tema-oscuro #panel#panel .carta, html body.tema-oscuro #panel#panel .cs-caja { padding: 8px !important; }
  html body.tema-oscuro #panel#panel h3 { font-size: 15px !important; }
  html body.tema-oscuro #panel#panel button.comprar { min-height: 38px !important; font-size: 14px !important; padding-top: 5px !important; padding-bottom: 5px !important; }
}

/* ===== v6.97: tarjeta de aliado (Transportar / Reforzar + chat) y ventanas Escoger tropas / Seleccionar caballero / Transportar ===== */
body #ficha-ciudad .fc-chat { position: absolute; top: 6px; left: 8px; width: 36px; height: 36px; border-radius: 10px; border: 2px solid #b08a4a; background: linear-gradient(#fff3d2, #e6c98c); font-size: 18px; line-height: 1; z-index: 2; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
html body #panel .rf-hoja { display: flex; flex-direction: column; gap: 8px; color: #4a3418; }
html body #panel .rf-para { margin: 0; font-size: 13px; color: #6b4a22; text-align: center; }
html body #panel .rf-lista { display: flex; flex-direction: column; background: linear-gradient(#fbf0d4, #efdcae); border: 2px solid #b08a4a; border-radius: 10px; padding: 4px 10px; }
html body #panel .rf-fila { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(120,80,30,.35); }
html body #panel .rf-fila:last-child { border-bottom: 0; }
html body #panel .rf-fila.vacia { opacity: .55; }
html body #panel .rf-foto { position: relative; flex: none; width: 58px; height: 58px; border: 2px solid #9a6a2a; border-radius: 6px; overflow: hidden; background: #3a2a18; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; }
html body #panel .rf-foto img { width: 100%; height: 100%; object-fit: cover; }
html body #panel .rf-foto.rf-rec { background: linear-gradient(#fff3d2, #e2c486); }
html body #panel .rf-dat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
html body #panel .rf-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
html body #panel .rf-top b, html body #panel .rf-hnom { color: #6b4a22; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body #panel .rf-num { width: 92px; flex: none; text-align: right; font-size: 15px; padding: 4px 8px; border-radius: 4px; border: 1px solid #b08a4a; background: #fff8e2; color: #3a2a14; }
html body #panel .rf-barra { display: flex; align-items: center; gap: 6px; }
html body #panel .rf-barra input[type=range] { flex: 1; min-width: 0; accent-color: #2a6fb3; height: 26px; }
html body #panel .rf-pm { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #5a5048; background: radial-gradient(#9a9088, #4a4038); color: #fff; font-weight: 900; font-size: 16px; line-height: 1; padding: 0; }
html body #panel .rf-max { flex: none; width: 34px; height: 30px; border-radius: 4px; border: 2px solid #2a1c0c; background: linear-gradient(#5a4632, #2a1c0c); color: #ffd23a; font-size: 15px; padding: 0; }
html body #panel .rf-lim { display: flex; justify-content: space-between; font-size: 12px; color: #7a5a30; padding: 0 34px 0 30px; }
html body #panel .rf-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
html body #panel .rf-cap { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: #4a3418; font-weight: 700; }
html body #panel .rf-cap .rojo, html body #panel .rf-cap span.rojo { color: #b3261e; }
html body #panel .rf-sig { min-width: 150px; min-height: 44px !important; font-size: 16px !important; }
/* caballero */
html body #panel .rf-heroe.sel { background: rgba(255,215,120,.35); border-radius: 8px; }
html body #panel .rf-radio { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #9a7a4a; background: #fff8e2; padding: 0; display: flex; align-items: center; justify-content: center; }
html body #panel .rf-heroe.sel .rf-radio i { width: 12px; height: 12px; border-radius: 50%; background: #2a1c0c; display: block; }
html body #panel .rf-foto .rf-i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 3px; background: #2a5fb3; color: #fff; font: 700 12px/16px Georgia, serif; font-style: normal; text-align: center; }
html body #panel .rf-hst { display: flex; gap: 10px; font-size: 13px; color: #4a3418; }
html body #panel .rf-exp { position: relative; height: 16px; border-radius: 8px; background: #3a2a18; border: 1px solid #6b4a22; overflow: hidden; }
html body #panel .rf-exp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ffd86a, #c8901e); }
html body #panel .rf-exp span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 16px; color: #fff; }
html body #panel .rf-masexp { flex: none; min-width: 60px; height: 40px; border-radius: 6px; border: 2px solid #1e5a12; background: linear-gradient(#4cc23a, #1f7a14); color: #fff; font-weight: 800; font-size: 14px; padding: 0 6px; }
html body #panel .rf-pie .rf-cap, html body #panel .rf-para { color: #f3dfae !important; }
html body #panel .rf-pie .rf-cap .rojo { color: #ff7a6a !important; }
html body #panel .rf-hoja input.rf-num { background: #fff8e2 !important; color: #3a2a14 !important; border: 1px solid #b08a4a !important; }
html body #panel .rf-hoja input.rf-num:disabled { background: #e8dcc0 !important; color: #8a7a60 !important; }
html body #panel .rf-top b { text-transform: capitalize; }

/* ===== v6.99: ventana de Recursos de la ciudad (como la foto del dueño) ===== */
html body #panel .rc-hoja { display: flex; flex-direction: column; gap: 10px; }
html body #panel .rc-caja { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 10px 12px; border: 2px solid #6b3f1c; border-radius: 10px; background: rgba(40,20,8,.55); color: #f2c45a; font-size: 13px; }
html body #panel .rc-caja .rc-ancho { grid-column: 1 / -1; }
html body #panel .rc-lista { display: flex; flex-direction: column; }
html body #panel .rc-fila { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(242,196,90,.18); }
html body #panel .rc-fila:last-child { border-bottom: 0; }
html body #panel .rc-foto { flex: none; width: 70px; height: 70px; border-radius: 8px; border: 2px solid #c8a060; background: linear-gradient(#5d84c4, #2f4f86); display: flex; align-items: center; justify-content: center; font-size: 40px; box-shadow: inset 0 0 10px rgba(0,0,0,.35); }
html body #panel .rc-foto img, html body #panel .rc-foto .ico { width: 54px; height: 54px; }
html body #panel .rc-dat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: #e9dcc0; font-size: 13px; }
html body #panel .rc-dat b { color: #f3e6c8; font-size: 16px; text-transform: capitalize; }
html body #panel .rc-dat i { font-style: normal; }
html body #panel .rc-dat i.rojo { color: #ff5a4a; }
html body #panel .rc-mejora { flex: none; min-width: 96px; min-height: 44px !important; font-size: 15px !important; }
html body #panel .rc-caja { box-sizing: border-box; width: 100%; text-align: left !important; background: rgba(40,20,8,.55) !important; border: 2px solid #6b3f1c !important; }
html body #panel .rc-caja span { color: #f2c45a !important; text-align: left !important; font-size: 12.5px; }

/* v7.02: el cartel de Ciudad / Campos / Mundo se va más rápido (y al tocar la pantalla se quita) */
html body #vista-aviso.ver { animation-duration: 1.1s !important; }

/* v7.02: las 6 pestañas de Tropas (Tropas, Héroes, Invocar, Caballeros, Cargos, Fortaleza) en 2 filas de 3 para que no se corten */
@media (max-width: 600px) {
  html body #panel .subtabs:not(.pest-tropa) { display: flex !important; flex-wrap: wrap !important; gap: 4px !important; overflow: visible !important; }
  html body #panel .subtabs:not(.pest-tropa) > button { flex: 1 1 calc(33.333% - 4px) !important; min-width: 0 !important; max-width: none !important; white-space: nowrap !important; overflow: visible !important; text-overflow: clip !important; font-size: 12px !important; padding-left: 2px !important; padding-right: 2px !important; letter-spacing: -0.2px; }
}

/* ===== v7.03: Campaña con premios, defensa e historial ===== */
html body #panel .cp-caja { margin-top: 10px; }
html body #panel .cp-caja h3 { margin: 0 0 8px; }
html body #panel .cp-lista { display: flex; flex-direction: column; gap: 4px; }
html body #panel .cp-premio { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: rgba(255,230,170,.10); border: 1px solid rgba(242,196,90,.25); }
html body #panel .cp-premio.cp-quiza { opacity: .85; border-style: dashed; }
html body #panel .cp-ico { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
html body #panel .cp-ico img { width: 30px; height: 30px; object-fit: contain; }
html body #panel .cp-nom { flex: 1; min-width: 0; font-size: 13px; }
html body #panel .cp-premio b { flex: none; color: #7fe07a; font-size: 14px; }
html body #panel .cp-def { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13px; }
html body #panel .cp-def span:last-child { grid-column: 1 / -1; }
html body #panel .cp-equipo { margin-top: 10px; width: 100%; min-height: 40px !important; }
html body #panel .cp-hist { display: flex; flex-direction: column; gap: 4px; }
html body #panel .cp-h { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; background: rgba(120,200,120,.10); font-size: 13px; }
html body #panel .cp-ok { color: #7fe07a; font-weight: 900; }
html body #panel .cp-h small { margin-left: auto; opacity: .8; }

/* ===== v7.07: Soporte ===== */
html body #panel .sp-caja { display: flex; flex-direction: column; gap: 10px; }
html body #panel .sp-txt { margin: 0; font-size: 13px; }
html body #panel .sp-tipos { display: flex; flex-wrap: wrap; gap: 6px; }
html body #panel .sp-tipos button { flex: 1 1 calc(50% - 6px); min-height: 40px; border-radius: 8px; border: 2px solid #8a6a3a; background: rgba(255,240,200,.08); color: inherit; font-size: 13px; }
html body #panel .sp-tipos button.activo { background: linear-gradient(#f2c45a, #c8901e); color: #2a1a08; border-color: #ffe9a0; font-weight: 800; }
html body #panel #sp-texto, html body #panel .sp-resp-txt { width: 100%; box-sizing: border-box; border-radius: 8px; border: 1px solid #b08a4a; background: #fff8e2; color: #2a1a08; padding: 8px; font-size: 15px; resize: vertical; }
html body #panel .sp-enviar { min-height: 46px !important; font-size: 16px !important; }
html body #panel .sp-lista { display: flex; flex-direction: column; gap: 8px; }
html body #panel .sp-msg { display: flex; flex-direction: column; gap: 6px; }
html body #panel .sp-msg.sp-hecho { opacity: .8; }
html body #panel .sp-cab { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
html body #panel .sp-cab small, html body #panel .sp-equipo { opacity: .75; font-size: 12px; }
html body #panel .sp-cuerpo { margin: 0; white-space: pre-wrap; }
html body #panel .sp-resp { border-left: 4px solid #4cc23a; background: rgba(76,194,58,.12); padding: 6px 8px; border-radius: 6px; }
html body #panel .sp-resp p { margin: 4px 0 0; }
html body #panel .sp-espera { margin: 0; opacity: .8; font-size: 13px; }
html body #panel .sp-bts { display: flex; gap: 8px; }
html body #panel .sp-bts button { flex: 1; min-height: 40px !important; }
html body #panel .sp-tabs { display: flex !important; gap: 6px; margin-bottom: 8px; }
html body #panel .sp-tabs button { flex: 1; min-height: 40px; border-radius: 8px 8px 0 0; border: 2px solid #8a6a3a !important; background: linear-gradient(#4a3420, #2a1c0e) !important; color: #f3dfae !important; font-weight: 700; font-size: 14px; }
html body #panel .sp-tabs button.activo { background: linear-gradient(#f2c45a, #c8901e) !important; color: #2a1a08 !important; border-color: #ffe9a0 !important; }
html body #panel #sp-texto, html body #panel .sp-resp-txt { background: #fff8e2 !important; color: #2a1a08 !important; border: 1px solid #b08a4a !important; }

/* ===== v7.10: tablero de la Ruleta sin repetición ===== */
html body #panel .rul-tablero { margin: 6px 0 4px; padding: 8px; border-radius: 10px; background: rgba(20,10,4,.45); border: 1px solid rgba(242,196,90,.35); color: #f1e2c0; text-align: center; }
html body #panel .rul-tab-cab { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
html body #panel .rul-tab-cab small { font-size: 11.5px; opacity: .85; }
html body #panel .rul-tab-fila { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
html body #panel .rul-tab-p { position: relative; width: 44px; height: 44px; border-radius: 8px; border: 2px solid #8a6a3a; background: rgba(255,240,200,.08); display: flex; align-items: center; justify-content: center; font-size: 24px; }
html body #panel .rul-tab-p img { width: 36px; height: 36px; object-fit: contain; }
html body #panel .rul-tab-p.ya { opacity: .35; filter: grayscale(1); }
html body #panel .rul-tab-p.extra { border-color: #ffe066; box-shadow: 0 0 8px rgba(255,224,102,.6); }
html body #panel .rul-tab-p i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 13px; font-weight: 900; background: #2f8a2a; color: #fff; border-radius: 50%; width: 18px; height: 18px; line-height: 18px; filter: none; }
html body #panel .rul-tab-p.extra i { background: #c8901e; }

/* v7.63: un solo botón rojo (Demoler) */
.ve-rojos.uno { grid-template-columns: 1fr; }
/* v7.63: Mis tropas / Aliados acampados en tarjetas grandes de 2 columnas */
.ru-rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 0 8px; }
.ru-tarjeta { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px 10px; border-radius: 10px; border: 1px solid #8a5f2c; background: linear-gradient(180deg, #4a2e16, #24150a); box-shadow: inset 0 0 0 1px rgba(255,220,150,.12), 0 2px 4px rgba(0,0,0,.4); }
.ru-dibujo { width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #6d4a26, #2a180b 75%); display: flex; align-items: center; justify-content: center; }
.ru-dibujo img { width: 100%; height: 100%; object-fit: contain; }
.ru-emoji { font-size: 56px; }
.ru-nom { color: #f3e2bb !important; font: 700 15px Georgia, serif; text-align: center; line-height: 1.15; }
.ru-cant { color: #ffd76a !important; font: 800 18px Georgia, serif; text-shadow: 0 1px 2px #000; }
.ru-de { color: #c9b089 !important; font-size: 12px; text-align: center; }
.ru-fijo { position: sticky; bottom: -2px; z-index: 3; padding: 10px 0 4px; background: linear-gradient(180deg, rgba(30,18,8,0), #1e1208 35%); }
.ru-marchar { display: block; width: 100%; min-height: 50px; border-radius: 8px; border: 1px solid #0b2a52; background: linear-gradient(180deg, #4f97e6 0%, #2462b8 55%, #163f80 100%); color: #fff; font: 700 19px Georgia, serif; text-shadow: 0 1px 2px #000; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 0 #0b2346; }
.ru-marchar:disabled { filter: grayscale(.8) brightness(.7); }
.emb-vacio { text-align: center; padding: 30px 10px; font-size: 16px; }
/* v7.63: ventana para elegir a dónde marchar */
#rm-caja { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
.rm-ventana { width: min(92vw, 380px); padding: 12px; border-radius: 12px; border: 2px solid #c9902a; background: linear-gradient(180deg, #3e2410, #1e1208); color: #f3e2bb; }
.rm-txt { margin: 8px 2px 12px; font-size: 14px; color: #e8d6b0; }
.rm-xy { display: flex; gap: 10px; margin-bottom: 12px; }
.rm-xy label { flex: 1; display: flex; align-items: center; gap: 6px; font: 700 16px Georgia, serif; color: #ffd76a; }
.rm-xy input { flex: 1; min-width: 0; padding: 8px; border-radius: 6px; border: 1px solid #8a5f2c; background: #120b05; color: #fff; font-size: 17px; }
/* v7.63: Torre del homenaje: blasones, sub-pestañas y canje */
.tr-caja { padding: 4px 0; }
.tr-blasones { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px; border-radius: 10px; border: 1px solid #8a5f2c; background: linear-gradient(180deg, #4a2e16, #24150a); color: #f3e2bb; font: 15px Georgia, serif; }
.tr-blasones b { color: #ffd76a; font-size: 19px; }
.tr-blasones small { flex-basis: 100%; color: #c9b089; font-size: 12px; }
.tr-escudo { font-size: 22px; }
.tr-subs { display: flex; gap: 4px; overflow-x: auto; margin: 10px 0 8px; padding-bottom: 2px; }
.tr-subs button { flex: 0 0 auto; padding: 7px 10px; border-radius: 6px; border: 1px solid #8a5f2c; background: linear-gradient(#5a3a1c, #2e1a0c); color: #e8d6b0; font: 700 13px Georgia, serif; }
.tr-subs button.activo { background: linear-gradient(#b07a34, #6a4418); color: #fff6d8; }
.tr-lista { display: flex; flex-direction: column; gap: 8px; }
.tr-obj { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 1px solid #5a3d22; background: rgba(20,12,5,.65); }
.tr-ico { width: 54px; height: 54px; flex: 0 0 54px; display: flex; align-items: center; justify-content: center; font-size: 34px; border-radius: 8px; background: radial-gradient(circle, #6d4a26, #2a180b); }
.tr-ico img { width: 48px; height: 48px; object-fit: contain; }
.tr-dat { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-dat b { color: #f3e2bb !important; font: 700 14px Georgia, serif; }
.tr-dat small { color: #c9b089 !important; font-size: 12px; }
.tr-costo { color: #ffd76a !important; font-weight: 800; font-size: 14px; }
.tr-aceptar { flex: 0 0 auto; min-width: 78px; }
.rm-ventana .mc-cab { display: flex; align-items: center; gap: 8px; }
.rm-ventana .mc-cab b { font: 700 19px Georgia, serif; color: #ffd76a; }
.rm-ventana .mc-cab small { flex: 1; color: #e8d6b0; }
.rm-ventana .mc-x { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #c9902a; background: #2a180b; color: #f3e2bb; font-size: 16px; }
/* v7.64: sin el botón de chat a la derecha (se encimaba con Misiones); el chat sigue en la barra de abajo */
#btn-chat, #lateral #btn-chat, body #btn-chat { display: none !important; }

/* v8.02: mientras la Ruleta procesa una tirada, sus botones no responden (no se doblan premios) */
html body #panel.rul-ocupada [data-accion="rul-tirar"], html body #panel.rul-ocupada [data-accion="rul-galeon"] { pointer-events: none !important; filter: grayscale(.6) brightness(.8); }

/* ===== v8.07: botón flotante del Torneo y compensación por Correo ===== */
#btn-torneo-flot { position: fixed; z-index: 34; right: 6px; top: calc(env(safe-area-inset-top) + 470px); width: 62px; padding: 4px 2px 5px; border-radius: 14px; border: 2px solid #f2c45a; background: radial-gradient(circle at 50% 30%, #8a4a1a, #3a1c08); color: #ffe9a8; display: flex; flex-direction: column; align-items: center; gap: 1px; box-shadow: 0 4px 10px rgba(0,0,0,.55), 0 0 12px rgba(255,200,90,.45); animation: tfLatido 2.4s ease-in-out infinite; }
#btn-torneo-flot.oculto { display: none !important; }
#btn-torneo-flot .tf-ico { font-size: 26px; line-height: 1; }
#btn-torneo-flot b { font: 800 11px system-ui, sans-serif; }
#btn-torneo-flot small { font: 700 10px system-ui, sans-serif; color: #fff; background: rgba(0,0,0,.45); border-radius: 6px; padding: 0 4px; }
@keyframes tfLatido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
html body #panel .comp-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; margin: 8px 0; }
html body #panel .comp-it { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; background: rgba(255,230,170,.10); border: 1px solid rgba(242,196,90,.35); text-align: center; }
html body #panel .comp-ic { font-size: 30px; line-height: 1; } html body #panel .comp-ic img { width: 40px; height: 40px; object-fit: contain; }
html body #panel .comp-it small { font-size: 11px; line-height: 1.15; } html body #panel .comp-it b { color: #7fe07a; font-size: 13px; }
html body #panel .comp-it .co-borrar { position: absolute; top: 2px; right: 2px; }
html body #panel .comp-vence { margin: 6px 0; font-weight: 700; color: #ffcf6a; text-align: center; }
html body #panel .comp-cobrar, html body #panel .co-leer .comp-cobrar { width: 100%; min-height: 50px; font-size: 18px !important; }
html body #panel .comp-panel h4 { margin: 12px 0 6px; }
html body #panel .comp-panel input, html body #panel .comp-panel textarea, html body #panel .comp-panel select { width: 100%; box-sizing: border-box; border-radius: 8px; border: 1px solid #b08a4a; background: #fff8e2; color: #2a1a08; padding: 7px; font-size: 15px; }
html body #panel .comp-fila { display: flex; gap: 6px; } html body #panel .comp-fila input[type=number] { width: 80px; flex: none; }
html body #panel .comp-rec { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } html body #panel .comp-rec label { display: flex; align-items: center; gap: 6px; font-size: 18px; }

/* ===== v8.08: Castillo › Defensa: tarjetas de héroes en filas de 3 (sin cortes) y el texto sin taparse ===== */
html body #panel .dv-heroes { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; overflow: visible !important; flex-wrap: wrap; }
html body #panel .dv-h { min-width: 0 !important; width: auto !important; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px !important; }
html body #panel .dv-h .dv-f { width: 54px; height: 54px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 30px; }
html body #panel .dv-h .dv-f img { width: 100%; height: 100%; object-fit: cover; }
html body #panel .dv-h b { font-size: 12px; line-height: 1.15; white-space: normal; text-align: center; overflow-wrap: anywhere; }
html body #panel .dv-caja .nota { position: static !important; clear: both; margin-top: 10px !important; line-height: 1.35; }
html body .st-base { opacity: .6; font-weight: 400; } html body .st-mas { font-style: normal; color: #7fe07a; font-weight: 800; }

/* ===== v8.11: Marchar con la lista de todo lo que va en camino ===== */
#dk-lista { max-height: 34vh; overflow-y: auto; padding: 2px 6px 6px; display: flex; flex-direction: column; gap: 4px; }
#dk-lista .dkl-fila { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; background: rgba(0,0,0,.35); border: 1px solid rgba(242,196,90,.25); color: #f3e6c8; font: 600 13px system-ui, sans-serif; }
#dk-lista .dkl-ico { flex: none; font-size: 16px; }
#dk-lista .dkl-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dk-lista .dkl-t { flex: none; color: #ffe08a; }
#dk-lista .dkl-b { flex: none; width: 34px; height: 30px; border-radius: 6px; border: 0; font-size: 15px; color: #fff; }
#dk-lista .dkl-b.acel { background: linear-gradient(#f2b23a, #c47a12); } #dk-lista .dkl-b.ret { background: linear-gradient(#d84a3a, #8a1a10); }

/* v8.18: potenciadores en la ventana de Marcha */
.mc-pot { margin: 6px 0 4px; }
.mc-pot-t { display: block; font: 700 13px system-ui, sans-serif; color: #f2c45a; margin: 0 2px 4px; }
.mc-pot-l { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mc-pot-b { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 10px; border: 1px solid rgba(242,196,90,.35); background: rgba(0,0,0,.35); color: #f3e6c8; font: 600 11px system-ui, sans-serif; line-height: 1.15; min-width: 0; }
.mc-pot-b b { font-weight: 700; font-size: 11px; text-align: center; }
.mc-pot-b small { color: #ffe08a; font-size: 11px; }
.mc-pot-i { font-size: 22px; }
.mc-pot-b.on { border-color: #4fd06a; background: rgba(40,120,50,.35); box-shadow: 0 0 8px rgba(79,208,106,.45); }
.mc-pot-b.sin { opacity: .55; }

/* v8.22: respuesta automática de Soporte */
.sp-resp.sp-auto { border-color: rgba(90,170,255,.45); background: rgba(40,80,140,.25); }
.sp-resp.sp-auto p { margin: 4px 0 0; }

/* v8.23: premio pendiente que marca la IA de Soporte */
.sp-premio { margin-top: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(242,196,90,.6); background: rgba(120,80,10,.35); }
.sp-premio p { margin: 4px 0 6px; }
.sp-premio.listo { opacity: .6; border-color: rgba(79,208,106,.5); background: rgba(40,120,50,.25); }

/* v8.25: las llaves de la Ruleta van aparte, no entre los cofres */
.rp-llaves { margin: 8px 6px 0; text-align: center; color: #ffe08a; font: 700 14px system-ui, sans-serif; }
.rp-llaves .ico-obj { width: 22px; height: 22px; vertical-align: middle; }

/* v8.26: tocar PAUSA sigue el juego */
#aviso-pausa { pointer-events: auto; cursor: pointer; }

/* v8.28: Borrar mi cuenta, pequeño y discreto */
.sp-borrar-cuenta { display: block; margin: 10px auto 0; padding: 4px 10px; border: 1px solid #6a1a12; border-radius: 6px; background: transparent; color: #a8473c; font: 600 12px system-ui, sans-serif; }

/* v8.28: el timón gira sin filtro (en Safari el drop-shadow al girar gastaba mucha memoria y recargaba la página) */
html body #panel.rul-panel .rul-timon { filter: none !important; will-change: transform; }
html body #panel.rul-panel .rul-rueda { will-change: transform; }
html body #panel.rul-panel .rul-marco.timon { border-radius: 50%; box-shadow: 0 6px 14px rgba(0,0,0,.55); }

/* v8.28: una sola pantalla de carga: la de después de entrar usa la misma portada */
#pantalla.como-portada { background: #120a05 url(../iconos/ui/portada.jpg?v=893) center top / cover no-repeat !important; }
#pantalla.como-portada .tarjeta { position: absolute !important; left: 0; right: 0; bottom: 0; top: auto !important; transform: none !important; max-width: none !important; width: 100% !important; margin: 0 !important; padding: 70px 20px calc(env(safe-area-inset-bottom) + 34px) !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: linear-gradient(180deg, transparent 0%, rgba(18,10,5,.75) 45%, #120a05 75%) !important; text-align: center; }
#pantalla.como-portada #pantalla-logo, #pantalla.como-portada #pantalla-titulo, #pantalla.como-portada #pantalla-version { display: none !important; }
#pantalla.como-portada #pantalla-texto { color: #f3dfae !important; font: 600 13px system-ui, sans-serif !important; text-shadow: 0 1px 2px #000; }

/* v8.33: niebla roja cuando te atacan (fina, se ve todo) */
#niebla-ataque { position: fixed; inset: 0; z-index: 8500; pointer-events: none; box-shadow: inset 0 0 45px rgba(220, 38, 38, .55), inset 0 0 90px 10px rgba(220, 38, 38, .25); background: none; /* v8.34: solo en los bordes; el centro queda limpio */ animation: nieblaRoja 1.8s ease-in-out infinite alternate; }
#niebla-ataque span { position: absolute; left: 53%; top: calc(env(safe-area-inset-top) + 84px); transform: translateX(-50%); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; padding: 2px 9px; border-radius: 10px; background: rgba(120, 0, 0, .8); border: 1px solid #ff6a5a; color: #fff; font: 700 11px system-ui, sans-serif; white-space: nowrap; } /* v8.36: más pequeño, debajo de los recursos */
@keyframes nieblaRoja { from { opacity: .7; } to { opacity: 1; } }
.ib-contra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.ib-contra .comprar { margin: 0; }

/* v8.37: Torneo semanal */
.tq-ico { width: 30px; height: 30px; object-fit: contain; vertical-align: middle; flex: none; }
.tq-barra { height: 8px; border-radius: 4px; background: #0006; margin: 8px 0 2px; overflow: hidden; }
.tq-barra i { display: block; height: 100%; background: linear-gradient(90deg, #ffd23a, #f2a51a); }
.tq-pod { border-radius: 12px; padding: 8px; margin: 6px 0; border: 2px solid; }
.tq-pod.tq-oro { border-color: #f2c45a; background: linear-gradient(135deg, rgba(242,196,90,.28), rgba(120,80,10,.25)); }
.tq-pod.tq-plata { border-color: #cfd6e0; background: linear-gradient(135deg, rgba(207,214,224,.22), rgba(60,70,90,.25)); }
.tq-pod.tq-bronce { border-color: #d08a4a; background: linear-gradient(135deg, rgba(208,138,74,.24), rgba(90,50,20,.25)); }
.tq-pos { font: 800 15px system-ui, sans-serif; margin-bottom: 4px; }
.tq-prs { display: flex; flex-wrap: wrap; gap: 6px; }
.tq-pr { display: flex; flex-direction: column; align-items: center; min-width: 64px; max-width: 96px; padding: 4px; border-radius: 9px; background: #0005; text-align: center; }
.tq-pr b { font-size: 12px; color: #ffe08a; } .tq-pr small { font-size: 10px; line-height: 1.15; opacity: .85; }
.tq-pr i { font-style: normal; font-size: 24px; }
.tq-heroes { display: flex; gap: 2px; } .tq-h { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; border: 1px solid #f2c45a; }
.tq-fila { display: flex; align-items: center; gap: 8px; margin: 6px 0; } .tq-fila > b { min-width: 64px; }
.tq-como { gap: 8px; } .tq-como b { flex: 1; }
.rk-tuyo .tq-barra { width: 100%; align-self: stretch; flex: none; min-height: 8px; }

/* v8.38: torneo de gemas */
.tq-pr.tq-gem { background: linear-gradient(135deg, rgba(60,200,120,.35), rgba(10,80,40,.45)); border: 1px solid #5fe08a; }
.tq-pr.tq-gem b { color: #9dffbe; }
.tq-aviso { margin: 8px 0 4px; padding: 7px 9px; border-radius: 9px; background: rgba(20,110,60,.35); border: 1px solid #5fe08a; color: #dfffe9; font: 700 12px system-ui, sans-serif; }

/* v8.39: Temporada con sub-pestañas y premios ilustrados; Cómo ganar puntos desplegable */
.tm-subs { display: flex; gap: 6px; margin: 8px 0 0; }
.tm-subs button { flex: 1; }
.tq-pod.tq-normal { border-color: #6b4a1a; background: rgba(0,0,0,.25); }
.tq-dg img, .tq-dg svg { width: 30px; height: 30px; object-fit: contain; }
.tq-det summary { cursor: pointer; font: 800 15px system-ui, sans-serif; color: #ffe08a; list-style: none; }
.tq-det summary::-webkit-details-marker { display: none; }
.tq-det summary::before { content: '▶ '; font-size: 12px; }
.tq-det[open] summary::before { content: '▼ '; }
.tq-det[open] summary { margin-bottom: 6px; }

/* v8.40: medallas de héroes y héroes lanzados */
.mh-caja { margin-top: 10px; }
.mh-fila { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.mh-fila > img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; border: 1px solid #f2c45a; }
.mh-dat { flex: 1; min-width: 0; } .mh-dat small { opacity: .8; }
.lz-h { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 10px; border: 2px solid #6b4a1a; background: #3a2410; color: #f3e6c8; opacity: .55; }
.lz-h img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; }
.lz-h.on { opacity: 1; border-color: #4fd06a; box-shadow: 0 0 8px rgba(79,208,106,.5); }
.lz-h b { font-size: 11px; } .lz-h small { font-size: 10px; }

/* v8.41: volver a la ventana anterior */
#panel-volver { position: absolute; left: 10px; top: 10px; z-index: 5; padding: 5px 10px; border-radius: 9px; border: 1px solid #c99a3e; background: linear-gradient(#6a4416, #3d2508); color: #ffe08a; font: 800 13px system-ui, sans-serif; cursor: pointer; }
#panel-volver[hidden] { display: none; }
.pj-volver { display: block; width: 100%; margin: 8px 0 0; padding: 8px; border-radius: 10px; border: 1px solid #c99a3e; background: linear-gradient(#6a4416, #3d2508); color: #ffe08a; font: 800 14px system-ui, sans-serif; cursor: pointer; }

/* v8.42: Torneo semanal como evento (cabecera, Ver premios, tabla por páginas y tu fila fija) */
.ev-cab { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; background: linear-gradient(#3a2610, #241505); border: 1px solid #8a6a2a; }
.ev-ico { flex: none; width: 54px; height: 64px; display: grid; place-items: center; font-size: 32px; border-radius: 6px 6px 14px 14px; background: linear-gradient(#1d4f8a, #0d2a50); border: 2px solid #c99a3e; }
.ev-dat { flex: 1; min-width: 0; } .ev-dat b { display: block; font: 800 16px system-ui, sans-serif; color: #ffe08a; } .ev-dat small { display: block; font-size: 12px; opacity: .9; margin: 2px 0 6px; }
.ev-reloj { display: flex; gap: 8px; align-items: center; font-size: 12px; } .ev-reloj b { padding: 3px 10px; border-radius: 10px; background: #0008; color: #fff; font-size: 13px; }
.ev-info { flex: none; width: 26px; height: 26px; border-radius: 6px; border: 1px solid #c99a3e; background: #5a3a12; color: #ffe08a; font: italic 800 15px Georgia, serif; cursor: pointer; }
.ev-ver { display: block; margin: 8px 0 8px auto; padding: 9px 18px; border-radius: 9px; border: 1px solid #7fb2ff; background: linear-gradient(#2d6fc4, #17407a); color: #fff; font: 800 14px system-ui, sans-serif; cursor: pointer; }
.ev-tuyo { padding: 8px; border-radius: 10px; background: rgba(0,0,0,.28); border: 1px solid #6b4a1a; } .ev-tuyo > small { display: block; font-weight: 800; color: #ffe08a; margin-bottom: 4px; }
.ev-nota { text-align: center; margin: 8px 0 4px; }
.ev-tabla { border-radius: 8px; overflow: hidden; border: 1px solid #6b4a1a; }
.ev-th, .ev-tr, .ev-yo { display: grid; grid-template-columns: 62px 1fr 108px; align-items: center; text-align: center; }
.ev-th { background: #2a1a08; color: #ffcf6a; font: 800 12px system-ui, sans-serif; padding: 6px 0; }
.ev-tr { min-height: 38px; font-size: 12px; background: rgba(70,60,40,.55); } .ev-tr.par { background: rgba(110,85,45,.55); }
.ev-tr b, .ev-yo b { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ev-tr small { display: block; font-size: 10px; opacity: .8; }
.ev-tr.yo { outline: 2px solid #ffd23a; outline-offset: -2px; }
.ev-yo { min-height: 32px; background: linear-gradient(#c8241c, #8e1410); color: #fff; font: 800 13px system-ui, sans-serif; border-top: 2px solid #ffcf6a; }
.ev-pie { text-align: right; margin: 3px 2px; font-size: 11px; opacity: .8; }
.ev-pag { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 4px 0 6px; }
.ev-pag button { width: 36px; height: 30px; border-radius: 7px; border: 1px solid #8a6a2a; background: #3a2610; color: #ffe08a; font-size: 13px; cursor: pointer; }
.ev-pag span { min-width: 70px; padding: 5px 8px; border-radius: 7px; background: #f4e7c8; color: #3a2610; font-weight: 800; text-align: center; }
#tq-modal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(0,0,0,.6); padding: 16px; }
.tqm-caja { width: min(420px, 100%); max-height: 86vh; display: flex; flex-direction: column; border-radius: 14px; background: linear-gradient(#3a2610, #1e1205); border: 2px solid #c99a3e; color: #f5e6c8; }
.tqm-cab { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #6b4a1a; } .tqm-cab b { color: #ffe08a; font: 800 16px system-ui, sans-serif; }
.tqm-x { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #c99a3e; background: #5a3a12; color: #fff; cursor: pointer; }
.tqm-cuerpo { overflow-y: auto; padding: 8px 12px 12px; }
/* v8.42: el aviso de «Te atacan» se lee en el tema oscuro */
#opciones-ataque p { color: #ffe9c0 !important; } #opciones-ataque .oa-info { color: #ffd27a !important; opacity: 1 !important; }

/* v8.43: Mis tropas: rejilla de 2 columnas, dibujo a la izquierda, nombre y cantidad a la derecha */
.mt-nota { margin: 6px 0; }
.mt-rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 0 8px; }
.mt-tarjeta { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px; border-radius: 9px; border: 1px solid #6b4a1a; background: linear-gradient(#3a2812, #241606); color: #f5e6c8; text-align: left; cursor: pointer; font: inherit; }
.mt-tarjeta[type="button"] { cursor: default; }
.mt-foto { flex: none; width: 58px; height: 58px; border-radius: 6px; overflow: hidden; border: 2px solid #a87a35; background: #120a03; display: grid; place-items: center; }
.mt-foto img { width: 100%; height: 100%; object-fit: cover; } .mt-foto .ru-emoji { font-size: 30px; }
.mt-dat { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mt-dat b { font: 800 12.5px system-ui, sans-serif; color: #ffe08a; line-height: 1.15; overflow-wrap: anywhere; }
.mt-dat span { font: 700 13px system-ui, sans-serif; color: #fff; }
.pest-tropa { flex-wrap: wrap; }

/* v8.44: Azar: tú eliges el cofre */
.az-cinta-aviso { pointer-events: none; }
.az-celda[data-accion] { cursor: pointer; }
.az-elige { text-align: center; margin: 6px 0 2px; font: 800 13px system-ui, sans-serif; color: #ffe08a; }

/* v8.46: resultado de la batalla al instante */
#aviso-resultado { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 380; min-width: 230px; max-width: calc(100vw - 32px); padding: 8px 16px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.5); animation: avRes .35s ease-out; font-family: system-ui, sans-serif; }
#aviso-resultado.gano { background: linear-gradient(#2f8a3a, #145a1e); border: 2px solid #9dff9a; }
#aviso-resultado.perdio { background: linear-gradient(#b0281e, #6a120c); border: 2px solid #ff9a8a; }
#aviso-resultado b { font-size: 20px; letter-spacing: .5px; } #aviso-resultado small { font-size: 12px; opacity: .95; text-align: center; } #aviso-resultado i { font-size: 10.5px; opacity: .8; }
@keyframes avRes { from { transform: translate(-50%, -20px) scale(.9); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }

/* v8.46: botón X,Y en la búsqueda del Mundo y la cajita de coordenadas visible en el tema oscuro */
#bus-xy { margin-left: 4px; }
#lupa-flota { z-index: 60; }

/* v8.49: rol del set */
.ei-rol { display: block; font-size: 11px; opacity: .85; margin: 2px 0 4px; }

/* v8.50: volumen de la música */
.mus-vol { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* v8.51: aviso de ataque a un aliado */
#alerta-aliado { position: fixed; right: calc(10px + env(safe-area-inset-right)); top: calc(96px + env(safe-area-inset-top)); z-index: 64; max-width: min(260px, 70vw); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 8px; border-radius: 10px; background: linear-gradient(#1d4f8a, #0d2a50); border: 2px solid #7fb2ff; color: #fff; font: 700 12px system-ui, sans-serif; box-shadow: 0 4px 12px rgba(0,0,0,.45); }
#alerta-aliado span { flex: 1 1 140px; } #alerta-aliado .aa-x { background: none; border: 0; color: #fff; font-size: 14px; cursor: pointer; padding: 0 2px; }

/* v8.55: ventana de Marchas (dentro del botón Marchar) */
#mv-pop { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 20px)); max-height: 52vh; z-index: 70; display: flex; flex-direction: column; border-radius: 12px; background: linear-gradient(#3a2610, #1e1205); border: 2px solid #c99a3e; box-shadow: 0 8px 22px rgba(0,0,0,.55); }
#mv-pop .mvp-cab { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid #6b4a1a; }
#mv-pop .mvp-cab b { color: #ffe08a; font: 800 15px system-ui, sans-serif; }
#mv-pop .mvp-x { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #c99a3e; background: #5a3a12; color: #fff; cursor: pointer; }
#mv-pop #dk-lista { overflow-y: auto; padding: 4px 6px 8px; max-height: none; }

/* v8.56: marchas en filas pequeñas debajo de Marchar: barra azul de avance + Acelerar verde (como la referencia) */
#dock-procesos.con-lista .dk-fila { display: none; }
#dk-lista .kc-fila { padding: 0; gap: 0; background: rgba(20,14,6,.82); border: 1px solid #4a3418; border-radius: 0; min-height: 30px; }
#dk-lista .kc-barra { position: relative; flex: 1; min-width: 0; height: 30px; background: rgba(0,0,0,.35); overflow: hidden; }
#dk-lista .kc-barra i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#5aa6ee, #2f6fc0); transition: width 1s linear; }
#dk-lista .kc-barra span { position: relative; display: block; padding: 0 8px; line-height: 30px; font: 700 12.5px system-ui, sans-serif; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
#dk-lista .kc-b { flex: none; width: 84px; height: 30px; border: 0; border-left: 1px solid #1c5a1c; background: linear-gradient(#4cc94c, #1f8a2a); color: #fff; font: 700 12.5px system-ui, sans-serif; cursor: pointer; }
#dk-lista .kc-b.ret { background: linear-gradient(#e0a23c, #9a6214); }
#dk-lista .kc-b.vacio { background: rgba(0,0,0,.3); }
#dk-lista .kc-r { flex: none; width: 30px; height: 30px; border: 0; border-left: 1px solid #5a1a10; background: linear-gradient(#d0463a, #8a1a12); color: #fff; font-size: 14px; cursor: pointer; }
#dk-lista { gap: 2px; padding: 0 0 4px; }
.kc-badge { position: absolute; top: -8px; right: 6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #d42a1e; border: 1px solid #ffb0a0; color: #fff; font: 800 11px/16px system-ui, sans-serif; font-style: normal; text-align: center; }
[data-dk="marchar"] { position: relative; }

/* v8.57: todas las marchas (hasta 10) una encima de otra, sin barra de desplazamiento */
#dk-lista { max-height: none !important; overflow: visible !important; }

/* v8.58: el número rojo va en la esquina del botón Marchar, sin tapar el nombre */
#dock-procesos [data-dk="marchar"] { position: relative !important; overflow: visible !important; }
.kc-badge { top: -9px !important; right: -4px !important; left: auto !important; min-width: 17px; height: 17px; font-size: 10.5px; line-height: 15px; z-index: 2; }

/* v8.64: Enviar Recursos: todo en una línea sin deformarse */
.ev-desl { gap: 4px !important; flex-wrap: nowrap; }
.ev-desl .ev-r { flex: 0 0 62px !important; font-size: 11.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-desl input[type=range] { flex: 1 1 40px !important; min-width: 30px; }
.ev-desl .ev-num { flex: 0 0 56px; width: 56px; height: 28px; padding: 0 4px; border-radius: 6px; border: 1px solid #8a6a2a; background: #120a03; color: #ffe08a; font: 800 12px system-ui, sans-serif; text-align: right; }
.ev-desl .ev-rap { flex: 0 0 32px; width: 32px; height: 28px; padding: 0; border-radius: 6px; border: 1px solid #2f6fc0; background: linear-gradient(#3d7ed0, #1f4f94); color: #fff; font: 800 10.5px system-ui, sans-serif; cursor: pointer; }
.ev-desl .ev-rap:disabled { opacity: .4; }
.ev-desl .ev-max { flex: 0 0 auto !important; padding: 4px 6px !important; font-size: 11px !important; }

/* v8.65: las marcas 10M, 20M, 30M van sobre la misma barra */
.ev-desl .ev-pista { position: relative; flex: 1 1 60px; min-width: 50px; display: flex; align-items: center; padding-top: 12px; }
.ev-desl .ev-pista input[type=range] { flex: 1 1 auto; width: 100%; min-width: 0; margin: 0; }
.ev-desl .ev-marca { position: absolute; top: 0; transform: translateX(-50%); font: 800 9px/1 system-ui, sans-serif; font-style: normal; color: #9fd0ff; pointer-events: none; white-space: nowrap; }
.ev-desl .ev-marca::after { content: ''; position: absolute; left: 50%; top: 11px; width: 1px; height: 8px; background: #9fd0ff; opacity: .8; }

/* v8.66: carretas para el botín en la ventana de Marcha */
.mc-carros { margin: 8px 0 4px; padding: 8px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid #6b4a1a; }
.mc-carros > b { display: block; color: #ffe08a; font-size: 13px; } .mc-carros > small { display: block; font-size: 11px; opacity: .85; margin-bottom: 4px; }
.mc-carro-f { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.mc-carro-f span { flex: 1; min-width: 0; font-size: 12px; } .mc-carro-f span small { display: block; font-size: 10.5px; opacity: .8; }
.mc-carro { width: 72px; height: 28px; border-radius: 6px; border: 1px solid #8a6a2a; background: #120a03; color: #ffe08a; text-align: right; padding: 0 4px; font-weight: 800; }
.mc-carga { margin: 4px 0 0; font-size: 12.5px; }

/* v8.69: en la ventana «Recibiste» las fotos (tropas de Invocar) caben en su casilla y no tapan el botón Recoger */
#recompensas .rc-item { overflow: hidden; position: relative; }
#recompensas .rc-item .rc-ico { width: 60px; height: 60px; overflow: hidden; display: grid; place-items: center; }
#recompensas .rc-item .rc-ico img, #recompensas .rc-item .rc-ico svg, #recompensas .rc-item .rc-ico canvas { max-width: 60px !important; max-height: 60px !important; width: auto !important; height: auto !important; object-fit: contain; position: static !important; }
#recompensas .rc-caja { display: flex; flex-direction: column; max-height: 86vh; max-height: 86dvh; }
#recompensas .rc-lista { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
#recompensas #rc-ok { flex: none; position: relative; z-index: 2; }

/* v8.75: Castillo › Detalles ordenado en el teléfono: una columna, el interruptor al lado del texto y los héroes en 4 columnas */
@media (max-width: 760px) {
  #panel .cs-lista { grid-template-columns: 1fr !important; }
  #panel .cs-lista > * { min-width: 0; }
  #panel .dv-fila { gap: 12px; }
  #panel .dv-fila > div { flex: 1 1 auto; min-width: 0; }
  #panel .dv-fila h4 { font-size: 16px; }
  #panel .dv-fila small { font-size: 12.5px; }
  #panel .dv-fila .cs-switch { flex: 0 0 96px !important; width: 96px; }
  html body #panel .dv-caja .dv-heroes { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
}

/* v8.88: las pestañas de la Torre caben todas (ninguna se esconde a la derecha) */
#panel .tr-subs { display: flex !important; flex-wrap: wrap !important; overflow: visible !important; gap: 6px; }
#panel .tr-subs button { flex: 1 1 28%; }
