/* WardenPanel: oscuro, como las capturas de SpawnBox; en el móvil, una sola columna. */
:root {
  color-scheme: dark;
  --fondo: #0f1116; --tarjeta: #171a21; --tarjeta2: #1d212a; --linea: #2a2f3a; --texto: #e6e8ee; --tenue: #8b93a6;
  --morado: #8b7bff; --morado2: #6c5ce7; --verde: #3ddc84; --amarillo: #f5c542; --rojo: #ff5c7a; --azul: #5cc8ff;
  --radio: 10px;
  --letra: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 14px/1.45 var(--letra); }
[hidden] { display: none !important; }
h1 { font-size: 1.4rem; margin: .3rem 0; }
h2 { font-size: 1rem; margin: 0 0 .7rem; display: flex; align-items: center; gap: .5rem; }
h3 { font-size: .9rem; margin: .8rem 0 .5rem; color: var(--tenue); }
a { color: var(--azul); }
.sub, .pista { color: var(--tenue); font-size: .85rem; }
.error { color: var(--rojo); min-height: 1em; margin: .4rem 0 0; }
.ok { color: var(--verde); margin: .4rem 0 0; word-break: break-all; }
.cuenta { color: var(--tenue); font-weight: 400; }

button, .boton, input, select {
  font: inherit; color: var(--texto); background: var(--tarjeta2); border: 1px solid var(--linea);
  border-radius: 8px; padding: .45rem .8rem; min-height: 36px;
}
button, .boton { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
button:hover:not(:disabled), .boton:hover { border-color: var(--morado); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primario { background: var(--morado2); border-color: var(--morado2); color: #fff; }
.primario:hover:not(:disabled) { background: var(--morado); }
.peligro { color: var(--rojo); }
.peligro:hover:not(:disabled) { border-color: var(--rojo); }
.chico { min-height: 30px; padding: .25rem .6rem; font-size: .85rem; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--morado); outline-offset: 1px; }

.vista { min-height: 100dvh; }
.centro { display: grid; place-items: center; padding: 16px; }
.tarjeta { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--radio); padding: 14px 16px; min-width: 0; }
.login { width: min(360px, 100%); display: flex; flex-direction: column; gap: .7rem; text-align: center; }
.login label, .formulario label { display: flex; flex-direction: column; gap: .25rem; text-align: left; color: var(--tenue); font-size: .85rem; }
.logo-grande { width: 56px; height: 56px; margin: 0 auto; }

/* Barra de arriba */
.barra { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--linea); background: #12141a; position: sticky; top: 0; z-index: 5; }
.marca { display: flex; align-items: center; gap: .4rem; font-weight: 700; white-space: nowrap; }
.marca img { width: 22px; height: 22px; }
.pestanas { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: thin; }
.pestanas button { background: none; border-color: transparent; white-space: nowrap; }
.pestanas button.activa { background: var(--tarjeta2); border-color: var(--linea); }
.punto { width: 9px; height: 9px; border-radius: 50%; background: var(--tenue); display: inline-block; flex: none; }
.punto.despierto { background: var(--verde); box-shadow: 0 0 6px var(--verde); }
.punto.arrancando { background: var(--amarillo); }
.yo { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--radio); padding: 6px; display: flex; flex-direction: column; min-width: 210px; z-index: 10; box-shadow: 0 8px 30px #0008; }
.menu button { background: none; border: none; justify-content: flex-start; }
.menu button:hover { background: var(--tarjeta2); }
body:not(.dueno) .solo-dueno, body.dueno .no-dueno { display: none; }

/* Servidor */
.rejilla { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 14px; padding: 14px 16px; align-items: start; }
.columna { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.grande { min-height: 70dvh; display: flex; flex-direction: column; }
.pagina { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; max-width: 1100px; margin: 0 auto; }

.estado { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: 99px; font-size: .8rem; background: var(--tarjeta2); border: 1px solid var(--linea); }
.estado.despierto { color: var(--verde); border-color: #3ddc8455; }
.estado.arrancando { color: var(--amarillo); border-color: #f5c54255; }
.icono-servidor { width: 48px; height: 48px; border-radius: 8px; image-rendering: pixelated; margin-left: auto; flex: none; }
.datos { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: .7rem 0; font-size: .9rem; }
.datos dt { color: var(--tenue); }
.datos dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.barrita { height: 6px; border-radius: 3px; background: var(--tarjeta2); overflow: hidden; margin-top: 3px; }
.barrita > i { display: block; height: 100%; background: var(--verde); }
.controles { display: flex; gap: 6px; flex-wrap: wrap; margin-top: .4rem; }
.controles button { flex: 1; }
.enlaces { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .7rem; font-size: .85rem; }
.tps-bien { color: var(--verde); } .tps-medio { color: var(--amarillo); } .tps-mal { color: var(--rojo); }

/* Tablas */
.tabla-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { text-align: left; color: var(--tenue); font-weight: 500; padding: .35rem .4rem; border-bottom: 1px solid var(--linea); white-space: nowrap; }
td { padding: .35rem .4rem; border-bottom: 1px solid #ffffff08; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.clic { cursor: pointer; } tr.clic:hover td { background: var(--tarjeta2); }
.cabeza { width: 22px; height: 22px; border-radius: 4px; vertical-align: middle; margin-right: .4rem; image-rendering: pixelated; background: var(--tarjeta2); }
.vacio { color: var(--tenue); text-align: center; padding: 1.2rem; }

/* Pestañas de la derecha */
.sub-pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--linea); margin: -4px -6px 10px; padding: 0 0 8px; overflow-x: auto; }
.sub-pestanas button { background: none; border-color: transparent; white-space: nowrap; }
.sub-pestanas button.activa { background: var(--tarjeta2); border-color: var(--linea); }
[data-panel] { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 8px; }
.filtros { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8rem; color: var(--tenue); }
.filtros label { display: flex; align-items: center; gap: .25rem; cursor: pointer; }
.eventos { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; max-height: 62dvh; font-size: .88rem; }
.eventos li { display: grid; grid-template-columns: 1.5rem 1fr auto; gap: .5rem; padding: .3rem .2rem; border-bottom: 1px solid #ffffff08; align-items: baseline; }
.eventos li.vacio { display: block; text-align: center; color: var(--tenue); padding: 1.5rem; border: 0; }
.eventos .hora { color: var(--tenue); font-size: .75rem; white-space: nowrap; }
.eventos .quien { font-weight: 600; }
.ev-entra .quien { color: var(--verde); } .ev-sale .quien { color: var(--tenue); } .ev-muere .quien { color: var(--rojo); }
.ev-logro .quien { color: var(--amarillo); } .ev-viaja .quien { color: var(--azul); }
.linea { display: flex; gap: 6px; flex-wrap: wrap; }
.linea input { flex: 1 1 12rem; min-width: 0; }
.consola { flex: 1; margin: 0; background: #0b0d11; border: 1px solid var(--linea); border-radius: 8px; padding: 8px 10px; overflow: auto; max-height: 62dvh; min-height: 300px; font: 12px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; }
.consola .w { color: var(--amarillo); } .consola .e { color: var(--rojo); }
.acceso { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lista { list-style: none; margin: .4rem 0 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid #ffffff08; }
.lista li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.etiqueta { font-size: .7rem; padding: .05rem .45rem; border-radius: 99px; background: var(--tarjeta2); color: var(--tenue); border: 1px solid var(--linea); }
.mapa { width: 100%; flex: 1; min-height: 60dvh; border: 1px solid var(--linea); border-radius: 8px; background: #000; }

/* Usuarios */
.formulario { display: flex; flex-direction: column; gap: .7rem; }
.permisos { display: grid; gap: .5rem; }
.permisos .fila { display: grid; grid-template-columns: 8rem 1fr; align-items: center; gap: .6rem; }
.permisos .marcas { display: flex; flex-wrap: wrap; gap: .2rem .7rem; font-size: .8rem; color: var(--tenue); }
.permisos .marcas label { flex-direction: row; align-items: center; gap: .2rem; color: var(--texto); }

.dialogo { background: var(--tarjeta); color: var(--texto); border: 1px solid var(--linea); border-radius: var(--radio); width: min(440px, calc(100% - 32px)); padding: 16px; }
.dialogo::backdrop { background: #000a; }
.dialogo h3 { color: var(--texto); font-size: 1.05rem; margin-top: 0; display: flex; align-items: center; }
.acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.aviso { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--tarjeta2); border: 1px solid var(--linea); padding: .6rem 1rem; border-radius: 8px; z-index: 20; box-shadow: 0 8px 30px #0008; max-width: calc(100% - 32px); }
.aviso.mal { border-color: var(--rojo); color: var(--rojo); }

@media (max-width: 900px) {
  .rejilla { grid-template-columns: 1fr; padding: 10px; }
  .acceso { grid-template-columns: 1fr; }
  .marca span, .marca { font-size: 0; } .marca img { width: 24px; height: 24px; }
  .grande { min-height: 0; }
  .barra { padding: 8px 10px; }
}

/* Fase 2: jugadores, perfil, inventario, clasificación y gráficas */
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chips button { min-height: 28px; padding: .15rem .6rem; font-size: .8rem; border-radius: 99px; }
.chips button.activa { background: var(--morado2); border-color: var(--morado2); color: #fff; }
.jugadores { display: grid; grid-template-columns: 260px 1fr; gap: 14px; flex: 1; min-height: 0; }
.lista-jugadores { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.lista-jugadores .lista { overflow-y: auto; max-height: 60dvh; margin: 0; }
.lista.clicable li { cursor: pointer; padding: .35rem .3rem; border-radius: 6px; }
.lista.clicable li:hover, .lista.clicable li.activo { background: var(--tarjeta2); }
.lista .mini { font-size: .72rem; color: var(--tenue); display: block; }
.punto-mini { width: 7px; height: 7px; border-radius: 50%; background: var(--verde); display: inline-block; margin-left: .3rem; }
.perfil { min-width: 0; overflow-y: auto; max-height: 66dvh; }
.cabecera-perfil { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.cabecera-perfil .cuerpo { width: 64px; height: 128px; object-fit: contain; image-rendering: pixelated; flex: none; background: var(--tarjeta2); border-radius: 8px; }
.cabecera-perfil h3 { font-size: 1.15rem; color: var(--texto); margin: 0 0 .3rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.etiqueta.verde { color: var(--verde); border-color: #3ddc8455; } .etiqueta.rojo { color: var(--rojo); border-color: #ff5c7a55; }
.etiqueta.amarillo { color: var(--amarillo); border-color: #f5c54255; } .etiqueta.morado { color: var(--morado); border-color: #8b7bff55; }
.records { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.record { background: var(--tarjeta2); border: 1px solid var(--linea); border-radius: 8px; padding: .55rem .7rem; }
.record b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.record span { font-size: .75rem; color: var(--tenue); }
.record.oro { border-color: #f5c54266; } .record.oro b { color: var(--amarillo); }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.top li { gap: .45rem; } .top .n { color: var(--tenue); font-variant-numeric: tabular-nums; }
.icono-obj { width: 22px; height: 22px; image-rendering: pixelated; flex: none; }
.inv { display: grid; grid-template-columns: repeat(9, minmax(0, 44px)); gap: 3px; margin: .3rem 0 .8rem; }
.inv.armadura { grid-template-columns: repeat(5, minmax(0, 44px)); }
.ranura { aspect-ratio: 1; background: #0b0d11; border: 1px solid var(--linea); border-radius: 4px; position: relative; display: grid; place-items: center; cursor: default; overflow: hidden; }
.ranura img { width: 70%; height: 70%; image-rendering: pixelated; }
.ranura .abrev { font-size: .6rem; color: var(--tenue); text-align: center; line-height: 1.05; padding: 2px; word-break: break-all; }
.ranura .num { position: absolute; right: 3px; bottom: 1px; font-size: .72rem; font-weight: 700; text-shadow: 1px 1px 0 #000; }
.ranura.encantado { box-shadow: inset 0 0 8px #b07bff99; border-color: #8b7bff88; }
.ranura .desgaste { position: absolute; left: 3px; right: 3px; bottom: 2px; height: 2px; background: #000; }
.ranura .desgaste i { display: block; height: 100%; background: var(--verde); }
.ranura.vacia { opacity: .5; }
.detalle-obj { background: var(--tarjeta2); border: 1px solid var(--linea); border-radius: 8px; padding: .5rem .7rem; font-size: .85rem; min-height: 2.6rem; }
.progreso { height: 8px; background: var(--tarjeta2); border-radius: 4px; overflow: hidden; margin: .3rem 0 .8rem; }
.progreso i { display: block; height: 100%; background: linear-gradient(90deg, var(--morado2), var(--azul)); }
th.ordenable { cursor: pointer; user-select: none; } th.ordenable:hover { color: var(--texto); } th.orden { color: var(--morado); }
.graficas { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 10px; }
.grafica { background: var(--tarjeta2); border: 1px solid var(--linea); border-radius: 8px; padding: .6rem .8rem; }
.grafica h3 { margin: 0 0 .3rem; color: var(--texto); font-size: .85rem; display: flex; justify-content: space-between; }
.grafica h3 span { color: var(--tenue); font-weight: 400; }
.grafica svg { width: 100%; height: 140px; display: block; }
.grafica .eje { font-size: 10px; fill: var(--tenue); }
@media (max-width: 900px) { .jugadores, .dos { grid-template-columns: 1fr; } .lista-jugadores .lista { max-height: 30dvh; } .perfil { max-height: none; } }
