* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05080f; color: #cfe8ff; font: 13px/1.35 "JetBrains Mono", ui-monospace, monospace; user-select: none; }
#c, #o { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
#o { pointer-events: none; }
.hide { display: none !important; }
.dim { color: #5f86ad; }
.green { color: #5dfc8a !important; }
.gold { color: #ffd166 !important; }

button { font: inherit; color: #05080f; background: #4de3ff; border: 0; border-radius: 4px; padding: 6px 12px; cursor: pointer; }
button:hover:not(:disabled) { background: #fff; }
button:disabled { opacity: .35; cursor: not-allowed; }
button.alt { background: transparent; color: #4de3ff; border: 1px solid #1d3a5c; }
button.alt:hover:not(:disabled) { background: #0e1b2e; }
button.danger { background: transparent; color: #ff4d6d; border: 1px solid #5c1d2c; }
button.danger:hover:not(:disabled) { background: #2a0a14; }
button.on { background: #5dfc8a; }
input { font: inherit; color: #fff; background: #0a1322; border: 1px solid #1d3a5c; border-radius: 4px; padding: 7px 9px; min-width: 0; }
input:focus { outline: 1px solid #4de3ff; }

/* ---------- HUD de partida ---------- */
#top { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 18px; padding: 8px 16px; background: rgba(8, 16, 30, .85); border: 1px solid #1d3a5c; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.stat { display: flex; align-items: center; gap: 8px; }
.lbl { color: #5f86ad; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.stat b { color: #4de3ff; font-size: 15px; }
.bar { width: 110px; height: 8px; background: #0e1b2e; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: #4de3ff; transition: width .15s; }
.bar i.red { background: #ff4d6d; }

#banner { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); padding: 8px 18px; background: rgba(40, 10, 20, .9); border: 1px solid #ff4d6d; color: #ffd0d8; border-radius: 6px; opacity: 0; transition: opacity .4s; pointer-events: none; max-width: 80vw; text-align: center; }
#banner.on { opacity: 1; }

#squad { position: fixed; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap-reverse; gap: 8px; max-width: calc(100vw - 290px); max-height: 46vh; overflow-y: auto; }
.card { width: 168px; padding: 8px; background: rgba(8, 16, 30, .9); border: 1px solid #1d3a5c; border-radius: 6px; cursor: pointer; }
.card.sel { border-color: #4de3ff; box-shadow: 0 0 10px rgba(77, 227, 255, .35); }
.card.dead { opacity: .6; border-color: #5c1d2c; }
.card .row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.card .key { color: #05080f; background: #5f86ad; border-radius: 3px; padding: 0 5px; font-weight: bold; }
.card .cname { flex: 1; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .lvl { color: #ffd166; }
.card .bar { width: 100%; height: 6px; margin-bottom: 4px; }
.card .bar.hp i { background: #5dfc8a; }
.card .bar.xp i { background: #ffd166; }
.card .status { color: #5f86ad; font-size: 11px; min-height: 14px; }
.card.dead .status { color: #ff4d6d; }
.card .evo { display: flex; flex-direction: column; gap: 4px; }
.card .evo:not(:empty) { margin-top: 6px; }
.card .evo button { font-size: 12px; background: #ffd166; padding: 4px 6px; text-align: left; animation: pulse 1.2s infinite; }
.card .evo button small { display: block; opacity: .75; font-size: 10px; }
@keyframes pulse { 50% { box-shadow: 0 0 10px #ffd166; } }

#actions { position: fixed; right: 10px; bottom: 170px; width: 230px; padding: 10px; background: rgba(8, 16, 30, .9); border: 1px solid #1d3a5c; border-radius: 6px; }
#actions h3 { margin: 0 0 6px; font-size: 11px; color: #5f86ad; text-transform: uppercase; letter-spacing: .08em; font-weight: normal; }
#actions h3:not(:first-child) { margin-top: 10px; }
#actions .btns { display: flex; flex-wrap: wrap; gap: 5px; }
#actions button { font-size: 12px; padding: 5px 8px; }
#actions button small { opacity: .7; }

/* ayuda de teclas: plegada al entrar (solo el botón); F1 o clic la despliega */
#help { position: fixed; top: 10px; left: 10px; z-index: 4; color: #8fb0cf; font-size: 11px; background: rgba(8, 16, 30, .92); border: 1px solid #1d3a5c; border-radius: 6px; }
#help-btn { display: block; width: 100%; padding: 6px 10px; border: 0; background: none; color: #cfe8ff; font: 600 11px/1 ui-monospace, monospace; text-align: left; cursor: pointer; }
#help-btn:hover { background: #12233a; }
#help-btn b { display: inline-block; width: 15px; height: 15px; line-height: 15px; margin-right: 4px; text-align: center; color: #05080f; background: #4de3ff; border-radius: 50%; }
#help-btn small { margin-left: 8px; color: #5f86ad; font-weight: 400; }
#help.closed #help-body { display: none; }
#help-body { width: 390px; max-height: calc(100vh - 290px); overflow-y: auto; padding: 0 10px 8px; border-top: 1px solid #1d3a5c; }
#help h4 { margin: 10px 0 4px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #ffd166; }
#help p { margin: 0 0 4px; color: #6f8fae; }
#help dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; margin: 0; align-items: baseline; }
#help dt { color: #cfe8ff; white-space: nowrap; }
#help dd { margin: 0; }
#help kbd { display: inline-block; padding: 1px 4px; font: 600 10px/1.3 ui-monospace, monospace; color: #cfe8ff; background: #12233a; border: 1px solid #2a4a6e; border-radius: 3px; }

/* ---------- menús ---------- */
#menu { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 30%, #0c1a30, #05080f 70%); overflow: auto; padding: 20px; user-select: text; }
#menu.hide { display: none; }
#menu.over { background: rgba(5, 8, 15, .78); }
.panel { background: rgba(8, 16, 30, .92); border: 1px solid #1d3a5c; border-radius: 8px; padding: 20px; }
.panel.narrow { width: 400px; max-width: 100%; }
h1 { margin: 0 0 4px; color: #4de3ff; font-size: 24px; letter-spacing: .04em; }
h2 { margin: 0 0 12px; color: #9fc4e8; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; font-weight: normal; }
.row { display: flex; gap: 8px; align-items: center; }
form label { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; color: #5f86ad; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
form .row { margin-top: 16px; }
form .row > * { flex: 1; }

#lobby { width: 1100px; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 14px; }
#lobby-head { display: flex; align-items: center; gap: 18px; padding: 12px 20px; background: rgba(8, 16, 30, .92); border: 1px solid #1d3a5c; border-radius: 8px; }
#lobby-head .who { color: #fff; font-size: 16px; flex: 1; }
#lobby-head b { color: #ffd166; font-size: 16px; }
.cols { display: flex; gap: 14px; align-items: flex-start; min-height: 0; }
.cols > .panel { flex: 1; min-width: 0; max-height: calc(100vh - 130px); overflow: auto; }
.cols > .panel.wide { flex: 2; }
.roomrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #12233a; }
.roomrow .rn { flex: 1; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rooms { margin-bottom: 14px; }
#createform input { flex: 1; }

.crea { border: 1px solid #1d3a5c; border-radius: 6px; padding: 12px; margin-bottom: 10px; }
.crea .head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.crea .head .n { color: #fff; font-size: 15px; flex: 1; }
.crea .head .l { color: #ffd166; }
.crea .stats { color: #9fc4e8; font-size: 12px; margin-bottom: 10px; }
.crea h4 { margin: 10px 0 5px; font-size: 11px; color: #5f86ad; text-transform: uppercase; letter-spacing: .08em; font-weight: normal; }
.crea .genes, .crea .imps { display: flex; flex-wrap: wrap; gap: 6px; }
.crea button { font-size: 12px; padding: 4px 8px; }
.crea .slot { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; flex-wrap: wrap; }
.crea .slot > span { width: 58px; color: #5f86ad; font-size: 11px; text-transform: uppercase; }
.crea .foot { margin-top: 10px; text-align: right; }

#room .players, #end .keep { margin: 14px 0; }
#room .players div { padding: 7px 0; border-bottom: 1px solid #12233a; color: #fff; }
#end h1.win { color: #5dfc8a; }
#end h1.lose { color: #ff4d6d; }
#end .reward { color: #ffd166; font-size: 16px; margin: 8px 0 14px; }
#end .score { margin: 12px 0 6px; padding: 10px 14px; border: 1px solid #1d3a5c; border-radius: 6px; background: rgba(8, 16, 30, .6); cursor: pointer; }
#end .score h2 { margin: 0 0 6px; font-size: 12px; color: #5f86ad; text-transform: uppercase; letter-spacing: .08em; font-weight: normal; }
#end .score .row { display: flex; gap: 12px; padding: 3px 0; border-bottom: 1px solid #12233a; font-size: 13px; opacity: 0; transform: translateX(-8px); transition: opacity .18s, transform .18s; }
#end .score .row.on { opacity: 1; transform: none; }
#end .score .row.zero.on { opacity: .4; }
#end .score .row .lbl { flex: 1; color: #cfe8ff; }
#end .score .row .cnt { color: #5f86ad; font-size: 12px; }
#end .score .row .pts { min-width: 64px; text-align: right; color: #ffd166; font-variant-numeric: tabular-nums; }
#end .score .row.total { border-bottom: 0; margin-top: 4px; font-size: 15px; opacity: 1; transform: none; }
#end .score .row.total b { min-width: 64px; text-align: right; color: #fff; font-variant-numeric: tabular-nums; }
#end .score .bonus { display: block; margin-top: 4px; color: #5dfc8a; font-size: 13px; min-height: 18px; }
#end .reward.done { color: #5dfc8a; }
#end .keep label { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 9px 18px; background: #2a0a14; border: 1px solid #ff4d6d; color: #ffd0d8; border-radius: 6px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 5; }
#toast.on { opacity: 1; }
#conn { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5, 8, 15, .88); font-size: 18px; color: #4de3ff; z-index: 6; }
* { scrollbar-width: thin; scrollbar-color: #1d3a5c transparent; }
.orange { color: #ff9e64 !important; }
.selname { color: #fff; font-size: 14px; margin-bottom: 2px; }
#actions .ups { display: flex; flex-direction: column; gap: 5px; }
#actions .ups button { text-align: left; }
#actions .ups button span { display: block; font-size: 10px; opacity: .75; }
#actions p { margin: 6px 0 0; font-size: 11px; }
#actions p.warn { color: #ffb07a; }
#actions { width: 250px; max-height: calc(100vh - 260px); overflow: auto; }
#mute { position: fixed; top: 10px; right: 10px; font-size: 11px; padding: 5px 9px; background: rgba(8, 16, 30, .85); z-index: 4; }

/* ---------- barra inferior ---------- */
#bar { position: fixed; left: 0; right: 0; bottom: 0; height: 196px; display: flex; gap: 10px; padding: 10px; background: rgba(6, 12, 24, .94); border-top: 1px solid #1d3a5c; z-index: 3; }
#bar > div { border: 1px solid #16304d; border-radius: 6px; background: rgba(8, 16, 30, .6); min-width: 0; }
#bar-mini { flex: 0 0 248px; padding: 0; overflow: hidden; }
#mini { position: static; inset: auto; width: 100%; height: 100%; display: block; cursor: pointer; }
#tools { flex: 0 0 60px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#roster .empty { margin: auto; font-size: 11px; text-align: center; }
#tools .ib.pulse { color: #ffd166; border-color: #ffd166; animation: pulse 1.6s infinite; }
#roster { flex: 0 0 236px; padding: 6px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; overflow-y: auto; }
.tile { position: relative; width: 70px; height: 50px; padding: 4px 5px; border: 1px solid #1d3a5c; border-radius: 5px; background: #0a1322; cursor: pointer; overflow: hidden; }
.tile:hover { border-color: #5f86ad; }
.tile.sel { border-color: #4de3ff; box-shadow: 0 0 8px rgba(77, 227, 255, .4); }
.tile.dead { opacity: .5; border-color: #5c1d2c; }
.tile .k { position: absolute; top: 2px; right: 4px; font-size: 10px; color: #5f86ad; }
.tile .n { display: block; font-size: 10px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; }
.tile .l { font-size: 11px; color: #ffd166; }
.tile .evo { position: absolute; bottom: 9px; right: 4px; color: #ffd166; font-size: 11px; animation: pulse 1.2s infinite; }
.tile .hp { position: absolute; left: 0; bottom: 0; height: 5px; background: #5dfc8a; }
#info { flex: 1; padding: 8px 12px; overflow-y: auto; }
#info .head { display: flex; align-items: baseline; gap: 10px; }
#info .head .n { color: #fff; font-size: 16px; }
#info .head .l { color: #ffd166; }
#info .bars { display: flex; gap: 12px; margin: 6px 0 8px; }
#info .bars > div { flex: 1; }
#info .bars .bar { width: 100%; height: 8px; }
#info .bars .bar.hp i { background: #5dfc8a; }
#info .bars .bar.xp i { background: #ffd166; }
#info .bars small { display: block; color: #9fc4e8; font-size: 11px; margin-top: 2px; }
#info .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 3px 12px; }
#info .stats div { display: flex; justify-content: space-between; border-bottom: 1px solid #12233a; font-size: 12px; padding: 1px 0; }
#info .stats span { color: #5f86ad; }
#info .stats b { color: #cfe8ff; font-weight: normal; }
#info .stats b.up { color: #5dfc8a; }
#info .extra { margin-top: 6px; font-size: 11px; color: #9fc4e8; }
#info .extra span { color: #5f86ad; }
#info .evo { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
#info .evo button { background: #ffd166; font-size: 12px; padding: 4px 9px; text-align: left; animation: pulse 1.2s infinite; }
#info .evo button small { display: block; font-size: 10px; opacity: .75; }
#info p { margin: 4px 0; }
#actions { position: static; flex: 0 0 300px; width: auto; max-height: none; padding: 8px 10px; overflow-y: auto; }
#toast { bottom: 216px; }

/* ---------- botones con ícono y tooltip (barra de la partida) ---------- */
.ib { position: relative; width: 46px; height: 46px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: #0c1a2e; color: #7fe9ff; border: 1px solid #24486f; border-radius: 6px; cursor: pointer; flex: 0 0 auto; }
#actions .ib, #info .evo .ib { padding: 0; font-size: 10px; text-align: center; animation: none; }
.ib svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.ib svg .f { fill: currentColor; stroke: none; }
button.ib:hover:not(:disabled) { background: #14304f; color: #fff; border-color: #4de3ff; }
button.ib.on, button.ib.on:hover:not(:disabled) { background: #123a26; color: #5dfc8a; border-color: #5dfc8a; }
.ib.off { opacity: .38; cursor: not-allowed; }
button.ib.off:hover:not(:disabled) { background: #0c1a2e; color: #7fe9ff; border-color: #24486f; }
#info .evo button.ib, #info .evo button.ib:hover:not(:disabled) { background: #1c1606; color: #ffd166; border-color: #ffd166; animation: pulse 1.2s infinite; }
#info .evo button.ib:hover:not(:disabled) { background: #3a2c08; color: #fff; }
.ib span { position: absolute; font: 600 9px/1 ui-monospace, monospace; padding: 2px 3px; border-radius: 3px; pointer-events: none; }
.ib .key { top: 2px; left: 2px; color: #9db8d3; background: rgba(5, 8, 15, .7); }
.ib .cost { bottom: 2px; right: 2px; background: rgba(5, 8, 15, .85); }
.ib .cost.bio { color: #5dfc8a; }
.ib .cost.scrap { color: #ffa94d; }
.ib .badge { top: 2px; right: 2px; color: #05080f; background: #ffd166; }
.ib.on .badge { background: #5dfc8a; }
#actions .btns { gap: 6px; align-items: center; }
#actions .btns .sep { width: 1px; height: 30px; background: #1d3a5c; margin: 0 3px; }
#info .evo { align-items: center; }
#info .evo .evo-lbl { color: #ffd166; font-size: 11px; }
#tip { position: fixed; z-index: 50; max-width: 250px; padding: 8px 10px; background: rgba(5, 10, 20, .97); border: 1px solid #4de3ff; border-radius: 6px;
  font-size: 12px; line-height: 1.35; color: #cfe3f5; pointer-events: none; opacity: 0; transition: opacity .08s; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
#tip.show { opacity: 1; }
#tip .t { color: #fff; font-weight: 600; font-size: 13px; margin-bottom: 2px; }
#tip .c { margin-top: 4px; font-weight: 600; }
#tip .c.bio { color: #5dfc8a; }
#tip .c.scrap { color: #ffa94d; }
#tip .n { margin-top: 4px; color: #8fa9c4; font-size: 11px; }
#tip .k { margin-top: 4px; color: #ffd166; font-size: 11px; }
#info .evo button.ib { width: 38px; height: 38px; }
#info .evo button.ib svg { width: 24px; height: 24px; }

/* elección de rival en la sala */
.rivals { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; }
.rivals button { text-align: left; padding: 8px 10px; }
.rivals button b { display: block; }
.rivals button small { display: block; font-size: 11px; opacity: .8; margin-top: 2px; }
.rivals button .prize { color: #ffd166; opacity: 1; }
.rivals button.on .prize { color: #05080f; }

/* ---------- árbol de la criatura (criobanco) ---------- */
.tree { overflow-x: auto; padding: 6px 2px 4px; }
.tn { display: flex; align-items: center; }
.tk { display: flex; flex-direction: column; gap: 8px; margin-left: 22px; position: relative; }
.tk.row { flex-direction: row; gap: 6px; }
.tb { position: relative; display: flex; align-items: center; }
/* rama: línea desde el tronco hasta el nodo */
.tk:not(.row) > .tb::before { content: ''; position: absolute; left: -11px; top: 50%; width: 11px; border-top: 1px solid #2d5a88; }
/* tronco: línea vertical que une las ramas hermanas, y el tramo que viene del padre */
.tk:not(.row) > .tb::after { content: ''; position: absolute; left: -11px; top: -4px; bottom: -4px; border-left: 1px solid #2d5a88; }
.tk:not(.row) > .tb:first-child::after { top: 50%; }
.tk:not(.row) > .tb:last-child::after { bottom: 50%; }
.tk:not(.row) > .tb:only-child::after { display: none; }
.tk::after { content: ''; position: absolute; left: -22px; top: 50%; width: 11px; border-top: 1px solid #2d5a88; }
.tk.row::after { width: 22px; }
.tree .chip { display: inline-flex; flex-direction: column; justify-content: center; min-width: 74px; height: 34px; padding: 0 9px; border: 1px solid #24486f; border-radius: 5px; background: #0a1626;
  color: #9db8d3; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.tree .chip small { color: #5f86ad; font-size: 9px; text-transform: none; letter-spacing: 0; }
.crea .tree button.ib { width: 46px; height: 46px; padding: 0; }
.crea .tree button.ib.root { width: 58px; height: 58px; border-color: #4de3ff; color: #fff; }
.crea .tree button.ib.root svg { width: 36px; height: 36px; }
.crea .tree button.ib.past { color: #5dfc8a; border-color: #2f7d4c; }
.crea .tree button.ib.ghost { opacity: .55; border-style: dashed; cursor: default; }
.crea .tree button.ib.ghost.dead { opacity: .22; }
.crea .tree button.ib.has { border-color: #7fe9ff; }
.ib .cost.adn { color: #c9a2ff; }
#tip .c.adn { color: #c9a2ff; }

.tree .chip { max-width: 150px; height: auto; min-height: 34px; padding: 4px 9px; }
.tree .chip small { white-space: normal; line-height: 1.2; }

/* stamina y nombre propio en el criobanco */
.crea .stam { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; font-size: 11px; color: #9db8d3; }
.crea .stam .bar { width: 140px; height: 7px; }
.crea .stam small { color: #5f86ad; }
.crea .head .n button.ib.mini { width: 24px; height: 24px; vertical-align: middle; border-color: #24486f; }
.crea .head .n button.ib.mini svg { width: 15px; height: 15px; }
.crea .head .n input.nick { width: 170px; padding: 3px 6px; font: inherit; font-size: 13px; color: #fff; background: #0a1626; border: 1px solid #4de3ff; border-radius: 4px; margin-right: 6px; }

/* ---------- criobanco: miniaturas y ficha ---------- */
.minis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mini { width: 104px; padding: 6px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #0a1626; color: #cfe3f5; border: 1px solid #1d3a5c; border-radius: 8px; cursor: pointer; font: inherit; }
button.mini:hover:not(:disabled) { background: #10243c; border-color: #4de3ff; }
button.mini.on, button.mini.on:hover:not(:disabled) { background: #10304a; border-color: #4de3ff; box-shadow: 0 0 12px rgba(77, 227, 255, .35); }
.mini img, .mini .pic { width: 88px; height: 88px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: radial-gradient(circle at 50% 70%, #17334f, #081220 75%); }
.mini .pic svg { width: 46px; height: 46px; fill: none; stroke: #7fe9ff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mini b { font-size: 12px; font-weight: 600; color: #fff; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini small { font-size: 10px; color: #ffd166; }
.mini .st { display: block; width: 84px; height: 4px; border-radius: 2px; background: #0e1b2e; overflow: hidden; margin-top: 2px; }
.mini .st u { display: block; height: 100%; }
.mini .st.fix { background: transparent; }
.mini.empty { cursor: default; border-style: dashed; opacity: .55; }
.mini.empty .pic { font-size: 30px; color: #2d5a88; background: none; }
.mini.empty b { color: #5f86ad; font-weight: normal; }
.mini.empty small { color: #5f86ad; }
#bank .hint { padding: 26px 10px; text-align: center; }
.crea .top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 6px; }
.crea .view { flex: 0 0 300px; height: 280px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid #1d3a5c; background: radial-gradient(circle at 50% 78%, #1a3a58, #070f1c 72%); overflow: hidden; }
.crea .view > svg { width: 120px; height: 120px; fill: none; stroke: #7fe9ff; stroke-width: 1.2; }
.crea .data { flex: 1; min-width: 0; }
.crea .stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.crea .stats span { padding: 3px 8px; border: 1px solid #1d3a5c; border-radius: 4px; background: #0a1626; color: #cfe3f5; font-size: 12px; }
.crea .foot { text-align: left; }

.rivals.maps { flex-direction: row; }
.rivals.maps button { flex: 1; }

/* grupos de control: fichas sobre la barra, arriba de las unidades seleccionadas */
#groups { position: fixed; z-index: 3; display: flex; gap: 5px; }
#groups:empty { display: none; }
.grp { display: flex; border: 1px solid #1d3a5c; border-radius: 5px; background: rgba(6, 12, 24, .94); overflow: hidden; }
.grp.on { border-color: #4de3ff; box-shadow: 0 0 8px rgba(77, 227, 255, .4); }
.grp button { border: 0; background: none; color: #cfe3f7; cursor: pointer; font: 600 11px/1 ui-monospace, monospace; padding: 6px 7px; }
.grp .g-sel b { color: #ffd166; font-size: 13px; margin-right: 5px; }
.grp .g-sel { display: flex; align-items: center; gap: 3px; padding: 3px 7px; }
.grp .who { display: inline-flex; align-items: flex-end; }
.grp .who .pic { width: 34px; height: 34px; display: block; }
/* la foto trae mucho aire alrededor: se agranda y se recorta para que la criatura llene la ficha */
.grp .who img { width: 40px; height: 40px; display: block; object-fit: cover; object-position: 50% 62%; transform: scale(1.7); transform-origin: 50% 62%; clip-path: inset(21% 21% 20% 21%); margin: -3px -6px; }
.grp .who .pic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; }
.grp .who small { margin-left: -6px; color: #cfe3f7; font-size: 10px; text-shadow: 0 0 3px #05080f, 0 0 3px #05080f; }
.grp .more { color: #7d93ab; }
.grp .g-sel:hover { background: #12233a; }
.grp .g-del { color: #7d93ab; border-left: 1px solid #1d3a5c; padding: 6px 6px; font-size: 13px; }
.grp .g-del:hover { color: #ff4d6d; background: #2a1420; }

/* cola de producción en la ficha del edificio: una ficha por pedido, con foto a la izquierda, nombre y avance.
   Van acostadas para entrar en el alto de la ficha sin que haya que desplazarla. */
.qrow { display: flex; flex-wrap: wrap; gap: 5px; }
.qi { position: relative; display: grid; grid-template-columns: 34px auto; grid-template-rows: auto auto; column-gap: 5px; align-items: center; padding: 1px 8px 4px 2px; border: 1px solid #1d3a5c; border-radius: 5px; background: #0a1322; overflow: hidden; }
.qi.wait { opacity: .6; }
.qi .ph { grid-row: 1 / 3; display: block; width: 34px; height: 32px; overflow: hidden; }
.qi .ph img { width: 34px; height: 34px; display: block; transform: scale(1.7); transform-origin: 50% 62%; }
.qi .ph .pic svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.qi b { font-size: 10px; font-weight: 600; color: #fff; white-space: nowrap; align-self: end; }
.qi small { font-size: 10px; color: #ffd166; align-self: start; }
.qi .pg { position: absolute; left: 0; bottom: 0; height: 3px; background: #4de3ff; }

/* ---------- barra sin desplazamiento (2026-11-24): todo lo que se puede hacer, a la vista ---------- */
/* El panel de acciones es ancho y sus bloques (un título y sus botones) se acomodan en columnas. La lista de seleccionadas
   solo aparece con dos o más unidades. La ficha se compacta. Nada de esto tiene barra de desplazamiento. */
#actions { flex: 0 0 664px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 5px 14px; padding: 7px 10px; overflow: hidden; }
#actions .sec { max-width: 232px; }
#actions .sec.wide { max-width: 328px; }
#actions .sec.txt { max-width: 250px; }
#actions .sec.evos { max-width: 96px; }
#actions .sec.ord { max-width: 184px; }   /* las órdenes van en renglones de hasta cuatro */
#actions .sec.ord .btns { row-gap: 0; }       /* el salto de fila cuenta como un renglón vacío: sin esto el espacio se duplica */
#actions .sec.ord .ib { margin-bottom: 4px; }
#bar > #surr { position: absolute; left: 268px; bottom: 17px; width: 62px; border: 0; background: none; text-align: center; }
#surr button.danger { font-size: 9.5px; padding: 3px 4px; width: 54px; line-height: 1.15; }
#actions h3, #actions h3:not(:first-child) { margin: 0 0 4px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#actions h3.gold { color: #ffd166; }
#actions .ib { width: 43px; height: 43px; }
#actions .ib svg { width: 26px; height: 26px; }
#actions .btns { gap: 4px; }
#actions .btns .sep { flex-basis: 100%; width: auto; height: 0; margin: 0; background: none; }   /* el separador pasa a ser un salto de fila: un grupo por renglón */
#actions .btns.evo .ib, #actions .btns.evo .ib:hover:not(:disabled) { background: #1c1606; color: #ffd166; border-color: #ffd166; animation: pulse 1.2s infinite; }
#actions .btns.evo .ib:hover:not(:disabled) { background: #3a2c08; color: #fff; }
#actions p { margin: 4px 0 0; font-size: 10.5px; line-height: 1.3; }
#roster.solo { display: none; }
#roster.dense .tile { width: 52px; height: 38px; padding: 2px 4px; }
#roster.dense .tile .n { font-size: 9px; }
#info { overflow: hidden; padding: 7px 12px; }
#info .bars { margin: 4px 0 5px; }
#info .stats { gap: 2px 12px; }
#info .stats div { white-space: nowrap; gap: 6px; }
#info .head { white-space: nowrap; }
#info .head .dim { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#info .extra { margin-top: 4px; line-height: 1.3; }
/* con varias unidades seleccionadas, la ficha de una sola no dice mucho: su lugar lo ocupa la lista, con la vida de cada una */
#info.multi { display: none; }
#roster:not(.solo) { flex: 1; }
/* en pantallas angostas la ficha pierde el renglón de ADN e implantes (está en el criobanco) antes que obligar a bajar */
@media (max-width: 1420px) { #info .extra { display: none; } #info .stats { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 1px 10px; } }
#info .bars small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* selector de idioma (pantalla de ingreso y encabezado del lobby) */
.langs { display: inline-flex; gap: 4px; }
.langs button { padding: 3px 8px; font-size: 11px; letter-spacing: .06em; }
#auth-lang { margin-top: 14px; justify-content: center; display: flex; }

/* prueba de registro: la escena 3D del obrero y las balizas (captcha.js) */
#auth.cap { max-width: 700px; width: 700px; }
#cap-view { width: 640px; height: 400px; max-width: 100%; margin: 10px auto; border: 1px solid #24486f; border-radius: 6px; overflow: hidden; background: #0a1626; }
#cap-view canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
#cap-step { min-height: 20px; color: #ffd166; text-align: center; margin: 8px 0 12px; }
#cap-step.warn { color: #ff4d6d; }
#captcha h2 { margin-top: 0; }

/* bienvenida: portada del ingreso y primeros pasos de una cuenta nueva */
.hero { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.hero .logo { width: 62px; height: 62px; flex: none; filter: drop-shadow(0 0 10px rgba(77, 227, 255, .45)); }
.hero .hi { margin: 0 0 2px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #5f86ad; }
.hero h1 { margin: 0; font-size: 34px; letter-spacing: .14em; color: #e8f4ff; }
.hero h1 b { color: #4de3ff; font-weight: inherit; }
.pitch { margin: 10px 0 16px; padding-left: 18px; color: #9db8d4; font-size: 12.5px; line-height: 1.5; }
.pitch li { margin: 4px 0; }
.pitch li::marker { color: #ffd166; }
#welcome { border-color: #ffd166; }
#welcome h2 { margin-top: 0; color: #ffd166; }
#welcome ol { margin: 8px 0 14px; padding-left: 22px; line-height: 1.6; }
#lobby-head .brand { font-size: 15px; letter-spacing: .16em; color: #e8f4ff; font-weight: bold; }
#lobby-head .brand b { color: #4de3ff; }
