/*
 * ==================================================================
 * HOJA DE ESTILOS 5/5 · INTERFAZ NUEVA
 * Barra de la partida, dock de tropas, fichas de tropa, menú principal
 * y selección de nivel. Va la última: sobrescribe lo anterior.
 * ==================================================================
 */

/* ---------- Barra superior de la partida ---------- */

#game .hud {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto auto;
  grid-template-areas: "pb lvl st acts";
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 8px;
  padding: 6px 8px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 3px 4px 0 var(--ink);
}

#game .hud #pb { grid-area: pb; }
#game .hud .lvl { grid-area: lvl; min-width: 0; }
#game .hud .st { grid-area: st; }
#game .hud .acts { grid-area: acts; }

#game .hud button {
  font: 400 1rem var(--h);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  box-shadow: 2px 3px 0 var(--ink);
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: transform .08s;
}

#game .hud button:active:not(:disabled) {
  transform: translate(2px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

#game .hud button em {
  font-style: normal;
}

#game .hud .hb {
  min-width: 40px;
  justify-content: center;
}

#game .hud #pb .ico {
  width: 1.5em;
  height: 1.5em;
}

#game .hud .go {
  background: var(--acc);
}

#game .hud .go:disabled {
  background: #fff;
  opacity: .5;
}

#game .hud .lvl span {
  display: block;
  font: 400 1.05rem var(--h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wbar {
  height: 9px;
  margin-top: 3px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: #eef1f8;
  overflow: hidden;
}

.wbar i {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(-45deg, #ff7a6a 0 6px, #ff9a8c 6px 12px);
  transition: width .4s;
}

#game .hud .st {
  order: 0;
  flex: none;
  display: flex;
  gap: 6px;
  margin: 0;
}

#game .hud .st span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f6f8ff;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 1px 9px 1px 4px;
  font: 400 1rem var(--h);
}

#game .hud .st span b {
  font-weight: 400;
  min-width: 1.4em;
}

#game .hud .st #tl {
  display: none;
}

#game .hud .acts {
  display: flex;
  gap: 6px;
}

#tc.full {
  background: #ffe3df !important;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  50% { transform: scale(1.06); }
}

/* ---------- Dock de tropas ---------- */

#game #bar {
  display: flex;
  gap: 8px;
  padding: 8px;
  margin: 0;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 3px 4px 0 var(--ink);
}

#game #bar button {
  position: relative;
  width: 76px;
  height: auto;
  aspect-ratio: auto;
  margin: 0;
  padding: 4px 4px 22px;
  background: linear-gradient(#fffdf4, #fff6d6);
  border: 2.5px solid var(--ink);
  border-bottom: 7px solid var(--r);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform .12s, box-shadow .12s;
}

#game #bar button canvas {
  width: 56px;
  height: 56px;
  margin: 0;
}

#game #bar button .nm {
  font: 400 .72rem var(--h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.1;
}

#game #bar button i {
  position: absolute;
  top: 2px;
  left: 4px;
  font: .72rem var(--h);
  font-style: normal;
  opacity: .7;
}

#game #bar button small {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  font: .9rem var(--h);
}

#game #bar button small .ico {
  width: 1em;
  height: 1em;
}

#game #bar button:hover:not(:disabled) {
  transform: translateY(-4px);
}

#game #bar button.sl {
  background: linear-gradient(#fff6c7, var(--acc));
  transform: translateY(-6px) rotate(-1.5deg);
  box-shadow: 0 6px 0 #262fb055, 0 0 0 3px #fff, 0 0 0 6px var(--acc);
}

#game #bar button.poor {
  filter: grayscale(.85);
  opacity: .55;
}

#game #bar button.poor small {
  color: #d23b2b;
}

/* ---------- Ficha de tropa ---------- */

#game #sel {
  display: block;
  height: auto;
  min-height: 84px;
  padding: 8px 12px;
  border-radius: 16px;
  visibility: visible;
}

#sel.empty {
  display: grid;
  place-items: center;
}

#sel .hint {
  margin: 0;
  text-align: center;
}

.tph {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 3px solid var(--rc, var(--r, #b0b8b4));
}

.tph canvas {
  flex: none;
  background: radial-gradient(circle at 50% 60%, #fff 0 55%, transparent 56%), var(--rc, #eee);
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.tph div {
  flex: 1;
  min-width: 0;
}

.tph b {
  display: block;
  font: 400 1.15rem var(--h);
  line-height: 1.1;
}

.tph em {
  font-style: normal;
  font-size: .85rem;
  color: var(--mut);
}

.tph .cost {
  font: 400 1.2rem var(--h);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.tps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0;
}

.tps span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f6f8ff;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 0 8px 0 3px;
  font-size: .95rem;
}

.tps b {
  font: 400 .95rem var(--h);
}

#sel p,
#tp p {
  margin: 4px 0;
  font-size: .9rem;
  line-height: 1.2;
}

#tp {
  padding: 10px 12px 12px;
  border-radius: 16px;
  border-top: 7px solid var(--rc);
  box-shadow: 4px 6px 0 var(--ink);
  z-index: 6;
  animation: tpin .14s ease-out;
}

@keyframes tpin {
  from { transform: scale(.92); opacity: 0; }
}

#tp .x {
  position: absolute;
  top: 2px;
  right: 6px;
  border: 0;
  background: none;
  font: 1.6rem/1 var(--f);
  padding: 2px 6px;
}

.pips {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
}

.pips i {
  width: 18px;
  height: 8px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: #fff;
}

.pips i.on {
  background: var(--rc);
}

.pips small {
  margin-left: 4px;
  font-family: var(--h);
}

#tp .b {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

#tp .b button {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font: 400 .95rem var(--h);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 6px 8px;
  box-shadow: 2px 3px 0 var(--ink);
  background: #fff;
}

#tp .b button span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

#tp .b .up {
  background: #c9f2b8;
}

#tp .b .ab {
  background: var(--acc);
}

#tp .b .sl {
  background: #ffe3df;
}

#tp .b button:disabled {
  opacity: .5;
}

/* Ficha como panel inferior (móvil en vertical) */
#tp.sheet {
  position: fixed;
  left: 8px !important;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  top: auto !important;
  width: auto !important;
  max-width: 560px;
  margin: 0 auto;
  z-index: 40;
}

/* ---------- Distribución ---------- */

#game.land {
  grid-template-columns: minmax(0, 1fr) 250px;
}

#game.land #bot {
  padding: 0 0 0 12px;
  gap: 10px;
}

#game.land #bar {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 8px;
}

#game.land #bar button {
  width: 100%;
  flex-direction: row;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-bottom-width: 2.5px;
  border-left: 8px solid var(--r);
  text-align: left;
}

#game.land #bar button canvas {
  width: 48px;
  height: 48px;
}

#game.land #bar button .nm {
  flex: 1;
  font-size: .95rem;
}

#game.land #bar button small {
  position: static;
  font-size: 1rem;
}

#game.land #bar button i {
  left: auto;
  right: 6px;
  top: 2px;
}

#game.land #bar button.sl {
  transform: translateX(-6px);
}

#game.land #sel {
  height: auto;
  flex: 1 1 auto;
  overflow: auto;
}

/* Vertical (móvil): mapa arriba a todo lo ancho, dock deslizable debajo. */
#game:not(.land) #bot {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  overflow: auto;
}

#game:not(.land) #bar {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  justify-content: flex-start;
}

#game:not(.land) #bar::-webkit-scrollbar {
  display: none;
}

#game:not(.land) #bar button {
  flex: 0 0 auto;
}

#game:not(.land) #sel {
  max-width: none;
  flex: 1 1 auto;
}

@media (max-width: 700px) {
  #game .hud {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "pb lvl acts" "st st st";
    padding: 5px 6px;
    gap: 6px;
  }

  #game .hud .st {
    justify-content: space-between;
    gap: 4px;
  }

  #game .hud .st span {
    font-size: .9rem;
    padding: 0 6px 0 2px;
  }

  #game .hud .go em,
  #game .hud #trb em {
    display: none;
  }

  #game .hud button {
    padding: 4px 8px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  #game .hud {
    padding: 3px 6px;
    margin-bottom: 4px;
  }

  #game.land {
    grid-template-columns: minmax(0, 1fr) 200px;
  }

  #game.land #bar button canvas {
    width: 36px;
    height: 36px;
  }

  #game.land #bar {
    gap: 4px;
    padding: 5px;
  }

  #game.land #sel {
    display: none;
  }
}

#game:not(.land) {
  grid-template-rows: auto auto minmax(0, 1fr);
}

#game:not(.land) #stage {
  min-height: 0;
}

/* Móvil apaisado: barra de arriba en una sola fila y tarjetas compactas. */
@media (max-height: 520px) and (orientation: landscape) {
  #game .hud {
    grid-template-columns: auto minmax(60px, 1fr) auto auto;
    grid-template-areas: "pb lvl st acts";
    gap: 6px;
  }

  #game .hud #tm,
  #game .hud .go em,
  #game .hud #trb em {
    display: none;
  }

  #game .hud .st span {
    font-size: .85rem;
    padding: 0 6px 0 2px;
  }

  #game .hud button {
    padding: 3px 8px;
  }

  #game.land #bar button {
    padding: 2px 6px 2px 2px;
  }

  #game.land #bar button .nm {
    font-size: .8rem;
  }
}

/* ---------- Menú principal ---------- */

.home {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.htop {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hchip,
.htop .gm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 400 1.05rem var(--h);
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  padding: 2px 12px 2px 6px;
  box-shadow: 2px 3px 0 var(--ink);
}

.hplay {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 10px;
  text-align: left;
  background: linear-gradient(120deg, #fff6c7, var(--acc));
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 5px 6px 0 var(--ink);
  transition: transform .12s;
}

.hplay:hover {
  transform: translateY(-3px) rotate(-.4deg);
}

.hplay:active {
  transform: translate(4px, 5px);
  box-shadow: 1px 1px 0 var(--ink);
}

.hpm canvas {
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 12px;
  display: block;
}

.hpt b {
  display: block;
  font: 400 clamp(2rem, 6vw, 3rem)/1 var(--h);
  letter-spacing: .04em;
  -webkit-text-stroke: 1.5px var(--ink);
  color: #fff;
  text-shadow: 3px 4px 0 var(--ink);
}

.hpt span {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
}

.hplay .ico.big {
  width: 64px;
  height: 64px;
  animation: nudge 1.2s ease-in-out infinite;
}

@keyframes nudge {
  50% { transform: translateX(5px); }
}

.hgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.htile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 118px;
  padding: 12px 14px;
  text-align: left;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--wr);
  box-shadow: 4px 5px 0 #262fb0cc;
  transition: transform .12s, background .12s;
}

.htile:hover {
  transform: translateY(-3px) rotate(.4deg);
  background: #f2f8ff;
}

.htile:active {
  transform: translate(3px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}

.htile h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 1.35rem;
}

.htile h3 .ico {
  width: 1.4em;
  height: 1.4em;
}

.htile p {
  margin: 0;
}

.htile small {
  color: var(--mut);
  font-size: .9rem;
}

.hteam {
  display: flex;
  gap: 2px;
}

.hteam canvas {
  width: 44px;
  height: 44px;
}

.hgoal {
  margin: 0;
}

.hgoal p {
  margin: 0 0 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

@media (max-width: 560px) {
  .hplay {
    grid-template-columns: 1fr auto;
    padding: 10px;
  }

  .hpm {
    grid-column: 1/3;
  }

  .hplay .ico.big {
    width: 48px;
    height: 48px;
  }

  .htile {
    min-height: 104px;
    padding: 10px;
  }

  .htile h3 {
    font-size: 1.15rem;
  }

  .hteam canvas {
    width: 34px;
    height: 34px;
  }
}

/* ---------- Selección de nivel ---------- */

.zone {
  background: #fff;
  border: 3px solid var(--ink);
  border-top: 10px solid var(--zc);
  border-radius: 20px;
  box-shadow: 4px 5px 0 #262fb0cc;
  padding: 14px;
  margin: 4px 6px 12px;
}

.zh {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.zone .mw {
  position: relative;
}

.zone .mt {
  width: 100%;
  margin: 0;
  border: 3px solid var(--ink);
  border-radius: 14px;
}

.zb {
  position: absolute;
  left: 10px;
  bottom: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.zb b {
  font: 400 clamp(1.3rem, 3.5vw, 2rem) var(--h);
  color: #fff;
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 2px 3px 0 var(--ink);
}

.dtag {
  font: 400 .85rem var(--h);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 0 8px;
}

.zst {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.1rem;
}

.zst b {
  font: 400 1.3rem var(--h);
}

.zen {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}

.zen figure {
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f6f8ff;
  border: 2px dashed #262fb055;
  border-radius: 12px;
  padding: 4px 2px;
}

.zen figcaption {
  font-size: .8rem;
  text-align: center;
  line-height: 1.05;
}

.road {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 0;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 3px dashed #262fb033;
}

.road .lk2 {
  width: 22px;
  height: 0;
  border-top: 3px dashed var(--ink);
  opacity: .5;
}

.nd {
  position: relative;
  width: 96px;
  padding: 8px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 3px 4px 0 var(--ink);
  transition: transform .12s;
}

.nd:hover:not(:disabled) {
  transform: translateY(-4px) rotate(-1deg);
}

.nd b {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font: 400 1.6rem var(--h);
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #eef1f8;
}

.nd.ok b {
  background: color-mix(in srgb, var(--zc) 55%, #fff);
}

.nd.on {
  background: #fff6c7;
}

.nd.on b {
  background: var(--acc);
  animation: pulse 1.4s ease-in-out infinite;
}

.nd .stars .ico {
  width: 1.05em;
  height: 1.05em;
}

.nd em {
  position: absolute;
  top: -10px;
  right: -6px;
  display: flex;
  font-style: normal;
}

.nd em .ico {
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
}

.nd small {
  font-size: .78rem;
  color: var(--mut);
}

.nd:disabled {
  opacity: .5;
  box-shadow: 1px 2px 0 var(--ink);
}

.nd:disabled b .ico {
  width: 26px;
  height: 26px;
}

.zlock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  text-align: center;
}

@media (max-width: 760px) {
  .zh {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .nd {
    width: 84px;
  }

  .road .lk2 {
    width: 10px;
  }
}

.vp {
  min-width: 0;
}

@media (max-width: 760px) {
  .car {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 40px;
  }

  .car .vp {
    order: -1;
    flex: 1 1 100%;
  }

  .car .ar {
    padding: 8px 22px;
  }

  .zone {
    margin: 4px 2px 8px;
    padding: 10px;
  }
}

.dinfo {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 10px;
}

.dinfo span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f6f8ff;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 0 10px 0 4px;
  font-size: .95rem;
}

/* ---------- Panel de partida ---------- */

#dash {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 3px 4px 0 var(--ink);
}

#dash:empty {
  display: none;
}

.dsec h4 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 6px;
  font: 400 1rem var(--h);
}

.dsec p {
  margin: 0;
  font-size: .9rem;
}

.wpv {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wpv figure {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 4px 4px 2px;
  background: #f6f8ff;
  border: 2px solid #262fb055;
  border-radius: 12px;
}

.wpv figure.bs {
  background: #ffe9e6;
  border-color: #ff7a6a;
}

.wpv b {
  position: absolute;
  top: 0;
  right: 4px;
  font: 400 .85rem var(--h);
}

.wpv figcaption {
  font-size: .72rem;
  line-height: 1;
  text-align: center;
  max-width: 64px;
}

.dtw {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dr {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(30px, .9fr) auto auto;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  padding: 3px 6px 3px 3px;
  border: 2px solid transparent;
  border-left: 5px solid var(--r);
  border-radius: 10px;
  background: #fafbff;
  cursor: pointer;
}

.dr:hover {
  background: #f0f4ff;
}

.dr.on {
  border-color: var(--ink);
  background: #fff6c7;
}

.dn {
  min-width: 0;
}

.dn span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--h);
  font-size: .85rem;
}

.dn .pips {
  margin: 1px 0 0;
  gap: 2px;
}

.dn .pips i {
  width: 10px;
  height: 6px;
  border-width: 1.5px;
}

.dn .pips i.on {
  background: var(--r);
}

.dr .bar {
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: #eef1f8;
  overflow: hidden;
}

.dr em {
  display: block;
  height: 100%;
  background: var(--r);
  transition: width .5s;
}

.dr b {
  font: 400 .9rem var(--h);
  min-width: 2.4em;
  text-align: right;
}

.dr button {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font: 400 .85rem var(--h);
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #c9f2b8;
  padding: 2px 6px;
  box-shadow: 1px 2px 0 var(--ink);
}

.dr button .ico {
  width: 1em;
  height: 1em;
}

.dr button:disabled {
  opacity: .45;
  background: #fff;
}

.dsum {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.dsum span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f6f8ff;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 0 9px 0 3px;
  font-size: .9rem;
}

/* La ficha ya no se estira: el panel ocupa el hueco que queda. */
#game:not(.land) #sel,
#game.land #sel {
  flex: 0 0 auto;
  min-height: 0;
}

#game:not(.land) #dash,
#game.land #dash {
  flex: 1 1 auto;
}

#sel.empty {
  min-height: 0;
  padding: 6px 12px;
}

@media (max-height: 520px) and (orientation: landscape) {
  #game.land #dash {
    display: none;
  }
}

/* Columna lateral (PC): filas compactas, sin barra. */
#game.land .dr {
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  gap: 4px;
}

#game.land .dr .bar {
  display: none;
}

#game.land .dr canvas {
  width: 30px !important;
  height: 30px !important;
}

#game.land .wpv figure {
  min-width: 50px;
}

#game.land .dtw h4 small {
  display: none;
}

/* ---------- Perfil ---------- */

.av {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: #fff;
  object-fit: cover;
  flex: none;
}

.av0 {
  background: var(--acc);
  font: 400 1.1rem var(--h);
}

.av.big {
  width: 128px;
  height: 128px;
  border-width: 4px;
  box-shadow: 4px 5px 0 var(--ink);
}

.av0.big {
  font-size: 3.6rem;
}

.hprof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 12px 2px 3px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  box-shadow: 2px 3px 0 var(--ink);
  text-align: left;
}

.hprof span {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.hprof b {
  font: 400 1rem var(--h);
}

.hprof small {
  font-size: .8rem;
  color: var(--mut);
}

.hgear {
  padding: 2px 6px;
}

.pfh {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.pfa {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pfi h2 {
  margin: 0;
  font-size: 2rem;
}

.pfi p {
  margin: 2px 0;
}

.pfl b {
  font: 400 1.3rem var(--h);
}

.nkf {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.nkf input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 6px 10px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
}

.pfr,
.pfi2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pfr span,
.pfi2 span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f6f8ff;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 2px 12px 2px 5px;
}

.pfr b,
.pfi2 b {
  font: 400 1.05rem var(--h);
}

.pfs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pfs .pn {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 6px;
}

.pfs b {
  font: 400 1.5rem var(--h);
}

.pfs small {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--mut);
}

.pft {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pft figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: .85rem;
}

.pfc .bb {
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .pfh {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .pfs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nkf {
    flex-direction: column;
  }
}

/* ---------- Ranking (en construcción) ---------- */

.rkw {
  text-align: center;
}

.rkb .ico.huge {
  width: 110px;
  height: 110px;
  animation: nudge 1.6s ease-in-out infinite;
}

.rkl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.rkl .pn {
  position: relative;
  margin: 0;
  opacity: .75;
}

.rkl h3 {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rkl p {
  margin: 0;
}

.soon {
  position: absolute;
  top: -10px;
  right: -6px;
  font: 400 .8rem var(--h);
  background: var(--acc);
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 0 8px;
  transform: rotate(6deg);
}

/* ---------- Tableta de dibujo ---------- */

.tabo {
  z-index: 120;
  overflow: auto;
  padding: 10px;
}

.tab {
  width: min(96vw, 560px);
  text-align: center;
}

.tab h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tabw {
  position: relative;
  width: min(100%, 420px, 58vh);
  margin: 0 auto 10px;
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 4px 5px 0 var(--ink);
  background: #fff;
}

.tabw canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* Círculo guía: lo que quedará visible en la foto redonda. */
.tabg {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(38, 47, 176, .12);
  outline: 2px dashed #262fb066;
  outline-offset: -2px;
  pointer-events: none;
}

.tcol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.tcol button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--c);
  padding: 0;
}

.tcol button.on {
  transform: scale(1.2);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink);
}

.ttools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.ttools button {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 36px;
  font: 400 .9rem var(--h);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
  box-shadow: 2px 3px 0 var(--ink);
}

.ttools button.on {
  background: var(--acc);
}

.ttools button i {
  display: block;
  border-radius: 50%;
  background: var(--ink);
}

/* ---------- Cuenta online ---------- */

.hlog {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  text-align: left;
  background: linear-gradient(120deg, #eaf4ff, #fff);
  cursor: pointer;
}

.hlog .ico {
  width: 30px;
  height: 30px;
}

.hlog span {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hlog b {
  font: 400 1.1rem var(--h);
}

.hlog small {
  color: var(--mut);
}

.gsl {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
}

.dml {
  display: flex;
  gap: 6px;
}

.dml input {
  font: inherit;
  padding: 4px 8px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
}

.okacc {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.bt.dng {
  background: #ffd0c9;
}

.onl {
  max-width: min(94vw, 460px);
  text-align: center;
}

.svc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.svc button {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}

.svc b {
  font: 400 1.05rem var(--h);
}

.svc small {
  font-size: .85rem;
}

.rkt {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.rkr {
  display: grid;
  grid-template-columns: 54px 36px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-bottom: 2px dashed #262fb022;
  cursor: pointer;
}

.rkr:hover {
  background: #f2f6ff;
}

.rkr.me {
  background: #fff6c7;
  border-radius: 10px;
}

.rkr .ps {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font: 400 1.1rem var(--h);
}

.rkr .av {
  width: 34px;
  height: 34px;
}

.rkr .nk {
  font: 400 1.05rem var(--h);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rkr small {
  color: var(--mut);
}

.rkr .vl {
  font: 400 1rem var(--h);
}

.rkdots {
  text-align: center;
  color: var(--mut);
}

.pubp .av.big {
  margin: 0 auto 6px;
}

/* Vender: segundo toque para confirmar */
#tp .b .sl.cf {
  background: #ff7a6a;
  color: #fff;
  animation: slp .5s ease-in-out infinite alternate;
}

@keyframes slp {
  to {
    transform: scale(1.04);
  }
}

/* ---------- SKINS ---------- */
.inm {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.skn {
  margin: 4px 0 8px;
  font-size: .9rem;
}

.skp {
  overflow-y: auto;
  padding: 16px;
}

.skpp {
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.skv {
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 70%, #fff 0, #eef3ff 70%);
  max-width: 100%;
}

.skt {
  margin: 6px 0 10px;
  font-size: 1.15rem;
}

.skg {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ski {
  position: relative;
  width: 104px;
  padding: 6px 4px 6px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  box-shadow: 2px 3px 0 var(--ink), inset 0 -6px 0 var(--r);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}

.ski canvas {
  display: block;
  margin: 0 auto;
}

.ski small {
  display: block;
  font-size: .9rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ski.on {
  background: #fff6c8;
  transform: translateY(-3px);
}

.ski.nol canvas {
  opacity: .55;
  filter: grayscale(.6);
}

.ski .ske {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #86d672;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 6px;
  font: normal .72rem var(--h, inherit);
  white-space: nowrap;
}

.ski .skl {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
}

/* ---------- TÍTULOS ---------- */
.ttb {
  display: inline-block;
  margin: 2px 0 4px;
  padding: 1px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--c);
  color: #fff;
  font-weight: 700;
  text-shadow: 1px 1px 0 var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.ttb.r5 {
  background: linear-gradient(90deg, #6a4bc9, #c9a0ff, #6a4bc9);
}

.ttg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.ttc {
  position: relative;
  text-align: left;
  padding: 8px 10px;
  border: 2.5px solid var(--ink);
  border-left: 8px solid var(--c);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: 2px 3px 0 var(--ink);
}

.ttc b {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ttc small {
  display: block;
  color: var(--mut, #6a6f9a);
  line-height: 1.15;
}

.ttc.on {
  background: #fff6c8;
}

.ttc > i {
  position: absolute;
  top: -9px;
  right: 8px;
  background: #86d672;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0 6px;
  font-style: normal;
  font-size: .72rem;
}

.ttc.nol {
  opacity: .7;
  cursor: default;
  box-shadow: none;
}

.ttc .pb {
  display: block;
  margin-top: 4px;
}

.ttc em {
  font-style: normal;
  font-size: .8rem;
  color: var(--mut, #6a6f9a);
}

.hprof .htt {
  color: #c47a00;
  font-weight: 700;
}

.pfi .ttbb {
  display: flex;
  margin: 2px 0 4px;
}

/* Límite de unidades (economía y apoyo) */
#game #bar button .lim {
  position: absolute;
  top: 2px;
  right: 3px;
  font: .7rem var(--h);
  font-style: normal;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 0 3px;
}

#game #bar button .lim.full {
  background: #ff7a6a;
  color: #fff;
}

.ttbb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
}

.ttbb .ico {
  width: 18px;
  height: 18px;
}

/* Llaves y cajas de skins */
.kch .ico {
  width: 1.1em;
  height: 1.1em;
}

.skh h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skbs {
  margin-bottom: 14px;
}

.skc {
  margin: 2px 0 8px;
}

.keyw {
  font-size: 1.15rem;
  color: #c47a00;
  animation: slp .5s ease-in-out infinite alternate;
}

.keyw small {
  display: block;
  font-size: .85rem;
  color: var(--mut);
}

.keyw .ico {
  width: 1.3em;
  height: 1.3em;
  vertical-align: middle;
}

/* ---------- RAID ---------- */
.rdi p {
  margin: 0;
}

.rdg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.rdc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 8px solid var(--zc);
}

.rdc .mw {
  position: relative;
}

.rdc .mt {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.rdx {
  display: flex;
  gap: 10px;
  align-items: center;
}

.rdx p {
  margin: 2px 0;
}

.rdp {
  flex: none;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  background: radial-gradient(circle at 50% 60%, #fff 0, #ffe4ea 75%);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
}

.rdd {
  display: flex;
  gap: 6px;
}

.rdd button {
  flex: 1;
  padding: 4px 0;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 1rem var(--h);
  cursor: pointer;
}

.rdd button small {
  display: block;
  font: .75rem var(--f);
}

.rdd button.ok {
  background: #e4f8dc;
}

.rdd button.on {
  background: var(--acc);
  transform: translateY(-2px);
  box-shadow: 2px 3px 0 var(--ink);
}

.rdb {
  margin: 0;
}

.exw {
  font-size: 1.3rem;
  color: #ff3b5c;
  font-weight: 700;
}
