/* ------------------------------------------------------------------ base -- */
/* Morado profundo con acento violeta y el verde reservado para el dinero: es
   la linea de las paginas de cajas. Todo el CSS cuelga de estas variables. */
:root {
  --bg: #0b0a15;
  --bg2: #141225;
  --panel: #1c1a31;
  --panel2: #201d37;
  --line: #2e2b4e;
  --ink: #ece9fb;
  --muted: #9793ba;
  --accent: #5c49d0;
  --accent2: #8471f7;
  --danger: #f82d31;
  --gold: #f9d949;
  --verde: #13d761;
  --rosa: #e34878;
  /* El fondo. Subir los alfas lo hace mas visible; --reja-paso cambia el
     tamano de la casilla. Los tres a 0 lo dejan liso. */
  --reja: rgba(255, 255, 255, .13);
  --reja-fuerte: rgba(140, 120, 255, .24);
  --curvas: rgba(126, 170, 255, .10);
  --reja-paso: 40px;
  --reja-gorda: 200px;
  --radius: 12px;
  --shadow: 0 10px 24px rgba(12, 9, 35, .5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  color: var(--ink);
  font-family: Montserrat, "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* El color base va SOLO en el html.
   Si el body tambien lo lleva, tapa el patron: los pseudoelementos van a
   z-index negativo, y un descendiente con z negativo se pinta ANTES que el
   fondo de su padre. Con el body opaco encima, el fondo no se veia por mucho
   que se le subiera el alfa. */
html { background: var(--bg); }
body { background: transparent; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  /* Tres focos que se solapan: sin ellos el fondo es un negro plano y la
     pagina parece apagada. El morado es el del resto de la interfaz; el azul
     de abajo hace de mar. */
  background:
    radial-gradient(1100px 780px at 12% -8%, #2b2258 0%, transparent 62%),
    radial-gradient(1000px 720px at 96% 104%, #172c52 0%, transparent 58%),
    radial-gradient(900px 620px at 55% 45%, #1a1540 0%, transparent 72%),
    var(--bg);
  z-index: -2;
}

/* El fondo con textura: la cuadricula del mapa y unas curvas de nivel.
   Antes era una reticula al 2%, que en pantalla no se veia y dejaba la pagina
   con pinta de vacia. Las lineas gordas cada cinco casillas y los anillos le
   dan el aire de carta de navegacion, que es de lo que va el juego. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    /* curvas de nivel: dos focos con radios distintos para que no se note el
       patron al cruzarse */
    repeating-radial-gradient(circle at 8% 12%, transparent 0 52px, var(--curvas) 52px 53px),
    repeating-radial-gradient(circle at 92% 88%, transparent 0 67px, var(--curvas) 67px 68px),
    /* la cuadricula de casillas */
    repeating-linear-gradient(0deg,  var(--reja) 0 1px, transparent 1px var(--reja-paso)),
    repeating-linear-gradient(90deg, var(--reja) 0 1px, transparent 1px var(--reja-paso)),
    repeating-linear-gradient(0deg,  var(--reja-fuerte) 0 1px, transparent 1px var(--reja-gorda)),
    repeating-linear-gradient(90deg, var(--reja-fuerte) 0 1px, transparent 1px var(--reja-gorda));
  /* Se atenua hacia los bordes, pero sin llegar a cero: apagarla del todo era
     lo que dejaba las esquinas planas. */
  -webkit-mask-image: radial-gradient(140% 125% at 50% 8%, #000 0%, rgba(0, 0, 0, .8) 55%, rgba(0, 0, 0, .38) 100%);
  mask-image: radial-gradient(140% 125% at 50% 8%, #000 0%, rgba(0, 0, 0, .8) 55%, rgba(0, 0, 0, .38) 100%);
}

.screen { position: fixed; inset: 0; overflow: auto; }
.hidden { display: none !important; }

button, input, select { font: inherit; color: inherit; }

/* ----------------------------------------------------------------- botones -- */
.btn {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 14px 18px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .12s, transform .08s, border-color .12s;
}
.btn:hover { background: var(--panel2); border-color: #4a3f86; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: transparent; }
.btn.primary:hover { background: var(--accent2); }
.btn.big { width: 100%; padding: 20px; font-size: 19px; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.btn.danger { background: #2a1420; border-color: #5b2330; color: #ffb4b8; }
.btn.danger:hover { background: var(--danger); color: #fff; }
.mini {
  background: transparent; border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 8px; font-size: 12px; cursor: pointer; color: var(--muted);
}

/* -------------------------------------------------------------------- menu -- */
.menu-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news {
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(90deg, #0f2437, #0c1c2c);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.news .tag {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: .1em; padding: 4px 8px; border-radius: 5px;
}
.news b { display: block; font-size: 15px; }
.news p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.news .x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }

.idbar {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px;
}
.flag-pick { display: flex; flex-direction: column; gap: 2px; }
.flag-pick .lbl { font-size: 10px; letter-spacing: .14em; color: var(--muted); }
#flag {
  background: transparent; border: 0; border-bottom: 2px solid var(--muted);
  padding: 2px 4px; font-weight: 700; cursor: pointer;
}
#flag option { background: var(--panel); }
#name {
  flex: 1; background: transparent; border: 0; font-size: 22px; font-weight: 700;
  outline: none; min-width: 0;
}
#name::placeholder { color: #46617f; }
.online { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.online .dot { width: 8px; height: 8px; border-radius: 50%; background: #46a758; box-shadow: 0 0 8px #46a758; }

/* tarjetas de partida */
.lobby-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-auto-rows: 186px;
  gap: 12px;
}
.lobby-grid .card:first-child { grid-row: span 2; }

.card {
  position: relative; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #0c1a29;
  transition: transform .12s, border-color .12s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.card .shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,14,24,.15) 40%, rgba(6,14,24,.92) 100%);
}
.card .meta { position: absolute; left: 12px; bottom: 10px; right: 12px; }
.card .meta h3 { margin: 0; font-size: 17px; letter-spacing: .04em; }
.card .meta span { color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 800;
  padding: 4px 9px; border-radius: 6px;
}
.badge.gold { right: auto; left: 10px; background: var(--gold); color: #2a1e00; }
.players-badge {
  position: absolute; right: 10px; bottom: 52px;
  background: rgba(6,14,24,.75); border: 1px solid var(--line);
  font-size: 12px; padding: 3px 8px; border-radius: 6px;
}
.card:first-child .players-badge { bottom: 56px; }

.btn-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hint { color: var(--muted); font-size: 12px; text-align: center; margin: 2px 0 0; }

/* ------------------------------------------------------------------- lobby -- */
#lobby { display: grid; place-items: center; padding: 20px; }
.lobby-panel {
  width: min(900px, 96vw); max-height: 92vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.lobby-panel header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #10263c, #0d1e30);
}
.lobby-panel h2 { margin: 0; font-size: 20px; }
.lobby-panel header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.lb-timer { font-size: 30px; font-weight: 800; color: var(--accent2); font-variant-numeric: tabular-nums; }
.lb-body { display: grid; grid-template-columns: 1fr 300px; gap: 0; min-height: 0; flex: 1; }
.lb-left { padding: 16px 20px; overflow: auto; }
.lb-code { margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.lb-code b { color: var(--gold); letter-spacing: .3em; font-size: 18px; }
.lb-config { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.lb-config label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.lb-config select, .lb-config input {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px;
}
.lb-players { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; display: flex; align-items: center; gap: 6px;
}
.chip .host { color: var(--gold); font-size: 11px; }
.lb-chat { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-log { flex: 1; overflow: auto; padding: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.chat-log .sys { color: var(--muted); font-style: italic; }
.chat-log b { color: var(--accent2); }
.lb-chat input { background: var(--bg2); border: 0; border-top: 1px solid var(--line); padding: 12px; outline: none; }
.lobby-panel footer { display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.lobby-panel footer .btn { flex: 1; }

/* ------------------------------------------------------------------- juego -- */
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }

.hud {
  position: fixed; z-index: 5;
  background: rgba(10, 20, 33, .82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  padding: 10px 12px;
}
.hud-tl { top: 12px; left: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 148px; }
.stat { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.stat .k { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stat.sm b { font-size: 13px; color: var(--muted); }

.hud-tr { top: 12px; right: 12px; min-width: 220px; }
.clock { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 6px; font-size: 13px; }
.board { width: 100%; border-collapse: collapse; font-size: 13px; }
.board td { padding: 2px 4px; }
.board .sw { width: 10px; }
.board .sw i { display: block; width: 10px; height: 10px; border-radius: 2px; }
.board .nm { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .pc { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.board tr.me { background: rgba(62, 155, 255, .16); }
.board.big { font-size: 15px; margin: 14px 0; }

.hud-bottom {
  bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px;
}
.ratio { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.ratio b { color: var(--ink); font-size: 14px; min-width: 42px; }
#ratio { width: 220px; accent-color: var(--accent2); }
.actions { display: flex; gap: 8px; }

.banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 6;
  background: rgba(28, 134, 216, .92); padding: 10px 22px; border-radius: 999px;
  font-weight: 700; box-shadow: var(--shadow); text-align: center;
}

.tooltip {
  position: fixed; z-index: 7; pointer-events: none;
  background: rgba(8, 16, 27, .94); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
.tooltip .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

.game-chat {
  position: fixed; left: 12px; bottom: 92px; z-index: 5;
  display: flex; flex-direction: column; gap: 4px; font-size: 13px; max-width: 320px;
}
.game-chat div { background: rgba(10, 20, 33, .8); padding: 4px 8px; border-radius: 6px; }
#gameChatInput {
  position: fixed; left: 12px; bottom: 62px; z-index: 6; width: 320px;
  background: rgba(10, 20, 33, .95); border: 1px solid var(--accent);
  border-radius: 8px; padding: 8px 10px; outline: none;
}

/* ----------------------------------------------------------------- overlays -- */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgba(4, 9, 16, .78); backdrop-filter: blur(4px);
}
.modal-card, .modal, .end-card {
  width: min(460px, 92vw); background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  box-shadow: var(--shadow);
}
.end-card { width: min(520px, 94vw); text-align: center; }
.modal-card h3, .modal h3, .end-card h2 { margin: 0 0 14px; }
.modal-card label, .modal label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.modal-card select, .modal-card input, .modal select, .modal input {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; outline: none;
}
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions .btn { flex: 1; }

.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 30; max-width: 320px;
  background: rgba(14, 30, 48, .95); border: 1px solid var(--line);
  border-left: 3px solid var(--accent2);
  color: var(--ink); padding: 10px 14px; border-radius: 10px;
  font-weight: 600; font-size: 13px; box-shadow: var(--shadow);
}

/* ------------------------------------------------------------------ movil -- */
@media (max-width: 720px) {
  .lobby-grid { grid-template-columns: 1fr; grid-auto-rows: 150px; }
  .lobby-grid .card:first-child { grid-row: span 1; }
  .btn-row { grid-template-columns: 1fr; }
  .lb-body { grid-template-columns: 1fr; }
  .lb-chat { border-left: 0; border-top: 1px solid var(--line); height: 200px; }
  .hud-bottom { flex-direction: column; gap: 8px; width: calc(100vw - 24px); }
  #ratio { width: 100%; }
  .hud-tr { min-width: 160px; font-size: 12px; }
}

/* ------------------------------------------------------------------ amigos -- */
.pill {
  display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 6px;
  background: var(--bg2); border-radius: 999px; font-size: 11px; color: var(--muted);
}
.pill.alert { background: var(--gold); color: #241a00; font-weight: 800; }

.friends {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(330px, 92vw); z-index: 15;
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -14px 0 40px rgba(0,0,0,.45);
  display: flex; flex-direction: column; padding: 16px; gap: 12px; overflow: auto;
}
.friends header { display: flex; align-items: center; justify-content: space-between; }
.friends h3 { margin: 0; font-size: 18px; }
.friends h4 { margin: 6px 0; font-size: 11px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.friends .x { background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; }
.friends-code {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.friends-code b { color: var(--gold); letter-spacing: .18em; font-size: 16px; margin-left: auto; }
.friends-add { display: flex; gap: 8px; }
.friends-add input {
  flex: 1; min-width: 0; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; outline: none; text-transform: uppercase; letter-spacing: .12em;
}
.friends-list { display: flex; flex-direction: column; gap: 6px; }
.friend {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.friend .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend .st { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.friend.pending { opacity: .6; }
.friend .dot { width: 9px; height: 9px; border-radius: 50%; background: #46617f; flex: none; }
.friend .dot.on { background: #46a758; }
.friend .dot.lobby { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); }
.friend .dot.game { background: var(--gold); }
.friend .dot.off { background: #3a4c60; }
.mini.ok { border-color: var(--accent); color: var(--accent2); }
.friends .empty { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 0; }

.invite-pop {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 260px;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 12px;
  padding: 14px; box-shadow: var(--shadow); font-size: 14px;
}
.invite-pop span { color: var(--muted); font-size: 12px; }
.invite-pop div { display: flex; gap: 8px; margin-top: 10px; }
.invite-pop .btn { flex: 1; }

/* ------------------------------------------------------- HUD y construccion -- */
.bar { height: 6px; background: #10243a; border-radius: 999px; overflow: hidden; margin: 2px 0 4px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent2); transition: width .25s; }
.bar i.full { background: var(--gold); }
.cap { font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.builds { font-size: 12px; color: var(--muted); margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }

.build-bar { display: flex; gap: 6px; }
.build {
  display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; min-width: 74px; color: var(--ink);
}
.build:hover { background: var(--panel2); border-color: var(--accent); }
.build .ic { font-size: 17px; line-height: 1; }
.build .nm { font-size: 11px; white-space: nowrap; }
.build .nm i { color: var(--muted); font-style: normal; font-size: 9px; }
.build .pr { font-size: 11px; color: var(--gold); font-variant-numeric: tabular-nums; }
.build.active { border-color: var(--accent2); background: #2e2748; }
.build.off { opacity: .45; }

@media (max-width: 720px) {
  .build-bar { flex-wrap: wrap; justify-content: center; }
  .build { min-width: 64px; padding: 5px 7px; }
  .friends { width: 100vw; }
}

.build.danger { border-color: #5b2330; }
.build.danger:hover { border-color: var(--danger); background: #2a1420; }
.build.danger.active { border-color: var(--danger); background: #3a1622; }

/* ------------------------------------------------- ataques en curso -- */
.attacks {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none;
}
.atk-row {
  display: flex; align-items: center; gap: 8px; pointer-events: auto;
  background: rgba(10, 20, 33, .9); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px 5px 10px; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.atk-row.mine { border-left: 3px solid var(--accent2); }
.atk-row.incoming { border-left: 3px solid var(--danger); }
.atk-row b { font-weight: 700; }
.atk-row .who { color: var(--muted); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atk-row .x {
  background: none; border: 0; color: var(--danger); font-size: 15px; font-weight: 800;
  cursor: pointer; padding: 0 2px; line-height: 1;
}
.atk-row .x:hover { color: #fff; }

/* --------------------------------------------- menu del boton derecho -- */
.ctxmenu {
  position: fixed; z-index: 12; min-width: 190px;
  background: rgba(12, 24, 39, .97); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; box-shadow: var(--shadow);
}
.ctxmenu .head {
  font-size: 12px; color: var(--muted); padding: 4px 8px 6px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.ctxmenu .head i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.ctxmenu button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--ink); padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.ctxmenu button:hover { background: var(--panel2); }
.ctxmenu button.off { color: #587490; cursor: default; }
.ctxmenu button.off:hover { background: none; }
.ctxmenu button.warn { color: #ffb4b8; }
.ctxmenu button small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }

/* Con tantos edificios la barra necesita dos filas */
.build-bar { flex-wrap: wrap; justify-content: center; max-width: 72vw; }
.build { min-width: 68px; padding: 5px 8px; }
.build .nm { font-size: 10px; }
.build .pr { font-size: 10px; }

/* ------------------------------------------------ barra de construcción -- */
.hud-bottom { align-items: flex-end; gap: 14px; }
.grupos { display: flex; gap: 14px; align-items: flex-end; }
.grupo { display: flex; flex-direction: column; gap: 4px; }
.grupo + .grupo { border-left: 1px solid var(--line); padding-left: 14px; }
.grupo .titulo {
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding-left: 2px;
}
.grupo .fila { display: flex; gap: 5px; }
.build-bar { display: none; }
.build {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 46px; padding: 6px 6px 5px; border-radius: 9px;
  background: rgba(16, 30, 48, .75); border: 1px solid var(--line);
  cursor: pointer; color: var(--ink); transition: background .12s, border-color .12s;
}
.build:hover { background: #1b3b5c; border-color: var(--accent); }
.build .ic { font-size: 18px; line-height: 1; }
.build .pr { font-size: 10px; color: var(--gold); font-variant-numeric: tabular-nums; }
.build.active { border-color: var(--accent2); background: #2e2748; box-shadow: 0 0 0 1px var(--accent2) inset; }
.build.off { opacity: .38; }
.build.danger { border-color: rgba(229, 72, 77, .45); }
.build.danger:hover { border-color: var(--danger); background: #3a1622; }

@media (max-width: 900px) {
  .grupos { flex-wrap: wrap; justify-content: center; max-width: 96vw; }
  .grupo + .grupo { border-left: 0; padding-left: 0; }
}

/* =============================================== menus de fuera de partida */
.topnav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 4px;
  padding: 10px 18px; background: rgba(7, 14, 24, .92);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
}
.topnav .brand {
  display: flex; flex-direction: column; line-height: 1;
  font-weight: 900; letter-spacing: .16em; color: var(--accent);
  margin-right: 18px; font-size: 17px;
}
.topnav .brand span { font-size: 9px; letter-spacing: .2em; color: var(--muted); margin-top: 3px; }
.topnav .nav {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .1em;
  padding: 9px 12px; border-radius: 8px; transition: color .12s, background .12s;
}
.topnav .nav:hover { color: var(--ink); background: rgba(62, 155, 255, .1); }
.topnav .nav.on { color: var(--accent); background: rgba(62, 155, 255, .14); }
.perfil-chip {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(16, 30, 48, .8); cursor: pointer;
}
.perfil-chip:hover { border-color: var(--accent); }
.perfil-chip .emb { font-size: 18px; }
.perfil-chip .quien { display: flex; flex-direction: column; line-height: 1.15; }
.perfil-chip .quien b { font-size: 12px; }
.perfil-chip .quien i { font-size: 10px; color: var(--muted); font-style: normal; }
.perfil-chip .flor { font-size: 12px; color: var(--gold); border-left: 1px solid var(--line); padding-left: 10px; }

#menu .menu-wrap { padding-top: 22px; }
#menu .tab { display: flex; flex-direction: column; gap: 14px; width: 100%; }
#menu .tab.hidden { display: none; }
.panel {
  width: 100%; max-width: min(980px, 94vw); margin: 0 auto; background: rgba(11, 21, 34, .82);
  border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px;
  text-align: left;
}
.panel.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.panel h2 { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; }
.panel .saldo { font-size: 13px; color: var(--gold); }
.panel .saldo b { font-size: 17px; }

.nota { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.nota:first-of-type { border-top: 0; }
.nota .fecha {
  flex: none; font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent2); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 8px; height: fit-content;
}
.nota b { font-size: 13px; }
.nota p { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.55; }

.tienda-tabs,
.store-tabs { display: flex; gap: 6px; margin: 14px 0 12px; flex-wrap: wrap; }
.tienda-tabs button,
.store-tabs button {
  background: rgba(16, 30, 48, .8); border: 1px solid var(--line); color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
}
.tienda-tabs button.on,
.store-tabs button.on { color: var(--ink); border-color: var(--accent); background: #2e2748; }
.tienda-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 10px; }
.art {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 8px 10px; border-radius: 11px; cursor: pointer; color: var(--ink);
  background: rgba(16, 30, 48, .7); border: 1px solid var(--line);
  transition: border-color .12s, background .12s;
}
.art:hover { border-color: var(--accent); background: #16344f; }
.art.on { border-color: var(--accent2); background: #2e2748; }
.art .muestra { height: 40px; display: flex; align-items: center; }
.art .emb { font-size: 34px; line-height: 1; }
.art .swatch { width: 40px; height: 40px; border-radius: 9px; border: 1px solid rgba(255,255,255,.25); display: block; }
.art .tit { font-size: 15px; font-weight: 800; }
.art .nom { font-size: 11px; color: var(--muted); }
.art .precio { font-size: 12px; color: var(--gold); }
.art .tuyo { font-size: 10px; letter-spacing: .1em; color: var(--accent); }
.art .puesto { font-size: 10px; letter-spacing: .1em; color: var(--accent2); }

.tabla { width: 100%; border-collapse: collapse; font-size: 12px; }
.tabla th {
  text-align: right; font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 0 6px 8px; border-bottom: 1px solid var(--line);
}
.tabla th:nth-child(1), .tabla th:nth-child(2) { text-align: left; }
.tabla td { padding: 7px 6px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.05); }
.tabla td.pos { width: 34px; text-align: left; color: var(--muted); }
.tabla td.nom { text-align: left; }
.tabla td.nom i { font-style: normal; font-size: 10px; color: var(--muted); display: block; }
.tabla td.vacio { text-align: center; color: var(--muted); padding: 18px 0; }
.tabla tr.yo td { background: rgba(62, 155, 255, .1); }
.tabla tbody.destacado td { border-top: 1px solid var(--line); }

.lista { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.lista li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.lista li i { font-style: normal; color: var(--muted); }
.lista li .der { color: var(--muted); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.lista li .lider { color: var(--gold); font-size: 10px; }
.lista li.vacio { color: var(--muted); justify-content: center; padding: 16px 0; }
.clan-form { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.clan-form input {
  background: rgba(8, 16, 26, .85); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font: inherit; font-size: 12px; padding: 9px 11px;
}
.clan-form #clanTag, .clan-form #clanUnirTag { width: 92px; text-transform: uppercase; letter-spacing: .12em; }
.clan-form #clanNombre { flex: 1; min-width: 150px; }
.clan-form #clanLemaIn { flex: 1.4; min-width: 170px; }
.lema { margin: 0 0 6px; font-size: 13px; color: var(--ink); font-style: italic; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats .st {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px;
  background: rgba(16, 30, 48, .7); border: 1px solid var(--line); border-radius: 10px;
}
.stats .st span { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stats .st b { font-size: 15px; }
.opt { display: flex; align-items: center; gap: 9px; font-size: 12px; padding: 8px 0; cursor: pointer; }
.opt.sel { justify-content: space-between; }
.opt select {
  background: rgba(8, 16, 26, .85); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font: inherit; font-size: 12px; padding: 6px 9px;
}
.ayuda { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted); line-height: 1.65; }
.ayuda li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.ayuda li b { color: var(--ink); }

/* la barra de la partida se puede encoger o agrandar desde ajustes */
body.hud-sm .build { min-width: 40px; padding: 4px 4px 3px; }
body.hud-sm .build .ic { font-size: 15px; }
body.hud-lg .build { min-width: 56px; padding: 8px 8px 7px; }
body.hud-lg .build .ic { font-size: 22px; }
body.hud-lg .build .pr { font-size: 11px; }

@media (max-width: 900px) {
  .topnav { flex-wrap: wrap; padding: 8px 10px; }
  .topnav .nav { padding: 7px 8px; font-size: 11px; }
  .perfil-chip { order: -1; margin-left: auto; }
  .panel.dos { grid-template-columns: 1fr; }
}

/* El boton de disparar tiene que cantar: es la unica arma del juego */
.build.muni { border-color: rgba(229, 72, 77, .45); background: rgba(48, 20, 30, .7); }
.build.muni .pr { color: #ffb3a0; font-weight: 700; }
.build.muni:hover { border-color: var(--danger); background: #4a1a26; }
.build.muni.active { border-color: #ff6b6b; background: #58202e; box-shadow: 0 0 0 1px #ff6b6b inset; }
/* sin mortero puesto, o sin oro, la municion se ve apagada */
.build.muni.no { opacity: .42; filter: grayscale(.6); }

.build.disparar { border-color: rgba(229, 72, 77, .55); background: rgba(58, 22, 34, .75); }
.build.disparar .pr { color: #ff9aa0; letter-spacing: .06em; font-weight: 700; }
.build.disparar:hover { border-color: var(--danger); background: #4a1a26; }
.build.disparar.active { border-color: #ff6b6b; background: #58202e; box-shadow: 0 0 0 1px #ff6b6b inset; }

/* --------------------------------------------------- panel del administrador */
.topnav .nav.solo-admin { color: var(--gold); }
.topnav .nav.solo-admin.on { background: rgba(216, 165, 49, .16); }
.topnav .nav.hidden { display: none; }
.adm-rapido { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 12px; }
.adm-rapido input {
  width: 110px; background: rgba(8, 16, 26, .85); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font: inherit; font-size: 12px; padding: 7px 10px;
}
.adm-fila .quien { display: flex; align-items: center; gap: 8px; }
.adm-fila .codigo { font-family: ui-monospace, monospace; color: var(--accent); letter-spacing: .08em; }
.adm-fila .saldo { color: var(--gold); font-variant-numeric: tabular-nums; }
.badge {
  font-size: 9px; letter-spacing: .1em; padding: 2px 6px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.badge.vip { color: #ffd166; border-color: rgba(255, 209, 102, .5); }
.badge.admin { color: #ff9aa0; border-color: rgba(255, 154, 160, .5); }
.perfil-chip .badge { margin-left: 2px; }

/* la muestra de los dibujos de territorio se ve mejor con los pixeles duros */
.art img.swatch { image-rendering: pixelated; width: 40px; height: 40px; }

/* ------------------------------------------------------- lotes de florines */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.pack {
  position: relative; overflow: hidden; cursor: pointer; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px 14px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(24, 42, 66, .9), rgba(12, 22, 36, .9));
  border: 1px solid var(--line); transition: border-color .12s, transform .12s;
}
.pack:hover { border-color: var(--gold); transform: translateY(-2px); }
.pack .titulo-pack {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.pack .moneda { font-size: 30px; line-height: 1; }
.pack .cantidad { font-size: 20px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.pack .unidad { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pack .precio-real {
  margin-top: 4px; padding: 6px 16px; border-radius: 8px;
  background: rgba(63, 166, 106, .18); border: 1px solid rgba(63, 166, 106, .45);
  color: #6ee7a0; font-size: 13px; font-weight: 700;
}
.pack .cinta {
  position: absolute; top: 12px; right: -30px; transform: rotate(38deg);
  background: #14ab7e; color: #04140b; font-size: 9px; font-weight: 800;
  letter-spacing: .08em; padding: 3px 34px;
}
.pago-codigo {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin: 12px 0 4px; font-size: 12px; color: var(--muted);
}
.pago-codigo b { font-family: ui-monospace, monospace; font-size: 18px; letter-spacing: .2em; color: var(--accent); }
#pagoEnlace.hidden { display: none; }

/* ------------------------------------------- barra de abajo, todo parejo -- */
.grupos { align-items: stretch; }
.grupo { justify-content: flex-end; }
.grupo .fila { align-items: stretch; }
.build {
  width: 58px; min-width: 58px; justify-content: center;
  padding: 7px 4px 6px; gap: 4px;
}
.build .ic {
  font-size: 19px; line-height: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
}
.build .pr {
  font-size: 10px; line-height: 12px; height: 12px; font-weight: 600;
  color: var(--gold); font-variant-numeric: tabular-nums;
  letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: clip;
  max-width: 100%; text-align: center;
}
/* las etiquetas de texto (DISPARAR) caben mas justas que un numero */
.build.disparar .pr { font-size: 8px; letter-spacing: .04em; }

.tabla.guia td { vertical-align: top; text-align: left; line-height: 1.55; color: var(--muted); }
.tabla.guia td.nom { white-space: nowrap; color: var(--ink); padding-right: 14px; }
.tabla.guia th:nth-child(2) { text-align: left; }
.tabla.guia td b { color: var(--ink); }

/* ------------------------------------------------- enlace de la partida -- */
.sala {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 10px; padding: 6px 12px;
  background: rgba(7, 14, 24, .88); border: 1px solid var(--line); border-radius: 999px;
  font-size: 11px; color: var(--muted);
}
.sala.hidden { display: none; }
.sala .et { letter-spacing: .1em; text-transform: uppercase; font-size: 9px; }
.sala b { font-family: ui-monospace, monospace; color: var(--accent); }
/* mirando desde la barrera: nada de construir */
body.espectador .hud-bottom .grupos, body.espectador .hud-bottom .ratio { display: none; }
body.espectador .sala::after {
  content: "ESPECTADOR"; color: var(--gold); letter-spacing: .12em; font-size: 9px;
  border-left: 1px solid var(--line); padding-left: 10px;
}

/* --------------------------------------------------- secciones del admin -- */
.adm-tabs button { padding: 6px 11px; font-size: 10px; }
.adm-sec.hidden { display: none; }
.partida-fila .datos { display: flex; flex-direction: column; gap: 3px; }
.partida-fila .quienes { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; }
.partida-fila .jug {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px;
}
.partida-fila .jug i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.partida-fila .jug button { margin-left: 4px; }
.partida-fila .id { font-family: ui-monospace, monospace; color: var(--muted); font-size: 10px; }

/* ------------------------------------------------------- editor de dibujos */
.editor { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.lienzo-caja { background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
#edLienzo,
#propiaLienzo {
  width: 256px; height: 256px; image-rendering: pixelated; display: block;
  background: #fff; cursor: crosshair;
}
.editor-cont { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }
.paleta { display: flex; flex-wrap: wrap; gap: 6px; }
.paleta button {
  width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent;
  cursor: pointer; padding: 0;
}
.paleta button.on { border-color: #fff; }
.editor-botones { display: flex; gap: 8px; }
.muestra-mini { width: 34px; height: 34px; border-radius: 7px; image-rendering: pixelated; }

/* ================================================== marcadores en partida == */
.recursos {
  position: fixed; top: 52px; left: 50%; transform: translateX(-50%); z-index: 5;
  display: flex; gap: 10px; pointer-events: none;
}
.rec {
  display: flex; align-items: center; gap: 9px; padding: 8px 16px 8px 12px;
  background: rgba(7, 14, 24, .9); border: 1px solid var(--line);
  border-radius: 12px; backdrop-filter: blur(4px);
}
.rec .ic { font-size: 20px; line-height: 1; }
.rec .cifra { display: flex; align-items: baseline; gap: 5px; }
.rec .cifra b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rec .cifra i { font-style: normal; font-size: 11px; color: var(--muted); }
.rec .tasa {
  font-size: 11px; font-weight: 700; color: #6ee7a0;
  border-left: 1px solid var(--line); padding-left: 9px;
}
.rec.comida .cifra b { color: #e8c15a; }
.rec.oro .cifra b { color: var(--gold); }

.tropas { display: flex; align-items: center; gap: 12px; }
.tropas .ritmo {
  font-size: 15px; font-weight: 800; color: #6ee7a0; min-width: 74px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.tbar {
  position: relative; width: 260px; height: 34px; border-radius: 10px;
  background: rgba(8, 16, 26, .9); border: 1px solid var(--line); overflow: hidden;
}
.tbar i {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, #1f6fc4, #3e9bff); transition: width .2s;
}
.tbar .cifras {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 6px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
.tbar .cifras b { font-size: 17px; font-weight: 800; }
.tbar .cifras em { font-style: normal; font-size: 11px; color: #cfe0f2; }
.envio { display: flex; align-items: center; gap: 8px; }
.envio input { width: 130px; }
.envio b { font-size: 13px; min-width: 40px; }
.hud-bottom .ratio { display: none; }
body.espectador .tropas { display: none; }

@media (max-width: 900px) {
  .recursos { top: 46px; }
  .rec .cifra b { font-size: 17px; }
  .tbar { width: 170px; }
  .envio input { width: 90px; }
}

/* los del propio equipo, resaltados en el marcador */
.board tr.equipo td { background: rgba(63, 166, 106, .14); }

/* --------------------------- el precio debajo del icono tiene que leerse -- */
.build { width: 64px; min-width: 64px; padding: 8px 5px 7px; gap: 5px; }
.build .ic { font-size: 26px; line-height: 28px; height: 28px; }
.build .pr {
  font-size: 12px; line-height: 15px; height: auto; font-weight: 700;
  overflow: visible; text-overflow: clip; color: var(--gold);
}
.build.disparar .pr { font-size: 9px; letter-spacing: .03em; }
body.hud-sm .build { width: 54px; min-width: 54px; }
body.hud-sm .build .ic { font-size: 21px; line-height: 23px; height: 23px; }
body.hud-sm .build .pr { font-size: 11px; }
body.hud-lg .build { width: 76px; min-width: 76px; padding: 10px 6px 9px; }
body.hud-lg .build .ic { font-size: 32px; line-height: 34px; height: 34px; }
body.hud-lg .build .pr { font-size: 14px; }

/* el selector de fichero del editor, con pinta de boton */
.editor-botones label.btn { display: inline-flex; align-items: center; cursor: pointer; }

/* ------------------------------------------------- ficha de otro jugador -- */
.ficha {
  position: fixed; top: 80px; right: 16px; z-index: 12; width: 300px;
  background: rgba(9, 16, 26, .96); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px 16px; backdrop-filter: blur(6px);
}
.ficha.hidden { display: none; }
.ficha header { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.ficha header .sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.ficha header h3 { margin: 0; font-size: 16px; flex: 1; }
.ficha header .x { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }
.ficha-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.ficha-datos .d {
  display: flex; align-items: center; gap: 7px; padding: 8px 10px;
  background: rgba(16, 30, 48, .8); border: 1px solid var(--line); border-radius: 10px;
}
.ficha-datos .d i { font-style: normal; font-size: 15px; }
.ficha-datos .d b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ficha-datos .d span { font-size: 10px; color: var(--muted); }
.ficha-fila { display: flex; justify-content: space-between; font-size: 12px; padding: 6px 0; }
.ficha-lista {
  font-size: 12px; color: var(--muted); padding: 8px 10px; margin-bottom: 12px;
  background: rgba(8, 16, 26, .7); border: 1px solid var(--line); border-radius: 9px;
}
.ficha-botones { display: flex; gap: 8px; margin-bottom: 8px; }
.ficha-botones .btn { flex: 1; }
.emojis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.emojis.hidden { display: none; }
.emojis button {
  font-size: 19px; background: rgba(16, 30, 48, .8); border: 1px solid var(--line);
  border-radius: 9px; cursor: pointer; padding: 5px 8px;
}
.emojis button:hover { border-color: var(--accent); }

/* --------------------------------------------------------- abonos mensuales */
.packs.abonos { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pack.abono { align-items: flex-start; text-align: left; gap: 8px; padding: 16px 16px 14px; }
.pack.abono .titulo-pack { font-size: 15px; letter-spacing: .1em; }
.pack.abono .moneda { position: absolute; top: 12px; right: 14px; font-size: 22px; }
.pack.abono .ventajas { list-style: none; margin: 2px 0 6px; padding: 0; display: grid; gap: 5px; }
.pack.abono .ventajas li {
  font-size: 11px; line-height: 1.45; color: var(--muted); padding-left: 15px; position: relative;
}
.pack.abono .ventajas li::before { content: '✦'; position: absolute; left: 0; color: var(--gold); }
.pack.abono.top { border-color: rgba(216, 165, 49, .55); background: rgba(46, 36, 14, .5); }
.pack.abono.mio { border-color: var(--verde); }
.pack.abono.mio .precio-real { color: var(--verde); }
.hint.vigor { grid-column: 1 / -1; color: var(--gold); margin: 0 0 4px; }

/* ------------------------------------------------- cifras del panel de admin */
.adm-cifras {
  list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}
.adm-cifras li {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 11px;
  background: rgba(8, 16, 26, .7); border: 1px solid var(--line); border-radius: 9px;
}
.adm-cifras b { font-size: 16px; color: var(--gold); font-variant-numeric: tabular-nums; }
.adm-cifras span { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.adm-aviso { display: flex; gap: 8px; margin: 0 0 12px; }
.adm-aviso input {
  flex: 1; background: rgba(8, 16, 26, .85); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font: inherit; font-size: 12px; padding: 8px 11px;
}
.mini.oro { color: var(--gold); border-color: rgba(216, 165, 49, .45); }

/* ------------------------------------------------- anuncio de fin de partida */
.anuncio {
  position: relative; margin: 14px 0 4px; padding: 26px 14px 14px;
  background: rgba(8, 16, 26, .72); border: 1px solid var(--line);
  border-radius: 12px; text-align: left;
}
.anuncio .etiqueta {
  position: absolute; top: 8px; left: 12px;
  font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
/* El hueco tiene alto propio: asi la tarjeta no pega un salto cuando el
   anuncio tarda en cargar, o cuando un bloqueador lo deja vacio. */
.anuncio .hueco { min-height: 140px; display: flex; align-items: center; justify-content: center; }
.anuncio .hueco > * { max-width: 100%; }
.anuncio .casa { display: flex; align-items: center; gap: 16px; padding: 6px 4px; }
.anuncio .casa .corona { font-size: 42px; line-height: 1; }
.anuncio .casa .txt b { display: block; font-size: 15px; color: var(--gold); margin-bottom: 5px; }
.anuncio .casa .txt p { margin: 0; font-size: 12px; line-height: 1.55; color: var(--muted); }
.anuncio #endAdVip { margin-top: 12px; width: 100%; }
.btn.primary:disabled { opacity: .5; cursor: default; }

/* ------------------------------------------------------- caja de la sesion */
.login-caja {
  display: flex; align-items: center; gap: 14px; margin: 0 0 14px;
  padding: 12px 16px; border-radius: 12px;
  background: rgba(58, 34, 18, .45); border: 1px solid rgba(216, 165, 49, .4);
}
.login-caja.dentro { background: rgba(18, 42, 28, .45); border-color: rgba(106, 196, 122, .4); }
.login-caja .ico { font-size: 22px; line-height: 1; }
.login-caja .estado { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.login-caja .estado b { font-size: 13px; color: var(--ink); }
.login-caja.dentro .estado b { color: #4af1b8; }
.login-caja .estado span { font-size: 11px; line-height: 1.5; color: var(--muted); }
.login-caja .acciones { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
@media (max-width: 720px) {
  .login-caja { flex-direction: column; align-items: flex-start; }
  .login-caja .acciones { width: 100%; }
}

/* -------------------------------------------------- novedades desde el panel */
.noticia-form { display: grid; gap: 10px; margin: 0 0 16px; }
.noticia-form label { display: flex; flex-direction: column; gap: 5px; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.noticia-form input, .noticia-form textarea {
  background: rgba(8, 16, 26, .85); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font: inherit; font-size: 12px; padding: 9px 11px; text-transform: none;
  letter-spacing: 0;
}
.noticia-form textarea { resize: vertical; line-height: 1.55; }
.noticia-form .fila-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.noticia-form .form-acciones { display: flex; gap: 10px; }
.noti-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.noti-fila.borrador { opacity: .72; }
.noti-fila .quien { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.noti-fila .quien b { font-weight: 600; }
.badge.draft { color: var(--gold); border-color: rgba(216, 165, 49, .5); }
.nota .ver { font-size: 10px; letter-spacing: .1em; color: var(--accent); margin-left: 6px; }

/* el origen exacto que hay que dar de alta en Google, para poder copiarlo */
.login-caja code {
  display: inline-block; margin-top: 4px; padding: 3px 8px;
  background: rgba(8, 16, 26, .9); border: 1px solid var(--line); border-radius: 6px;
  font-family: ui-monospace, monospace; font-size: 11px; color: var(--accent);
  user-select: all;
}

/* ------------------------------------------- aviso de que hace falta cuenta */
.aviso-cuenta {
  display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 12px 16px;
  background: rgba(58, 34, 18, .45); border: 1px solid rgba(216, 165, 49, .4); border-radius: 12px;
}
.aviso-cuenta .ico { font-size: 22px; line-height: 1; }
.aviso-cuenta > div { flex: 1; min-width: 0; }
.aviso-cuenta b { display: block; font-size: 13px; color: var(--ink); margin-bottom: 3px; }
.aviso-cuenta p { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
@media (max-width: 720px) { .aviso-cuenta { flex-direction: column; align-items: flex-start; } }

/* ------------------------------------------------------- cuenta en ajustes */
.cuenta-estado {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px;
  border-radius: 10px; background: rgba(8, 16, 26, .7); border: 1px solid var(--line);
}
.cuenta-estado.dentro { border-color: rgba(106, 196, 122, .45); background: rgba(18, 42, 28, .4); }
.cuenta-estado .ico { font-size: 20px; line-height: 1; }
.cuenta-estado .txt { min-width: 0; }
.cuenta-estado b { display: block; font-size: 13px; }
.cuenta-estado.dentro b { color: #4af1b8; }
.cuenta-estado span { font-size: 11px; color: var(--muted); line-height: 1.5; }
.sub-tabs { display: flex; gap: 6px; margin: 0 0 12px; }
.sub-tabs button {
  flex: 1; padding: 8px 10px; font-size: 10px; letter-spacing: .1em; font-weight: 700;
  background: rgba(8, 16, 26, .7); border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); cursor: pointer;
}
.sub-tabs button.on { color: var(--ink); border-color: var(--accent); background: rgba(62, 155, 255, .12); }
.form-cuenta { display: grid; gap: 10px; margin: 0 0 12px; }
.form-cuenta h3 { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.form-cuenta label { display: flex; flex-direction: column; gap: 5px; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.form-cuenta input {
  background: rgba(8, 16, 26, .85); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font: inherit; font-size: 12px; padding: 9px 11px;
  text-transform: none; letter-spacing: 0;
}
.form-cuenta small { font-size: 10px; text-transform: none; letter-spacing: 0; color: var(--muted); }

/* ------------------------------------------------------- ranked, aun cerrada */
.btn.ranked {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  gap: 3px; width: 100%; margin: 0 0 10px; padding: 14px 18px; text-align: left;
  background: rgba(20, 26, 40, .7); border: 1px dashed rgba(140, 150, 166, .4);
  cursor: not-allowed; opacity: .72;
}
.btn.ranked b { font-size: 16px; letter-spacing: .12em; color: var(--muted); }
.btn.ranked small { font-size: 10px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.btn.ranked .etiq {
  position: absolute; top: 10px; right: 14px; font-size: 8px; letter-spacing: .16em;
  padding: 3px 8px; border-radius: 999px; color: var(--gold);
  background: rgba(216, 165, 49, .14); border: 1px solid rgba(216, 165, 49, .45);
}
.adm-fila.visto { opacity: .5; }
.adm-fila .quien i { font-size: 10px; color: var(--muted); font-style: normal; }
.adm-fila .quien em { display: block; width: 100%; font-size: 11px; color: var(--ink); font-style: normal; }

/* --------------------------------------------------------- rol de moderador */
.badge.mod { color: #7fd1ff; border-color: rgba(127, 209, 255, .5); }
.topnav .nav.solo-admin { color: var(--gold); }
/* al moderador se le esconde tambien la caja de dar florines */
.adm-sec.modo-mod .adm-rapido { display: none; }

/* --------------------------------------------------- botones secundarios */
/* .ghost se usaba en varios sitios sin regla: salian como un boton normal y
   no se distinguia la accion principal de la de al lado. */
.btn.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--ink); background: rgba(62, 155, 255, .08); }

/* ------------------------------------------------------ quien esta conectado */
.adm-fila.conectado .quien i {
  font-size: 10px; color: var(--muted); font-style: normal; margin-left: 2px;
}
.adm-fila.conectado.ok .quien i { color: var(--verde); }
.adm-fila.conectado.gris { opacity: .62; }
.badge.danger { color: #ff8f8f; border-color: rgba(229, 72, 77, .5); }

/* --------------------------------------------------------- libro de caja */
.caja-dos { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .caja-dos { grid-template-columns: 1fr; } }
.caja-tit {
  margin: 0 0 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
#cajaLista .quien em {
  display: block; width: 100%; font-family: ui-monospace, monospace; font-size: 9px;
  color: rgba(140, 150, 166, .7); font-style: normal;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px;
}
#cajaCifras b { color: #7fe0a0; }

/* ------------------------------------------------ tienda: destacados y cajas */
/* El lote mas vendido, en dorado. Lo elige el servidor con las ventas reales. */
.pack.top {
  border-color: rgba(216, 165, 49, .75);
  background: linear-gradient(180deg, rgba(58, 44, 14, .75), rgba(30, 24, 10, .6));
  box-shadow: 0 0 0 1px rgba(216, 165, 49, .25), 0 6px 22px rgba(216, 165, 49, .16);
}
.pack.top .cantidad, .pack.top .titulo-pack { color: var(--gold); }
.corona-top {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  padding: 3px 12px; border-radius: 999px; white-space: nowrap;
  font-size: 8px; letter-spacing: .14em; font-weight: 800; color: #1b1405;
  background: linear-gradient(180deg, #f0cf6a, #d8a531);
}

.packs.cajas { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pack.caja .moneda { font-size: 40px; }
.pack.caja .odds { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 3px; width: 100%; }
.pack.caja .odds li { font-size: 10px; color: var(--muted); letter-spacing: .04em; }
.pack.caja .odds b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pack.caja .odds .raro b { color: #7fd1ff; }
.pack.caja .odds .epico b { color: #d3a2ff; }
.pack.caja.no { opacity: .45; cursor: not-allowed; }

/* la tarjeta de dibujarse el escudo uno mismo */
.item.propia {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px;
  background: linear-gradient(180deg, rgba(70, 40, 12, .7), rgba(36, 22, 8, .6));
  border: 1px solid rgba(216, 130, 49, .6); border-radius: 12px; cursor: pointer;
  color: var(--ink); font: inherit;
}
.item.propia:hover { border-color: #ff9e4d; }
.item.propia .marco {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: rgba(8, 14, 22, .6); border: 1px solid rgba(255, 255, 255, .1);
}
.item.propia img { width: 100%; height: 100%; image-rendering: pixelated; }
.item.propia .hazlo {
  font-size: 12px; font-weight: 800; letter-spacing: .1em; line-height: 1.35;
  text-align: center; color: #ffb26b;
}
.item.propia .nom { font-size: 11px; }
.item.propia .precio { font-size: 11px; font-weight: 700; color: var(--gold); }

/* lo que ha tocado en la caja */
.premio { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; }
.premio .chispa { font-size: 52px; line-height: 1; }
.premio .swatch.grande { width: 54px; height: 54px; border-radius: 10px; }
.premio b { font-size: 17px; }
.premio .rar { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.premio.comun .rar { color: var(--muted); }
.premio.raro .rar { color: #7fd1ff; }
.premio.epico .rar { color: #d3a2ff; }
.premio.epico b { color: #d3a2ff; }

/* ==========================================================================
 * TIENDA: aire de pagina de cajas
 *
 * La paleta esta sacada de skin.club (morado profundo de fondo, acento violeta,
 * verde para los precios y rarezas en azul/morado/rosa). Es solo la direccion
 * visual: ni un archivo ni una marca suya, todo dibujado aqui.
 *
 * Las variables van en #tab-tienda y no en :root a proposito: el resto del
 * juego mantiene su azul medieval y solo la tienda cambia de tono.
 * ========================================================================== */
#tab-tienda {
  --s-fondo: #141225;
  --s-panel: #1c1a31;
  --s-panel-alto: #201d37;
  --s-linea: #2e2b4e;
  --s-tenue: #9793ba;
  --s-morado: #8471f7;
  --s-morado-hondo: #5c49d0;
  --s-verde: #13d761;
  --s-verde-hondo: #0f8b65;
  --s-rosa: #e34878;
  --s-oro: #f9d949;
  --s-cian: #05f4ff;
}

#tab-tienda .panel {
  background: linear-gradient(180deg, var(--s-panel) 0%, var(--s-fondo) 100%);
  border-color: var(--s-linea);
}
#tab-tienda .saldo { color: var(--s-oro); }
#tab-tienda .hint { color: var(--s-tenue); }

/* pestanas de la tienda */
#tab-tienda .tienda-tabs button {
  background: var(--s-panel-alto);
  border-color: var(--s-linea);
  color: var(--s-tenue);
  border-radius: 12px;
  padding: 9px 16px;
}
#tab-tienda .tienda-tabs button:hover { color: #fff; border-color: var(--s-morado-hondo); }
#tab-tienda .tienda-tabs button.on {
  color: #fff;
  border-color: var(--s-morado);
  background: linear-gradient(180deg, var(--s-morado) 0%, var(--s-morado-hondo) 100%);
  box-shadow: 0 8px 20px rgba(92, 73, 208, .35);
}

/* --------------------------------------------------------------- las cajas */
#tab-tienda .packs.cajas {
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: 16px;
}
#tab-tienda .pack.caja {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  padding: 0 0 16px;
  background: linear-gradient(180deg, var(--s-panel-alto) 0%, #17152a 100%);
  border: 1px solid var(--s-linea);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
#tab-tienda .pack.caja:hover {
  transform: translateY(-4px);
  border-color: var(--s-morado);
  box-shadow: 0 14px 30px rgba(12, 9, 35, .55), 0 0 0 1px rgba(132, 113, 247, .25);
}

/* franja de color arriba, que es lo que distingue una caja de otra */
#tab-tienda .pack.caja::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--tono, var(--s-morado)), transparent);
}

/* el resplandor detras del icono: es lo que le da el aire de escaparate */
#tab-tienda .pack.caja .moneda {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 132px; margin: 0; font-size: 62px; line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .5));
}
#tab-tienda .pack.caja .moneda::before {
  content: ''; position: absolute; width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle, var(--tono, var(--s-morado)) 0%, transparent 68%);
  opacity: .30;
}
#tab-tienda .pack.caja:hover .moneda::before { opacity: .48; }

#tab-tienda .pack.caja .titulo-pack {
  order: -1; width: 100%; padding: 13px 10px 0;
  font-size: 12px; font-weight: 800; letter-spacing: .16em; text-align: center;
}

/* probabilidades: una fila por rareza, con su color */
#tab-tienda .pack.caja .odds {
  width: calc(100% - 28px); margin: 2px 0 12px; padding: 10px 12px;
  background: rgba(11, 10, 21, .55);
  border: 1px solid rgba(151, 147, 186, .12);
  border-radius: 10px;
  display: grid; gap: 5px;
}
#tab-tienda .pack.caja .odds li {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--s-tenue);
}
#tab-tienda .pack.caja .odds b { font-size: 12px; font-variant-numeric: tabular-nums; }
#tab-tienda .pack.caja .odds .comun b { color: #64a5d3; }
#tab-tienda .pack.caja .odds .raro b { color: var(--s-morado); }
#tab-tienda .pack.caja .odds .epico b { color: var(--s-rosa); }

/* el precio, en verde, como el boton de comprar de esas paginas */
#tab-tienda .pack.caja .precio-real {
  padding: 10px 26px; border-radius: 12px;
  font-size: 14px; font-weight: 800; color: #06210f; letter-spacing: .04em;
  background: linear-gradient(180deg, #2bf07c 0%, var(--s-verde) 55%, var(--s-verde-hondo) 100%);
  box-shadow: 0 8px 18px rgba(19, 215, 97, .28);
}
#tab-tienda .pack.caja:hover .precio-real { filter: brightness(1.08); }
#tab-tienda .pack.caja.no { opacity: .4; }
#tab-tienda .pack.caja.no .precio-real { background: #3a3752; color: var(--s-tenue); box-shadow: none; }

/* tonos por caja */
#tab-tienda .pack.caja[data-caja="caja_baul"]   { --tono: #64a5d3; }
#tab-tienda .pack.caja[data-caja="caja_arcon"]  { --tono: var(--s-morado); }
#tab-tienda .pack.caja[data-caja="caja_tesoro"] { --tono: var(--s-oro); }
#tab-tienda .pack.caja.top {
  border-color: rgba(249, 217, 73, .5);
  background: linear-gradient(180deg, #2a2338 0%, #191529 100%);
}

/* --------------------------------------------------- lotes de florines y VIP */
#tab-tienda .pack {
  background: linear-gradient(180deg, var(--s-panel-alto) 0%, #17152a 100%);
  border: 1px solid var(--s-linea); border-radius: 16px;
}
#tab-tienda .pack:hover { border-color: var(--s-morado); transform: translateY(-3px); }
#tab-tienda .pack .cantidad { color: #fff; }
#tab-tienda .pack .precio-real {
  padding: 9px 20px; border-radius: 12px; color: #06210f; font-weight: 800;
  background: linear-gradient(180deg, #2bf07c 0%, var(--s-verde) 55%, var(--s-verde-hondo) 100%);
}
#tab-tienda .pack.top {
  border-color: rgba(249, 217, 73, .55);
  box-shadow: 0 0 0 1px rgba(249, 217, 73, .18), 0 12px 28px rgba(249, 217, 73, .14);
}
#tab-tienda .corona-top {
  background: linear-gradient(180deg, #ffe680, var(--s-oro));
  color: #241c02;
}
#tab-tienda .pack.abono.top { border-color: rgba(132, 113, 247, .6); }
#tab-tienda .pack .ventajas li::before { color: var(--s-morado); }

/* ------------------------------------------------------- fichas de cosmeticos */
#tab-tienda .art, #tab-tienda .item.propia {
  background: linear-gradient(180deg, var(--s-panel-alto) 0%, #17152a 100%);
  border: 1px solid var(--s-linea); border-radius: 14px;
}
#tab-tienda .art:hover { border-color: var(--s-morado); }
#tab-tienda .art.on { border-color: var(--s-verde); }
#tab-tienda .art .precio { color: var(--s-oro); }
#tab-tienda .art .tuyo { color: var(--s-morado); }
#tab-tienda .art .puesto { color: var(--s-verde); }
#tab-tienda .item.propia {
  border-color: rgba(227, 72, 120, .55);
  background: linear-gradient(180deg, #33203a 0%, #1d1430 100%);
}
#tab-tienda .item.propia:hover { border-color: var(--s-rosa); }
#tab-tienda .item.propia .hazlo { color: var(--s-rosa); }

/* ------------------------------------------------------ lo que te ha tocado */
.premio {
  position: relative; padding: 26px 0 18px;
}
.premio::before {
  content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, var(--rar, #8471f7) 0%, transparent 65%);
  opacity: .3;
}
.premio > * { position: relative; }
.premio .chispa { font-size: 66px; animation: premioSube .5s ease-out; }
.premio.comun { --rar: #64a5d3; }
.premio.raro  { --rar: #8471f7; }
.premio.epico { --rar: #e34878; }
.premio.comun .rar { color: #64a5d3; }
.premio.raro .rar { color: #8471f7; }
.premio.epico .rar, .premio.epico b { color: #e34878; }
@keyframes premioSube {
  from { transform: scale(.4) translateY(14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ==========================================================================
 * Apertura de caja: la cinta que gira y se para en el premio.
 * El premio lo ha decidido el servidor; esto solo lo ensena.
 * ========================================================================== */
.abrir-caja {
  width: min(880px, 94vw); padding: 26px 22px 24px; text-align: center;
  background: linear-gradient(180deg, #201d37 0%, #141225 100%);
  border: 1px solid #2e2b4e; border-radius: 20px;
  box-shadow: 0 24px 60px rgba(5, 4, 14, .7);
}
.abrir-caja h3 {
  margin: 0 0 18px; font-size: 13px; font-weight: 800;
  letter-spacing: .34em; color: #9793ba;
}
.ruleta {
  position: relative; overflow: hidden; height: 132px;
  border-radius: 14px; background: #0d0c1b;
  border: 1px solid #2e2b4e;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .6);
}
/* los degradados de los lados, que es lo que hace que parezca infinita */
.ruleta::before, .ruleta::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 110px; z-index: 3;
  pointer-events: none;
}
.ruleta::before { left: 0; background: linear-gradient(90deg, #0d0c1b, transparent); }
.ruleta::after { right: 0; background: linear-gradient(270deg, #0d0c1b, transparent); }

/* las dos agujas que marcan el centro */
/* Las agujas marcan el centro: una baja desde arriba y otra sube desde abajo,
   con una linea fina uniendolas. Asi se ve exactamente donde para. */
.ruleta .aguja {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 5;
  width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent;
  filter: drop-shadow(0 0 6px rgba(227, 72, 120, .8));
}
.ruleta .aguja.izq { top: 0; border-top: 13px solid #e34878; }
.ruleta .aguja.der { bottom: 0; border-bottom: 13px solid #e34878; }
.ruleta .linea {
  position: absolute; left: 50%; top: 10px; bottom: 10px; width: 2px; z-index: 4;
  transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(180deg, rgba(227,72,120,.9), rgba(227,72,120,.25), rgba(227,72,120,.9));
}

.tira {
  position: absolute; top: 0; bottom: 0; left: 0;
  display: flex; align-items: center; gap: 8px;
  will-change: transform;
}
.tira .lote {
  flex: 0 0 108px; height: 100px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: linear-gradient(180deg, #262340 0%, #1a1830 100%);
  border: 1px solid #2e2b4e; position: relative; overflow: hidden;
}
.tira .lote::before {
  content: ''; position: absolute; inset: auto 0 0 0; height: 3px;
  background: var(--rar, #64a5d3);
}
.tira .lote.comun { --rar: #64a5d3; }
.tira .lote.raro  { --rar: #8471f7; }
.tira .lote.epico { --rar: #e34878; }
.tira .lote .cara {
  font-size: 30px; line-height: 1; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5));
}
.tira .lote .cara img { width: 34px; height: 34px; image-rendering: pixelated; border-radius: 5px; }
.tira .lote .cara .tono { display: block; width: 30px; height: 30px; border-radius: 7px; }
.tira .lote .nom {
  font-size: 9px; letter-spacing: .04em; color: #9793ba;
  max-width: 94px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* lo que ha tocado, debajo de la cinta */
.abrir-final {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  margin: 20px 0 4px; position: relative;
}
.abrir-final::before {
  content: ''; position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, var(--rar, #8471f7) 0%, transparent 66%);
  opacity: .28;
}
.abrir-final > * { position: relative; }
.abrir-final.comun { --rar: #64a5d3; }
.abrir-final.raro  { --rar: #8471f7; }
.abrir-final.epico { --rar: #e34878; }
.abrir-final .cara { font-size: 58px; animation: premioSube .45s ease-out; }
.abrir-final .cara img { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 10px; }
.abrir-final .cara .tono { display: block; width: 58px; height: 58px; border-radius: 12px; }
.abrir-final b { font-size: 20px; }
.abrir-final .rar {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--rar);
}
.abrir-final .hint { font-size: 11px; }
#abrirCerrar { margin-top: 14px; min-width: 190px; }

/* ------------------------------------------- remate visual de la tienda -- */
/* La banderola del bonus se salia de la tarjeta y pisaba las cifras. Se
   recorta contra la esquina y el texto queda por encima. */
#tab-tienda .pack { overflow: hidden; }
#tab-tienda .pack > * { position: relative; z-index: 1; }
#tab-tienda .pack .cinta {
  z-index: 2; top: 14px; right: -34px; padding: 4px 38px;
  font-size: 8px; letter-spacing: .12em;
  background: linear-gradient(180deg, #2bf07c, var(--verde));
  color: #06210f; box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}
#tab-tienda .corona-top { z-index: 3; }

/* las tarjetas de lote, con mas aire y el icono con resplandor */
#tab-tienda .pack {
  padding: 20px 14px 18px; gap: 7px;
}
#tab-tienda .pack .titulo-pack {
  font-size: 11px; letter-spacing: .18em; color: var(--muted); font-weight: 700;
}
#tab-tienda .pack .moneda {
  position: relative; font-size: 40px; margin: 2px 0;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .5));
}
#tab-tienda .pack .moneda::after {
  content: ''; position: absolute; left: 50%; top: 50%; z-index: -1;
  width: 92px; height: 92px; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, var(--accent2) 0%, transparent 68%); opacity: .22;
}
#tab-tienda .pack.top .moneda::after { background: radial-gradient(circle, var(--gold) 0%, transparent 68%); opacity: .3; }
#tab-tienda .pack .cantidad { font-size: 24px; }
#tab-tienda .pack .unidad { letter-spacing: .18em; }

/* el rodillo, un poco mas alto para que respire */
.ruleta { height: 148px; }
.tira .lote { height: 112px; }

/* --------------------------------------- barra de tropas encima, obra abajo */
/* Antes iba todo en una fila y la barra de tropas quedaba apretada en una
   esquina. Ahora la barra ocupa el ancho arriba y los edificios van debajo. */
.hud-bottom {
  flex-direction: column; align-items: stretch; gap: 10px;
}
.hud-bottom .tropas {
  width: 100%; justify-content: center; gap: 16px;
  padding: 8px 14px; border-radius: 12px;
  background: rgba(20, 18, 37, .82); border: 1px solid var(--line);
}
.hud-bottom .grupos { justify-content: center; }
.hud-bottom .actions { align-self: center; }

/* el deslizador, con la cifra de tropas de verdad */
.tropas .envio { display: flex; align-items: center; gap: 10px; }
.tropas .envio input[type="range"] { width: 210px; }
#ratioVal {
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15;
  min-width: 96px;
}
#ratioVal b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
#ratioVal i {
  font-style: normal; font-size: 9px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}

/* -------------------------------------------------- las cajas, centradas -- */
/* La rejilla estiraba las tarjetas y las dejaba pegadas a la izquierda.
   Con flex y ancho fijo quedan centradas sean tres o siete. */
#tab-tienda .packs.cajas {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px;
}
#tab-tienda .pack.caja { flex: 0 0 224px; }

/* La chapa de "mejores probabilidades" se salia por arriba y pisaba el titulo.
   Va dentro del flujo, encima del nombre y centrada: no puede solaparse. */
#tab-tienda .pack.caja .corona-top {
  position: static; transform: none; order: -2;
  margin: 12px auto 7px; display: inline-block;
}
#tab-tienda .pack.caja .titulo-pack { padding-top: 8px; }
#tab-tienda .pack.caja:not(.top) .titulo-pack { padding-top: 16px; }

/* --------------------------------------------------- puerta del juego cerrado */
.puerta {
  text-align: center; margin: 0 0 16px; padding: 26px 22px 22px;
  background: linear-gradient(180deg, rgba(46, 36, 78, .8), rgba(20, 18, 37, .75));
  border: 1px solid rgba(132, 113, 247, .45); border-radius: 16px;
}
.puerta .candado { font-size: 34px; line-height: 1; display: block; margin-bottom: 8px; }
.puerta h3 { margin: 0 0 7px; font-size: 17px; letter-spacing: .04em; }
.puerta p { margin: 0 auto; max-width: 520px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.puerta-form { display: flex; gap: 9px; justify-content: center; margin-top: 16px; }
.puerta-form input {
  flex: 1; max-width: 340px; background: rgba(8, 14, 22, .85);
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font: inherit; font-size: 12px; padding: 10px 13px;
}
/* Sin acceso no se ensenan las partidas: seria enseñar una puerta y no dejar
   pasar. Los botones siguen ahi pero el servidor no deja entrar igualmente. */
body.sin-acceso #lobbyGrid,
body.sin-acceso #btnSolo,
body.sin-acceso .btn-row,
body.sin-acceso #btnRanked { display: none; }

.adm-fila.sol .quien i { font-size: 10px; color: var(--muted); font-style: normal; }
.adm-fila.sol .quien em { display: block; width: 100%; font-size: 11px; color: var(--ink); font-style: normal; }
.adm-fila.sol.aceptada { opacity: .6; }
.adm-fila.sol.rechazada { opacity: .45; }

/* ------------------------------------------------------ pantalla de carga */
#cargando {
  position: fixed; inset: 0; z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--bg);
  transition: opacity .35s ease, visibility 0s linear .35s;
}
#cargando.fuera { opacity: 0; pointer-events: none; visibility: hidden; }
#cargando .rueda {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(132, 113, 247, .22);
  border-top-color: var(--accent2);
  animation: gira .8s linear infinite;
}
#cargando .marca {
  font-size: 20px; font-weight: 800; letter-spacing: .3em; color: var(--ink);
  text-indent: .3em;
}
#cargando .paso {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  min-height: 14px;
}
@keyframes gira { to { transform: rotate(360deg); } }
/* Quien prefiera no ver cosas moviendose: la rueda se queda quieta */
@media (prefers-reduced-motion: reduce) {
  #cargando .rueda { animation-duration: 3s; }
}

/* ------------------------------------------------------- lista de baneados */
.baneados {
  margin: 0 0 14px; padding: 12px 14px;
  background: rgba(40, 14, 20, .4); border: 1px solid rgba(248, 45, 49, .3);
  border-radius: 12px;
}
.baneados .caja-tit { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.adm-fila.baneado .quien i { font-size: 10px; color: var(--muted); font-style: normal; }
.adm-fila.baneado .quien em {
  display: block; width: 100%; font-size: 11px; color: var(--ink); font-style: normal;
}
.adm-fila.baneado .quien em.sinmotivo { color: var(--muted); font-style: italic; }
#admVerBaneados .pill { margin-left: 6px; }

/* el lapiz para redibujar el escudo propio */
.item.propia { position: relative; }
.item.propia .lapiz {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 24px; height: 24px; padding: 0; font-size: 12px; line-height: 1;
  background: rgba(11, 10, 21, .85); border: 1px solid var(--line);
  border-radius: 7px; color: var(--ink); cursor: pointer;
}
.item.propia .lapiz:hover { border-color: var(--rosa); }
.item.propia.on { border-color: var(--verde); }
.item.propia .puesto { font-size: 11px; font-weight: 700; color: var(--verde); }
.item.propia .tuyo { font-size: 11px; font-weight: 700; color: var(--accent2); }

/* -------------------------------- correo e IP en la lista de administracion */
.adm-fila .quien .datos {
  display: block; width: 100%; margin-top: 2px;
  font-family: ui-monospace, monospace; font-size: 9px; font-style: normal;
  color: rgba(151, 147, 186, .75);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px;
}
#admVerInvitados.on, #admVerBaneados.on {
  border-color: var(--accent2); color: var(--ink); background: rgba(132, 113, 247, .12);
}

/* ------------------------------- filas del panel que crecen a dos renglones */
/* .quien era flex sin permitir salto, asi que el correo y la IP se quedaban
   en la misma linea aunque pidieran el ancho entero, y se salian del cuadro.
   Con wrap bajan solas, y los botones se alinean arriba para que no bailen. */
.adm-fila { align-items: flex-start; }
.adm-fila .quien { flex-wrap: wrap; min-width: 0; flex: 1; }
.adm-fila .quien .datos,
.adm-fila .quien em { flex: 0 0 100%; max-width: 100%; }
.adm-fila .der { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
/* la lista entera no puede empujar el panel a lo ancho */
.adm-sec .lista { max-width: 100%; }
.adm-sec .lista li { flex-wrap: wrap; }

/* ------------------------------------------- abrir o cerrar el juego */
.puerta-mando {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin: 0 0 16px; padding: 14px 18px; border-radius: 12px;
  background: rgba(20, 18, 37, .8); border: 1px solid var(--line);
}
.puerta-mando .estado b { display: block; font-size: 14px; margin-bottom: 3px; }
.puerta-mando .estado span { font-size: 11px; color: var(--muted); }
.palanca {
  position: relative; flex: none; width: 138px; height: 38px; padding: 0;
  border-radius: 999px; cursor: pointer;
  background: rgba(248, 45, 49, .16); border: 1px solid rgba(248, 45, 49, .5);
  transition: background .18s ease, border-color .18s ease;
}
.palanca.on { background: rgba(19, 215, 97, .16); border-color: rgba(19, 215, 97, .55); }
.palanca .bola {
  position: absolute; top: 3px; left: 3px; width: 30px; height: 30px;
  border-radius: 50%; background: var(--danger);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  transition: transform .18s ease, background .18s ease;
}
.palanca.on .bola { transform: translateX(100px); background: var(--verde); }
.palanca .si, .palanca .no {
  position: absolute; top: 0; line-height: 38px;
  font-size: 10px; font-weight: 800; letter-spacing: .14em;
  transition: opacity .18s ease;
}
.palanca .si { left: 16px; color: var(--verde); opacity: 0; }
.palanca .no { right: 14px; color: #ff8f8f; opacity: 1; }
.palanca.on .si { opacity: 1; }
.palanca.on .no { opacity: 0; }

/* ------------------------------------------------- lista de solicitudes */
.lista .grupo-sol {
  display: block; padding: 10px 0 4px; border: 0;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.adm-fila.sol .badge.pendiente { color: var(--gold); border-color: rgba(249, 217, 73, .5); }
.adm-fila.sol .badge.aceptada { color: var(--verde); border-color: rgba(19, 215, 97, .5); }
.adm-fila.sol .badge.rechazada { color: #ff8f8f; border-color: rgba(248, 45, 49, .5); }
.adm-fila.sol .quien em { font-size: 11px; color: var(--ink); }
.adm-fila.sol .quien em.sinmotivo { color: var(--muted); font-style: italic; }

/* ----------------------------------------- lo que se ve sin JavaScript */
.sin-js {
  max-width: 620px; margin: 12vh auto; padding: 0 24px;
  color: var(--ink); text-align: center;
}
.sin-js h1 { font-size: 26px; color: var(--gold); margin: 0 0 14px; }
.sin-js p { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ------------------------------------------ mandos de admin en la partida */
.mando-abrir {
  position: fixed; top: 14px; right: 14px; z-index: 40;
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  background: rgba(20, 18, 37, .9); border: 1px solid var(--gold);
  color: var(--gold); font-size: 18px; line-height: 1;
  box-shadow: var(--shadow);
}
.mando-abrir:hover { background: var(--gold); color: #14121f; }

.mando {
  position: fixed; top: 62px; right: 14px; z-index: 40;
  width: min(430px, 94vw); max-height: 76vh; overflow: auto;
  background: rgba(15, 13, 30, .97); border: 1px solid var(--gold);
  border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow);
}
.mando-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mando-head b { color: var(--gold); font-size: 11px; letter-spacing: .16em; }
.mando-head .est { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.mando-head .est.pausa { color: var(--gold); font-weight: 800; }
.mando-head .x {
  margin-left: auto; background: none; border: 0; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.mando-global { display: flex; gap: 6px; margin-bottom: 10px; }
.mando-global .mini { flex: 1; }

.mando-valor { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mando-valor span {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.mando-valor input {
  flex: 1; background: rgba(0, 0, 0, .35); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; font-size: 12px;
}

.mando-lista { list-style: none; margin: 0; padding: 0; }
.mando-lista li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.mando-lista li.fuera { opacity: .45; }
.mando-lista li.vacio { color: var(--muted); font-size: 12px; justify-content: center; }
.mando-lista .quien { flex: 1; min-width: 0; }
.mando-lista .quien b { font-size: 13px; }
.mando-lista .punto {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.mando-lista .tag {
  font-size: 9px; letter-spacing: .1em; padding: 1px 5px; margin-left: 5px;
  border: 1px solid var(--line); border-radius: 4px; color: var(--muted);
}
.mando-lista .tag.off { color: #ff8f8f; border-color: rgba(248, 45, 49, .4); }
.mando-lista .cifras {
  display: block; font-size: 10px; color: var(--muted); font-style: normal; margin-top: 3px;
}
.mando-lista .der { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

/* El cartel de pausa lo ven todos, no solo quien la ha puesto.
   Va en su propio elemento: body::before y body::after ya los ocupan el
   degradado y la reticula del fondo, y usarlos aqui los borraria. */
body.en-pausa #cv { filter: saturate(.5) brightness(.8); }
#pausaCartel {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  z-index: 45; padding: 7px 20px 8px;
  background: var(--gold); color: #14121f;
  font-size: 11px; font-weight: 800; letter-spacing: .18em;
  border-radius: 0 0 10px 10px;
  pointer-events: none;
}
body:not(.en-pausa) #pausaCartel { display: none; }

/* ------------------------------------------------ salud de los pagos */
.modo-pago { font-size: 11px; color: var(--muted); margin: 0 0 8px; letter-spacing: .1em; }
.modo-pago b { color: var(--muted); }
.modo-pago b.real { color: var(--gold); }
.salud {
  padding: 9px 12px; border-radius: 8px; margin-bottom: 6px;
  border: 1px solid var(--line); background: rgba(20, 18, 37, .7);
}
.salud b { display: block; font-size: 12px; }
.salud i { display: block; font-size: 11px; color: var(--muted); font-style: normal; margin-top: 3px; }
.salud.mal { border-color: rgba(248, 45, 49, .55); }
.salud.mal b { color: #ff8f8f; }
.salud.bien { border-color: rgba(19, 215, 97, .45); }
.salud.bien b { color: var(--verde); }

.bitacora .hook b { font-size: 10px; letter-spacing: .1em; }
.bitacora .hook.abonado b { color: var(--verde); }
.bitacora .hook.sin-abonar b { color: var(--gold); }
.bitacora .hook.firma-mala b { color: #ff8f8f; }
.bitacora .hook.ignorado b { color: var(--muted); }
.bitacora .hook em { display: block; font-size: 11px; color: var(--ink); font-style: normal; margin-top: 2px; }

/* ------------------------------------------------- rangos en el chat */
.rango {
  display: inline-flex; align-items: center; gap: 3px;
  margin-right: 5px; padding: 1px 6px 2px;
  border-radius: 5px; border: 1px solid currentColor;
  font-size: 9px; font-weight: 800; letter-spacing: .1em;
  vertical-align: middle;
}
.rango i { font-style: normal; font-size: 11px; line-height: 1; }
.rango.admin { color: var(--gold); background: rgba(249, 217, 73, .12); }
.rango.mod { color: #7ed6ff; background: rgba(126, 214, 255, .12); }
.rango.vip { color: var(--rosa); background: rgba(227, 72, 120, .14); }

/* El nombre tambien se ti;e: en un chat que va rapido, la etiqueta sola
   se pierde y el color es lo que se ve de un vistazo. */
.linea.de-admin b { color: var(--gold); }
.linea.de-mod b { color: #7ed6ff; }
.linea.de-vip b { color: var(--rosa); }

/* ------------------------------------------------------- clanes: panel */
.clan-modo {
  font-size: 9px; font-weight: 800; letter-spacing: .12em;
  padding: 2px 7px; border-radius: 5px; border: 1px solid currentColor;
}
.clan-modo.abierto { color: var(--verde); }
.clan-modo.solicitud { color: var(--gold); }
.clan-modo.cerrado { color: #ff8f8f; }

.clan-editar {
  display: flex; flex-direction: column; gap: 8px;
  margin: 12px 0; padding: 14px; border-radius: 10px;
  background: rgba(20, 18, 37, .7); border: 1px solid var(--line);
}
.clan-editar label { display: flex; align-items: center; gap: 10px; }
.clan-editar label span {
  flex: none; width: 92px; font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.clan-editar input {
  flex: 1; background: rgba(0, 0, 0, .35); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; font-size: 13px;
}
.clan-editar .hint { margin: 0; }
.clan-modos { display: flex; gap: 6px; }
.clan-modos .mini { flex: 1; }
.clan-modos .mini.on {
  border-color: var(--gold); color: var(--gold); background: rgba(249, 217, 73, .12);
}

.clan-peticiones { margin: 14px 0; }
.lista .rol {
  font-size: 9px; font-style: normal; letter-spacing: .1em;
  padding: 1px 5px; margin-left: 6px; border-radius: 4px; border: 1px solid currentColor;
}
.lista .rol.lider { color: var(--gold); }
.lista .rol.oficial { color: #7ed6ff; }
.lista .elo, .lista .cifras {
  display: block; font-size: 10px; font-style: normal; color: var(--muted); margin-top: 3px;
}
.lista.clanes .modo {
  font-size: 9px; font-style: normal; letter-spacing: .1em; margin-left: 6px;
  padding: 1px 5px; border-radius: 4px; border: 1px solid currentColor;
}
.lista.clanes .modo.abierto { color: var(--verde); }
.lista.clanes .modo.solicitud { color: var(--gold); }
.lista.clanes .modo.cerrado { color: var(--muted); }
.lista .cerrado { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------- los chats */
.chat-caja {
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(11, 21, 34, .6); overflow: hidden;
}
.chat-log {
  height: 210px; overflow-y: auto; padding: 10px 12px;
  font-size: 12px; line-height: 1.55;
}
.chat-log .vacio { color: var(--muted); text-align: center; padding: 24px 0; }
.chat-log .linea { margin-bottom: 3px; word-break: break-word; }
.chat-log .hora { font-style: normal; font-size: 10px; color: var(--muted); margin-right: 6px; }
.chat-log .tag { font-style: normal; font-size: 10px; color: var(--accent2); margin-right: 4px; }
.chat-log b { margin-right: 4px; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; background: rgba(0, 0, 0, .35); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; font-size: 12px;
}

/* El chat global vive pegado a la izquierda del PLAY.
   En pantalla estrecha es una cajita flotante; en cuanto hay hueco de sobra
   se estira y se convierte en la columna de la izquierda. */
.global-chat {
  position: fixed; left: 14px; bottom: 14px; z-index: 20;
  width: min(300px, 92vw);
  background: rgba(15, 13, 30, .95); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.global-chat header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--line);
}
.global-chat header b { font-size: 10px; letter-spacing: .14em; color: var(--accent2); }
.global-chat header .x {
  margin-left: auto; background: none; border: 0; color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.global-chat .chat-log { height: 240px; }
.global-chat.plegado .chat-log, .global-chat.plegado .chat-form { display: none; }

/* ---- la columna de la izquierda, cuando el hueco da para ella.
   A 1500px el margen libre ya da para una columna legible. Los 28px que se
   restan son el respiro con el contenido MAS la barra de desplazamiento:
   100vw la cuenta y el centrado del contenido no, asi que sin ellos se
   solapaban un par de pixeles. */
@media (min-width: 1500px) {
  .global-chat {
    left: 0; top: 60px; bottom: 0;
    width: clamp(200px, calc((100vw - 1000px) / 2 - 28px), 340px);
    display: flex; flex-direction: column;
    /* Sin caja: se funde con el fondo en vez de flotar encima. Un velo muy
       tenue que se apaga hacia la derecha es lo unico que la separa. */
    background: linear-gradient(to right, rgba(20, 18, 37, .55), rgba(20, 18, 37, 0));
    border: 0; border-radius: 0; box-shadow: none;
  }
  .global-chat header {
    border-bottom: 1px solid var(--line);
    /* El titulo se alinea con el borde del contenido, no con el de la pantalla */
    margin: 0 18px; padding: 14px 0 10px;
  }
  .global-chat .chat-log {
    height: auto; flex: 1; min-height: 0;   /* min-height 0 o flex no le deja encoger */
    padding: 12px 18px;
  }
  .global-chat .chat-form {
    border-top: 1px solid var(--line);
    margin: 0 18px 16px; padding: 12px 0 0;
  }
  .global-chat .chat-form input { background: rgba(0, 0, 0, .45); }
  /* Plegada se queda en una tira arriba, sin dejar un hueco raro */
  .global-chat.plegado { bottom: auto; background: none; }
}

/* Cuelga de #tab-jugar, asi que al cambiar de pestana se va solo. En
   pantallas estrechas se quita: tapaba media pantalla. */
@media (max-width: 900px) { .global-chat { display: none; } }

/* --------------------------------------------- ficha de un jugador */
/* Cuelga de .overlay/.modal, que es lo que usan las demas ventanas. */
.ficha-caja { width: min(420px, 92vw); position: relative; }
.ficha-caja .x {
  position: absolute; top: 8px; right: 12px;
  background: none; border: 0; color: var(--muted); font-size: 24px;
  line-height: 1; cursor: pointer;
}
.ficha-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ficha-head .emb { font-size: 30px; line-height: 1; }
.ficha-head .quien { min-width: 0; }
.ficha-head b { display: inline-block; font-size: 17px; margin-right: 6px; }
.ficha-head i { display: block; font-style: normal; margin-top: 4px; }
.ficha-head .cifras { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.punto-on {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--verde); vertical-align: middle; margin-left: 4px;
}
.clan-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent2); font-size: 12px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}
.clan-link:hover { color: var(--gold); }

/* Las cifras, en rejilla: se comparan mejor en columnas que en una lista */
.ficha-cifras {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden;
}
.ficha-cifras li { background: rgba(20, 18, 37, .95); padding: 9px 10px; }
.ficha-cifras i {
  display: block; font-style: normal; font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.ficha-cifras b { font-size: 15px; }

.ficha-admin {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(249, 217, 73, .35); background: rgba(249, 217, 73, .06);
}
.ficha-admin .caja-tit { color: var(--gold); margin-top: 0; }
.ficha-admin .par { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.ficha-admin .par i { font-style: normal; font-size: 11px; color: var(--muted); }
.ficha-admin .par b { font-size: 11px; word-break: break-all; }
.ficha-admin .mini { margin-top: 8px; }

.ficha-acciones { display: flex; flex-wrap: wrap; gap: 6px; }
.ficha-acciones .mini { flex: 1; min-width: 96px; }
.ficha-acciones .mini[disabled] { opacity: .45; cursor: default; }

/* El nombre en el chat invita a pulsarlo */
.chat-log b[data-uid] { cursor: pointer; }
.chat-log b[data-uid]:hover { text-decoration: underline; text-underline-offset: 2px; }

/* -------------------------------------------------- moderar el chat */
.borrar-msg {
  background: none; border: 0; padding: 0 4px; cursor: pointer;
  font-size: 11px; opacity: 0; transition: opacity .12s;
}
/* Solo aparece al pasar por encima: si estuviera siempre visible, el chat
   parecería una lista de botones. */
.chat-log .linea:hover .borrar-msg { opacity: .55; }
.borrar-msg:hover { opacity: 1 !important; }
.ficha-mod { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.ficha-mod .mini { flex: 1; min-width: 64px; }

/* ------------------------------- historial de partidas y de mensajes */
.ficha-partidas, .ficha-dichos { margin-bottom: 14px; }
.ficha-partidas .caja-tit, .ficha-dichos .caja-tit { margin-top: 0; }
.lista-partidas, .lista-dichos {
  list-style: none; margin: 0; padding: 0;
  max-height: 190px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px;
}
.lista-partidas li {
  display: grid; grid-template-columns: 74px 44px 1fr auto;
  align-items: center; gap: 8px;
  padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 11px;
}
.lista-partidas li:last-child, .lista-dichos li:last-child { border-bottom: 0; }
.lista-partidas li.gano .puesto { color: var(--gold); }
.lista-partidas .cuando { font-style: normal; color: var(--muted); }
.lista-partidas .puesto { font-size: 12px; }
.lista-partidas .mapa { font-style: normal; }
.lista-partidas .detalle { font-style: normal; color: var(--muted); grid-column: 3; font-size: 10px; }
.lista-partidas .delta { font-style: normal; font-weight: 800; }
.lista-partidas .delta.sube { color: var(--verde); }
.lista-partidas .delta.baja { color: #ff8f8f; }

.lista-dichos li { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.lista-dichos i {
  display: block; font-style: normal; font-size: 9px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.lista-dichos span { font-size: 12px; word-break: break-word; }

/* Los nombres del panel invitan a pulsarlos, igual que en el chat */
.adm-fila b[data-uid] { cursor: pointer; }
.adm-fila b[data-uid]:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------ la barra de abajo, mas compacta */
/* Ocupaba demasiado alto y se comia el mapa. Todo baja de tamano a la vez,
   asi que la proporcion entre iconos, precios y barra se mantiene. */
.hud-bottom { gap: 7px; bottom: 10px; }
.hud-bottom .tropas { gap: 12px; padding: 5px 12px; border-radius: 10px; }
.tropas .ritmo { font-size: 13px; min-width: 62px; }
.tbar { width: 210px; height: 27px; border-radius: 8px; }
.tbar .cifras b { font-size: 14px; }
.tbar .cifras em { font-size: 10px; }
.tropas .envio { gap: 8px; }
/* Con el id, que si no gana el "#ratio { width: 220px }" de mas arriba por
   especificidad y el deslizador se queda igual de largo. */
#ratio { width: 170px; }
#ratioVal { min-width: 80px; }
#ratioVal b { font-size: 13px; }

.grupos { gap: 10px; }
.grupo .titulo { font-size: 8px; }
.build { width: 52px; min-width: 52px; padding: 6px 4px 5px; gap: 3px; }
.build .ic { font-size: 21px; line-height: 22px; height: 22px; }
.build .pr { font-size: 10px; line-height: 13px; }
.build.disparar .pr, .build.muni .pr { font-size: 8px; }

/* Y la escala de los ajustes sigue mandando encima de esto */
body.hud-sm .build { width: 44px; min-width: 44px; }
body.hud-sm .build .ic { font-size: 18px; line-height: 19px; height: 19px; }
body.hud-sm .build .pr { font-size: 9px; }
body.hud-sm .tbar { width: 175px; height: 24px; }
body.hud-lg .build { width: 66px; min-width: 66px; padding: 9px 6px 8px; }
body.hud-lg .build .ic { font-size: 26px; line-height: 28px; height: 28px; }
body.hud-lg .tbar { width: 250px; height: 32px; }

/* --------------------------- chat y salir, fuera de la barra de abajo */
/* Antes iban pegados a los edificios y a nadie le hace falta tenerlos ahi
   con el raton. En el lateral estan a mano y no ocupan sitio util. */
.actions-lado {
  position: fixed; right: 12px; bottom: 12px; z-index: 6;
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
}
.actions-lado .btn { padding: 7px 12px; font-size: 11px; letter-spacing: .08em; }
/* Quien solo mira no tiene chat que escribir */
body.espectador .actions-lado #btnChat { display: none; }
@media (max-width: 900px) {
  .actions-lado { right: 8px; bottom: 8px; flex-direction: row; }
}
