/* Pantallas de entrada de Zeofus Web: login / registro, servidores, personajes y creación.
   Estilo propio de Krosmoz (cristal oscuro + oro + destellos azules de la Fractura), pensado para PC y celular.
   Solo se animan transform y opacity (baratos para la GPU). */
#entry {
  --e-gold: #f2c46d; --e-gold2: #c8913a; --e-ink: #0b1020; --e-glass: rgba(10, 16, 32, .78); --e-glass2: rgba(16, 24, 46, .86);
  --e-line: rgba(242, 196, 109, .28); --e-line2: rgba(140, 200, 255, .18); --e-text: #eef2ff; --e-dim: #9fb0cf; --e-crys: #6fd8ff;
  --e-ok: #5fe08a; --e-bad: #ff7a6b; --e-warn: #ffc45a;
  position: fixed; inset: 0; z-index: 30; overflow: hidden; color: var(--e-text); background: #050810;
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex; flex-direction: column;
}
#entry *, #entry *::before, #entry *::after { box-sizing: border-box; }
#entry button, #entry input, #entry select { font: inherit; color: inherit; }
#entry button { cursor: pointer; }
#entry :focus-visible { outline: 2px solid var(--e-crys); outline-offset: 2px; }

/* ---------- fondo ---------- */
.e-bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 40%; z-index: 0;
  transform: scale(1.04); animation: e-drift 40s ease-in-out infinite alternate; }
@keyframes e-drift { to { transform: scale(1.09) translate(-1.2%, -.6%); } }
.e-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(4,7,16,.92) 0%, rgba(4,7,16,.72) 30%, rgba(4,7,16,.15) 60%, rgba(4,7,16,.05) 100%),
              linear-gradient(0deg, rgba(4,7,16,.85) 0%, rgba(4,7,16,0) 26%); }
#entry.wide .e-shade { background: linear-gradient(0deg, rgba(4,7,16,.94) 0%, rgba(4,7,16,.55) 45%, rgba(4,7,16,.35) 100%); }
/* esquirlas de cristal flotando (la Fractura): pocas y solo transform/opacity */
.e-shards { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.e-shards i { position: absolute; bottom: -20px; width: 6px; height: 14px; opacity: 0;
  background: linear-gradient(180deg, #e9fbff, var(--e-crys) 55%, rgba(111,216,255,0));
  clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); filter: drop-shadow(0 0 6px rgba(111,216,255,.9));
  animation: e-rise 14s linear infinite; }
.e-shards i:nth-child(1) { left: 8%; animation-delay: 0s; } .e-shards i:nth-child(2) { left: 22%; animation-delay: 3s; transform: scale(.7); }
.e-shards i:nth-child(3) { left: 41%; animation-delay: 6s; } .e-shards i:nth-child(4) { left: 57%; animation-delay: 1.5s; }
.e-shards i:nth-child(5) { left: 69%; animation-delay: 8s; } .e-shards i:nth-child(6) { left: 83%; animation-delay: 4.5s; }
.e-shards i:nth-child(7) { left: 93%; animation-delay: 10s; } .e-shards i:nth-child(8) { left: 33%; animation-delay: 11.5s; }
@keyframes e-rise { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: .9; } 85% { opacity: .5; }
  100% { transform: translateY(-105vh) rotate(220deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .e-bgimg, .e-shards i { animation: none; } .e-shards { display: none; } }

/* ---------- barra superior / inferior ---------- */
.e-top { position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 12px 20px; padding-top: max(12px, env(safe-area-inset-top)); }
.e-mark { font: 700 18px/1 "Cinzel Decorative", "Cinzel", Georgia, serif; letter-spacing: .06em; color: var(--e-gold);
  text-shadow: 0 2px 10px rgba(0,0,0,.8); opacity: 0; transition: opacity .3s; }
#entry.wide .e-mark { opacity: 1; }
.e-top .grow { flex: 1; }
.e-online { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(6,10,22,.7);
  border: 1px solid var(--e-line2); backdrop-filter: blur(6px); font-size: 13px; color: var(--e-dim); white-space: nowrap; }
.e-online b { color: var(--e-text); font-variant-numeric: tabular-nums; }
.e-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--e-ok); box-shadow: 0 0 0 0 rgba(95,224,138,.6); animation: e-pulse 2s infinite; }
.e-dot.off { background: var(--e-bad); animation: none; }
@keyframes e-pulse { 70% { box-shadow: 0 0 0 7px rgba(95,224,138,0); } 100% { box-shadow: 0 0 0 0 rgba(95,224,138,0); } }
.e-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--e-dim); }
.e-user b { color: var(--e-text); }
.e-foot { position: relative; z-index: 3; display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  padding-bottom: max(10px, env(safe-area-inset-bottom)); font-size: 12px; color: rgba(200,212,235,.55); }
.e-foot .grow { flex: 1; }
.e-link { background: none; border: 0; padding: 0; color: var(--e-dim); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.e-link:hover { color: var(--e-gold); }

/* ---------- botones y campos ---------- */
.e-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); font-weight: 600; letter-spacing: .02em;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; }
.e-btn:hover:not(:disabled) { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }
.e-btn:active:not(:disabled) { transform: translateY(1px); }
.e-btn:disabled { opacity: .5; cursor: default; }
.e-btn.gold { color: #2a1a05; border-color: #ffe0a0; text-shadow: 0 1px 0 rgba(255,255,255,.35);
  background: linear-gradient(180deg, #ffe3a3 0%, var(--e-gold) 45%, var(--e-gold2) 100%);
  box-shadow: 0 6px 20px rgba(242,196,109,.25), inset 0 1px 0 rgba(255,255,255,.6); }
.e-btn.gold:hover:not(:disabled) { background: linear-gradient(180deg, #fff0c8 0%, #ffd27f 45%, #d89c40 100%); box-shadow: 0 8px 26px rgba(242,196,109,.4); }
.e-btn.danger { color: #ffd2cc; border-color: rgba(255,122,107,.4); background: rgba(255,122,107,.08); }
.e-btn.danger:hover:not(:disabled) { background: rgba(255,122,107,.18); }
.e-btn.block { width: 100%; }
.e-btn.big { min-height: 52px; font-size: 16px; }
.e-btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: e-spin .7s linear infinite; }
@keyframes e-spin { to { transform: rotate(360deg); } }

.e-field { position: relative; margin-top: 12px; }
.e-field > label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--e-dim); }
.e-field > label small { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .8; }
.e-in { width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(160,185,230,.22); background: rgba(3,7,18,.55);
  color: var(--e-text); outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.e-in::placeholder { color: rgba(160,176,207,.5); }
.e-in:focus { border-color: var(--e-gold); box-shadow: 0 0 0 3px rgba(242,196,109,.18); background: rgba(3,7,18,.75); }
select.e-in { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--e-dim) 50%), linear-gradient(135deg, var(--e-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
select.e-in option { background: #0d1426; color: var(--e-text); }
input[type="date"].e-in { color-scheme: dark; }
.e-field.bad .e-in { border-color: var(--e-bad); box-shadow: 0 0 0 3px rgba(255,122,107,.14); }
.e-err { min-height: 0; margin-top: 4px; font-size: 12px; color: var(--e-bad); }
.e-err:empty { display: none; }
.e-hint { margin-top: 4px; font-size: 12px; color: var(--e-dim); }
.e-eye { position: absolute; right: 6px; bottom: 6px; width: 34px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--e-dim); display: grid; place-items: center; }
.e-eye:hover { color: var(--e-text); background: rgba(255,255,255,.06); }
.e-eye svg { width: 18px; height: 18px; }
.e-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.e-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--e-dim); cursor: pointer; user-select: none; }
.e-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--e-gold); flex: 0 0 auto; }
.e-msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.e-msg:empty { display: none; }
.e-msg.bad { background: rgba(255,122,107,.12); border: 1px solid rgba(255,122,107,.35); color: #ffd6d0; }
.e-msg.info { background: rgba(111,216,255,.1); border: 1px solid rgba(111,216,255,.3); color: #d6f4ff; }
.e-msg.ok { background: rgba(95,224,138,.1); border: 1px solid rgba(95,224,138,.35); color: #d4ffe2; }
.e-trap { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- pantallas ---------- */
.e-main { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; }
.e-screen { flex: 1; min-width: 0; min-height: 0; display: flex; animation: e-in .35s ease both; }
@keyframes e-in { from { opacity: 0; transform: translateY(10px); } }

/* login / registro: tarjeta de cristal a la izquierda, el arte a la derecha */
#scLogin { align-items: center; padding: 0 clamp(16px, 6vw, 96px); overflow-y: auto; }
.e-auth { width: min(440px, 100%); margin: auto 0; padding: 30px 30px 26px; border-radius: 18px; background: var(--e-glass);
  border: 1px solid var(--e-line); box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.e-logo { text-align: center; margin-bottom: 18px; }
.e-logo h1 { margin: 0; font: 700 clamp(34px, 6vw, 46px)/1 "Cinzel Decorative", "Cinzel", Georgia, serif; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff6dc 0%, #ffd98a 38%, #d89a3c 62%, #fbe3a6 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(60,30,0,.55)) drop-shadow(0 0 18px rgba(242,196,109,.25)); }
.e-logo p { margin: 8px 0 0; font: 600 11px/1 "Cinzel", Georgia, serif; letter-spacing: .32em; text-transform: uppercase; color: var(--e-crys); }
.e-logo .e-rule { display: flex; align-items: center; gap: 10px; margin: 12px auto 0; width: 70%; }
.e-logo .e-rule::before, .e-logo .e-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--e-line)); }
.e-logo .e-rule::after { background: linear-gradient(90deg, var(--e-line), transparent); }
.e-logo .e-rule i { width: 8px; height: 8px; transform: rotate(45deg); background: var(--e-crys); box-shadow: 0 0 10px var(--e-crys); }
.e-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.06); }
.e-tabs button { height: 38px; border: 0; border-radius: 9px; background: none; color: var(--e-dim); font-weight: 600; transition: background .15s, color .15s; }
.e-tabs button.on { background: linear-gradient(180deg, rgba(242,196,109,.22), rgba(242,196,109,.1)); color: var(--e-gold); box-shadow: inset 0 0 0 1px rgba(242,196,109,.35); }
.e-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.e-between .e-check { margin-top: 0; }
.e-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.e-sep { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; color: var(--e-dim); font-size: 12px; }
.e-sep::before, .e-sep::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.1); }

/* registro por pasos */
.e-steps { display: flex; align-items: center; gap: 6px; margin: 18px 0 4px; }
.e-steps .st { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 12px; color: var(--e-dim); }
.e-steps .st b { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); font-size: 12px; }
.e-steps .st span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-steps .st.on { color: var(--e-text); } .e-steps .st.on b { border-color: var(--e-gold); color: var(--e-gold); box-shadow: 0 0 0 3px rgba(242,196,109,.15); }
.e-steps .st.done b { background: var(--e-gold); color: #2a1a05; border-color: var(--e-gold); }
.e-steps .bar { flex: 0 0 14px; height: 1px; background: rgba(255,255,255,.18); }
.e-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.e-meter i { height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); transition: background .2s; }
.e-meter[data-s="1"] i:nth-child(-n+1) { background: var(--e-bad); }
.e-meter[data-s="2"] i:nth-child(-n+2) { background: var(--e-warn); }
.e-meter[data-s="3"] i:nth-child(-n+3) { background: #b8e05f; }
.e-meter[data-s="4"] i { background: var(--e-ok); }
.e-nav { display: flex; gap: 10px; margin-top: 18px; } .e-nav .e-btn { flex: 1; }
.e-done { text-align: center; padding: 10px 0 4px; }
.e-done .ico { width: 64px; height: 64px; margin: 6px auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: #2a1a05;
  background: radial-gradient(circle at 35% 30%, #fff0c8, var(--e-gold) 55%, var(--e-gold2)); box-shadow: 0 0 30px rgba(242,196,109,.45); }
.e-done h3 { margin: 0 0 6px; font: 700 20px "Cinzel", Georgia, serif; color: var(--e-gold); }
.e-done p { margin: 0 0 4px; color: var(--e-dim); }

/* ---------- servidores ---------- */
.e-wrap { width: min(1100px, 100%); margin: 0 auto; padding: 8px 20px 20px; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.e-h { margin: 6px 0 4px; font: 700 clamp(22px, 3.4vw, 30px)/1.15 "Cinzel", Georgia, serif; color: var(--e-gold); text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.e-sub { margin: 0 0 18px; color: var(--e-dim); text-shadow: 0 1px 6px rgba(0,0,0,.9); }
#scServers .e-wrap { justify-content: center; }
.e-servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 16px; overflow-y: auto; padding: 4px; }
.e-srv { position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 0 16px; padding: 16px; text-align: left; border-radius: 16px;
  background: var(--e-glass); border: 1px solid var(--e-line2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; }
.e-srv::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 160px at 0% 0%, rgba(111,216,255,.12), transparent 60%); pointer-events: none; }
.e-srv:hover:not(:disabled) { transform: translateY(-3px); border-color: rgba(242,196,109,.6); box-shadow: 0 16px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(242,196,109,.3); }
.e-srv:disabled { cursor: not-allowed; filter: saturate(.4); opacity: .75; }
.e-srv .art { grid-row: span 4; width: 112px; height: 140px; border-radius: 12px; background: rgba(0,0,0,.35) center / contain no-repeat; border: 1px solid rgba(255,255,255,.08); }
.e-srv .name { display: flex; align-items: center; gap: 8px; font: 700 22px/1.1 "Cinzel", Georgia, serif; color: var(--e-text); }
.e-srv .tag { font: 700 10px/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; padding: 4px 7px; border-radius: 6px;
  color: #2a1a05; background: linear-gradient(180deg, #ffe3a3, var(--e-gold)); }
.e-srv .desc { margin-top: 4px; font-size: 13px; color: var(--e-dim); }
.e-srv .stat { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; }
.e-srv .stat .e-dot { flex: 0 0 auto; }
.e-srv .count { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--e-text); }
.e-srv .count b { font-size: 20px; color: var(--e-gold); }
.e-srv .pop { height: 6px; margin-top: 8px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.e-srv .pop i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--e-ok), #b8e05f, var(--e-warn), var(--e-bad)); background-size: 300% 100%; transition: width .5s; }
.e-srv .foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--e-dim); }
.e-srv .foot .go { margin-left: auto; color: var(--e-gold); font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.e-srv.busy .go::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px; vertical-align: -2px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: e-spin .7s linear infinite; }

/* ---------- personajes ---------- */
#scChars .e-wrap { padding-top: 0; }
.e-chars { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; }
.e-stage { position: relative; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.e-stage canvas { width: 100%; flex: 1; min-height: 0; display: block; }
.e-ped { position: absolute; left: 50%; bottom: 92px; width: min(340px, 70%); height: 70px; transform: translateX(-50%); pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(111,216,255,.35), rgba(111,216,255,.08) 60%, transparent); filter: blur(2px); }
.e-rot { position: absolute; top: 45%; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(6,10,22,.6);
  display: grid; place-items: center; font-size: 20px; backdrop-filter: blur(6px); }
.e-rot:hover { border-color: var(--e-gold); color: var(--e-gold); }
.e-rot.l { left: 4%; } .e-rot.r { right: 4%; }
.e-cinfo { text-align: center; padding: 0 0 12px; text-shadow: 0 2px 10px rgba(0,0,0,.9); }
.e-cinfo h3 { margin: 0; font: 700 clamp(22px, 3vw, 30px)/1.1 "Cinzel", Georgia, serif; color: var(--e-text); }
.e-cinfo p { margin: 4px 0 0; color: var(--e-dim); display: flex; gap: 8px; justify-content: center; align-items: center; }
.e-cinfo img { width: 22px; height: 22px; object-fit: contain; }
.e-side { display: flex; flex-direction: column; min-height: 0; padding: 16px; border-radius: 16px; background: var(--e-glass); border: 1px solid var(--e-line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.e-side h4 { margin: 0 0 10px; font: 700 13px/1 "Cinzel", Georgia, serif; letter-spacing: .12em; text-transform: uppercase; color: var(--e-gold); display: flex; justify-content: space-between; }
.e-side h4 small { font: 400 12px system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: var(--e-dim); }
.e-slots { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.e-slot { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border-radius: 12px; text-align: left;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); transition: background .15s, border-color .15s; min-height: 68px; }
.e-slot:hover { background: rgba(255,255,255,.08); }
.e-slot.on { border-color: var(--e-gold); background: linear-gradient(90deg, rgba(242,196,109,.16), rgba(242,196,109,.04)); }
.e-slot canvas { width: 56px; height: 56px; border-radius: 10px; background: radial-gradient(circle at 50% 70%, rgba(111,216,255,.18), rgba(0,0,0,.25)); }
.e-slot .n { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-slot .c { font-size: 12px; color: var(--e-dim); }
.e-slot .lv { font: 700 13px/1 system-ui; color: var(--e-gold); background: rgba(242,196,109,.12); border: 1px solid rgba(242,196,109,.3); border-radius: 8px; padding: 5px 7px; }
.e-slot.dead .n::after { content: " ✝"; color: var(--e-bad); }
.e-slot.new { grid-template-columns: 56px 1fr; border-style: dashed; border-color: rgba(242,196,109,.4); color: var(--e-gold); }
.e-slot.new .plus { width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; font-size: 28px; background: rgba(242,196,109,.08); }
.e-side .e-actions { margin-top: 12px; }
.e-side .e-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.e-empty { padding: 30px 10px; text-align: center; color: var(--e-dim); }

/* ---------- crear personaje ---------- */
.e-create { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr) 330px; gap: 18px; }
.e-classes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-content: start; overflow-y: auto; padding: 14px; border-radius: 16px;
  background: var(--e-glass); border: 1px solid var(--e-line2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.e-classes h4 { grid-column: 1 / -1; margin: 0 0 4px; font: 700 13px/1 "Cinzel", Georgia, serif; letter-spacing: .12em; text-transform: uppercase; color: var(--e-gold); }
.e-cls { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border-radius: 12px; border: 1px solid transparent; background: rgba(255,255,255,.04);
  font-size: 11px; color: var(--e-dim); transition: background .15s, border-color .15s, color .15s, transform .12s; }
.e-cls img { width: 44px; height: 44px; object-fit: contain; filter: grayscale(.5) brightness(.85); transition: filter .15s, transform .15s; }
.e-cls:hover { background: rgba(255,255,255,.08); color: var(--e-text); } .e-cls:hover img { filter: none; transform: scale(1.06); }
.e-cls.on { border-color: var(--e-gold); color: var(--e-gold); background: rgba(242,196,109,.12); } .e-cls.on img { filter: drop-shadow(0 0 8px rgba(242,196,109,.6)); }
.e-cview { position: relative; min-height: 0; display: flex; flex-direction: column; }
.e-art { position: absolute; left: 50%; top: 4%; height: 70%; max-width: 100%; object-fit: contain; transform: translateX(-50%); opacity: .22; pointer-events: none;
  filter: drop-shadow(0 0 30px rgba(111,216,255,.25)); transition: opacity .3s; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
.e-cview canvas { position: relative; flex: 1; min-height: 0; width: 100%; display: block; }
.e-cview .e-ped { bottom: 150px; }
.e-sex { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.08); }
.e-sex button { width: 96px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--e-dim); font-weight: 600; }
.e-sex button.on { background: rgba(242,196,109,.18); color: var(--e-gold); box-shadow: inset 0 0 0 1px rgba(242,196,109,.4); }
.e-ctext { position: relative; padding: 0 8px 4px; text-align: center; }
.e-ctext h3 { margin: 0; font: 700 26px/1.1 "Cinzel", Georgia, serif; color: var(--e-gold); text-shadow: 0 2px 10px rgba(0,0,0,.9); }
.e-ctext .ln { font-size: 13px; color: var(--e-crys); letter-spacing: .06em; }
.e-ctext p { margin: 8px auto 0; max-width: 520px; font-size: 13px; color: #cdd6ea; text-shadow: 0 1px 6px rgba(0,0,0,.95); }
.e-cside { overflow-y: auto; }
.e-faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.e-face { aspect-ratio: 1; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background-color: rgba(0,0,0,.3); background-repeat: no-repeat; background-size: 500% 100%;
  transition: border-color .15s, transform .12s; padding: 0; }
.e-face:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.35); }
.e-face.on { border-color: var(--e-gold); box-shadow: 0 0 0 2px rgba(242,196,109,.35); }
.e-face.def { display: grid; place-items: center; font-size: 11px; color: var(--e-dim); background-image: none !important; }
.e-cols { display: flex; flex-direction: column; gap: 8px; }
.e-col { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); text-align: left; }
.e-col.on { border-color: var(--e-gold); }
.e-col .sw { width: 36px; height: 28px; border-radius: 7px; border: 1px solid rgba(255,255,255,.3); background: repeating-conic-gradient(#555 0 25%, #333 0 50%) 50% / 10px 10px; position: relative; overflow: hidden; }
.e-col .sw i { position: absolute; inset: 0; }
.e-col .t { font-size: 13px; } .e-col .t small { display: block; color: var(--e-dim); font-size: 11px; }
.e-col .x { width: 28px; height: 28px; border-radius: 7px; border: 0; background: none; color: var(--e-dim); }
.e-col .x:hover { background: rgba(255,255,255,.08); color: var(--e-text); }
.e-pal { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 8px; }
.e-pal button { aspect-ratio: 1; border-radius: 5px; border: 1px solid rgba(0,0,0,.4); padding: 0; transition: transform .1s; }
.e-pal button:hover { transform: scale(1.15); z-index: 1; }
.e-pick { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 8px; align-items: center; }
.e-pick input[type="range"] { width: 100%; accent-color: var(--e-gold); }
.e-pick .e-btn { min-height: 34px; padding: 0 12px; font-size: 12px; }
.e-hue { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); position: relative; margin-top: 10px; cursor: pointer; touch-action: none; }
.e-hue i, .e-lum i { position: absolute; top: -3px; width: 8px; height: 20px; margin-left: -4px; border-radius: 4px; background: #fff; box-shadow: 0 0 0 1px #000, 0 1px 4px rgba(0,0,0,.6); pointer-events: none; }
.e-lum { height: 14px; border-radius: 7px; position: relative; margin-top: 10px; cursor: pointer; touch-action: none; }
.e-namebox { display: grid; grid-template-columns: 1fr 44px; gap: 8px; }
.e-namebox .e-btn { padding: 0; font-size: 20px; }
.e-cside .e-actions { margin-top: 14px; }
.e-cside section + section { margin-top: 16px; }

/* ---------- cargando / diálogo ---------- */
.e-veil { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(3,6,14,.72); backdrop-filter: blur(4px); animation: e-in .2s ease both; }
.e-veil .box { width: min(400px, calc(100% - 32px)); padding: 22px; border-radius: 16px; background: var(--e-glass2); border: 1px solid var(--e-line); box-shadow: 0 30px 80px rgba(0,0,0,.6); text-align: center; }
.e-veil h3 { margin: 0 0 8px; font: 700 18px "Cinzel", Georgia, serif; color: var(--e-gold); }
.e-veil p { margin: 0; color: var(--e-dim); }
.e-veil .e-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.e-loader { width: 54px; height: 54px; margin: 4px auto 14px; position: relative; }
.e-loader::before, .e-loader::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--e-gold); animation: e-spin 1s linear infinite; }
.e-loader::after { inset: 9px; border-top-color: var(--e-crys); animation-duration: .7s; animation-direction: reverse; }

/* ---------- celular / pantallas angostas ---------- */
@media (max-width: 1100px) {
  .e-create { grid-template-columns: 200px minmax(0, 1fr) 300px; gap: 12px; }
}
@media (max-width: 860px) {
  .e-top { padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .e-foot { padding: 8px 14px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .e-foot .copy { display: none; }
  .e-shade { background: linear-gradient(0deg, rgba(4,7,16,.96) 0%, rgba(4,7,16,.78) 55%, rgba(4,7,16,.25) 100%); }
  .e-bgimg { object-position: 70% 30%; }
  #scLogin { align-items: flex-end; padding: 0 12px 4px; }
  .e-auth { padding: 22px 18px 18px; margin: auto auto 0; }
  .e-wrap { padding: 4px 12px 12px; overflow-y: auto; }
  .e-chars { grid-template-columns: 1fr; grid-template-rows: minmax(230px, 1fr) auto; gap: 10px; }
  .e-stage { min-height: 230px; }
  .e-ped { bottom: 80px; }
  .e-side { max-height: 52dvh; }
  .e-create { grid-template-columns: 1fr; grid-template-rows: auto minmax(280px, 42dvh) auto; gap: 10px; }
  .e-classes { grid-template-columns: repeat(6, 1fr); padding: 10px; }
  .e-classes h4 { display: none; }
  .e-cls img { width: 36px; height: 36px; } .e-cls span { display: none; }
  .e-cview .e-ped { bottom: 110px; }
  .e-ctext p { display: none; }
  .e-cside { overflow: visible; }
  .e-srv { grid-template-columns: 84px 1fr; padding: 12px; }
  .e-srv .art { width: 84px; height: 108px; }
}
@media (max-width: 420px) {
  .e-row2 { grid-template-columns: 1fr; }
  .e-steps .st span { display: none; }
  .e-online { padding: 5px 10px; font-size: 12px; }
}

/* el index.html trae estilos generales para header/footer del juego: aquí no aplican */
#entry header.e-top, #entry footer.e-foot { background: none; border: 0; min-height: 0; white-space: normal; overflow: visible; }
/* el index.html pone todos los canvas a pantalla completa (el del mapa): aquí van dentro de su caja */
#entry canvas { position: relative; inset: auto; height: auto; }
#entry .e-stage canvas, #entry .e-cview canvas { width: 100%; height: auto; flex: 1 1 0; min-height: 0; }
#entry .e-slot canvas { width: 56px; height: 56px; flex: none; }
.e-user .e-btn { color: var(--e-text); }
.e-classes { grid-template-columns: repeat(3, minmax(0, 1fr)); overflow-x: hidden; }
.e-pal { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.e-cside, .e-side { overflow-x: hidden; }
@media (max-width: 1100px) and (min-width: 861px) { .e-classes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  #entry .e-classes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #entry .e-create { flex: none; grid-template-rows: auto 340px auto; }
  #entry .e-cside { max-height: none; }
  .e-user .acc { display: none; }
}

/* ===================== Todo entra en la pantalla, sin bajar (celular vertical, acostado y PC) ===================== */
#entry { height: 100dvh; }
.e-wrap { overflow: hidden; }
/* personajes: el escenario se encoge y la lista + "Jugar" siempre se ven */
.e-chars { grid-template-rows: minmax(0, 1fr); }
.e-side { min-height: 0; }
.e-side .e-actions { flex: none; }
@media (max-width: 860px) {
  .e-wrap { overflow: hidden; }
  .e-chars { grid-template-rows: minmax(150px, 1fr) auto; }
  .e-stage { min-height: 150px; }
  .e-cinfo { padding-bottom: 4px; } .e-ped { bottom: 58px; }
  .e-side { max-height: 46dvh; padding: 12px; }
  .e-side .e-actions { margin-top: 8px; flex-direction: row; } .e-side .e-actions .e-btn { flex: 1; min-height: 46px; }
  #eBackSrv { flex: 0 0 auto !important; padding: 0 14px; font-size: 13px; }
  .e-slot { min-height: 56px; } .e-slot canvas, #entry .e-slot canvas { width: 46px; height: 46px; } .e-slot { grid-template-columns: 46px 1fr auto; }
  #entry .e-create { flex: 1; min-height: 0; grid-template-rows: auto minmax(160px, 1fr) minmax(0, auto); }
  #entry .e-cside { max-height: 44dvh; overflow-y: auto; }
  .e-servers { min-height: 0; }
}
/* celular vertical bajo (p. ej. 360×640): login más compacto */
@media (max-width: 860px) and (max-height: 700px) {
  .e-auth { padding: 16px 16px 14px; }
  .e-logo { margin-bottom: 10px; } .e-logo h1 { font-size: 32px; } .e-logo .e-rule { display: none; }
  .e-field { margin-top: 8px; } .e-actions { margin-top: 12px; }
  #fLogin .e-sep, #fLogin .e-sep + .e-actions { display: none; }
}
/* pantalla baja (celular acostado, ventana chica): todo en horizontal */
@media (max-height: 560px) and (min-width: 560px) {
  .e-top { padding: 6px 14px !important; } .e-online { padding: 4px 10px; font-size: 12px; }
  .e-foot { position: absolute; left: 0; bottom: 0; padding: 4px 12px !important; z-index: 4; }
  .e-foot .copy { display: none; }
  /* login: logo a la izquierda, formulario a la derecha */
  #scLogin { align-items: center; justify-content: center; padding: 0 12px 22px; overflow: hidden; }
  .e-auth { display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0 18px; width: min(760px, 100%); margin: auto;
    padding: 14px 18px; max-height: calc(100dvh - 70px); }
  .e-logo { grid-row: 1 / span 2; align-self: center; margin: 0; } .e-logo h1 { font-size: 34px; } .e-logo .e-rule { width: 90%; }
  .e-tabs { grid-column: 2; } .e-tabs button { height: 32px; }
  #fLogin, #fReg { grid-column: 2; min-height: 0; overflow-y: auto; }
  #fLogin { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-content: start; }
  #fLogin > *:not(.e-field) { grid-column: 1 / -1; }
  #fLogin .e-sep, #fLogin .e-sep + .e-actions { display: none; }
  .e-field { margin-top: 8px; } .e-field > label { margin-bottom: 3px; font-size: 11px; }
  .e-in { height: 38px; } .e-eye { bottom: 3px; }
  .e-between { margin-top: 8px; } .e-actions { margin-top: 10px; } .e-btn.big { min-height: 42px; }
  /* servidores y personajes */
  .e-wrap { padding: 0 14px 26px !important; }
  .e-h { font-size: 20px; margin: 0 0 2px; } .e-sub { margin-bottom: 8px; font-size: 12px; }
  .e-chars, #entry .e-chars { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); gap: 12px; }
  .e-stage { min-height: 0; } .e-cinfo { padding-bottom: 2px; } .e-cinfo h3 { font-size: 20px; } .e-ped { bottom: 46px; height: 46px; }
  .e-rot { top: 40%; width: 36px; height: 36px; }
  .e-side { max-height: none; padding: 10px; } .e-side h4 { margin-bottom: 6px; }
  .e-slot { min-height: 50px; padding: 3px 10px 3px 3px; grid-template-columns: 42px 1fr auto; gap: 8px; }
  .e-slot canvas, #entry .e-slot canvas { width: 42px; height: 42px; } .e-slot.new .plus { width: 42px; height: 42px; font-size: 22px; }
  .e-slot.new { grid-template-columns: 42px 1fr; }
  .e-side .e-actions { margin-top: 8px; flex-direction: row; } .e-side .e-actions .e-btn { min-height: 42px; }
  #ePlay { flex: 1; } #eBackSrv { flex: 0 0 auto; padding: 0 12px; font-size: 12px; }
  /* crear personaje: clases | vista | opciones, cada columna con su propio scroll */
  #entry .e-create { flex: 1; min-height: 0; grid-template-columns: 170px minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); gap: 10px; }
  #entry .e-classes { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px; overflow-y: auto; }
  #entry .e-cls img { width: 32px; height: 32px; } #entry .e-cls span { display: none; } #entry .e-classes h4 { display: none; }
  #entry .e-cside { max-height: none; overflow-y: auto; }
  .e-cview .e-ped { bottom: 70px; } .e-ctext p { display: none; }
  .e-srv { padding: 10px; } .e-srv .art { width: 70px; height: 90px; } .e-srv { grid-template-columns: 70px 1fr; }
}
/* "Jugar" grande y "Cambiar de servidor" chico cuando van en la misma fila */
@media (max-width: 860px), (max-height: 560px) and (min-width: 560px) {
  #entry #ePlay { flex: 1 1 auto; width: auto; }
  #entry #eBackSrv { flex: 0 0 auto; width: auto; padding: 0 12px; font-size: 12px; }
}

/* botón de pantalla completa en la barra de arriba */
.e-full { display: grid; place-items: center; width: 36px; height: 34px; padding: 0; border-radius: 10px; border: 1px solid var(--e-line2); background: rgba(6,10,22,.7); color: var(--e-gold); }
.e-full svg { width: 20px; height: 20px; } .e-full:hover { border-color: var(--e-gold); }
