/* RainMu: interfaz para celular y tablet (la prende mobile.js con la clase rm-mobile). */
:root {
  --rm-gold: #e2b04a;
  --rm-gold-soft: rgba(226, 176, 74, .35);
  --rm-glass: rgba(14, 12, 20, .62);
  --rm-glass-strong: rgba(12, 10, 18, .9);
  --rm-line: rgba(255, 255, 255, .14);
  --rm-text: #f3ecdf;
  --rm-dim: #b9ae9c;
  --rm-red: #d6453d;
  --rm-blue: #3f7fe0;
  --rm-green: #49b26a;
}

.rm-m { display: none; }
html.rm-mobile, html.rm-mobile body { overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.rm-mobile #muTopBar,
html.rm-mobile #muStick, html.rm-mobile #muRBtn, html.rm-mobile #muKeyBtn, html.rm-mobile #muKeys { display: none !important; }
html.rm-mobile #canvas { touch-action: none; }
html.rm-mobile .rm-m { font-family: 'Outfit', system-ui, sans-serif; color: var(--rm-text); -webkit-tap-highlight-color: transparent; }
html.rm-mobile .rm-m button { font-family: inherit; color: inherit; border: 0; cursor: pointer; touch-action: none; }
html.rm-mobile .rm-m input { font-family: inherit; font-size: 16px; }

/* ── girar el celular ─────────────────────────────────────────── */
#rmRotate { position: fixed; inset: 0; z-index: 9000; background: #0b0910; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 24px; }
#rmRotate svg { width: 84px; height: 84px; color: var(--rm-gold); animation: rmTurn 2.4s ease-in-out infinite; }
#rmRotate b { font-size: 22px; letter-spacing: .02em; }
#rmRotate span { color: var(--rm-dim); font-size: 15px; max-width: 260px; }
@keyframes rmTurn { 0%, 25% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
/* Ya no se pide girar: el celular parado tiene su version vertical (ver el final del archivo). */
html.rm-mobile #rmRotate { display: none !important; }
@media (prefers-reduced-motion: reduce) { #rmRotate svg { animation: none; } }

/* ── capa de juego (aparece adentro del mapa) ─────────────────── */
#rmHud { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#rmHud > * { pointer-events: auto; }
html.rm-mobile.rm-ingame #rmHud { display: block; }

#rmStick { position: fixed; left: max(18px, env(safe-area-inset-left)); bottom: 17vh; width: 34vh; height: 34vh; max-width: 150px; max-height: 150px; min-width: 112px; min-height: 112px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0 55%, rgba(255,255,255,.12) 56% 58%, rgba(255,255,255,.04) 59%); border: 1.5px solid var(--rm-line); }
#rmKnob { position: absolute; left: 50%; top: 50%; width: 44%; height: 44%; margin: -22% 0 0 -22%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.34), rgba(255,255,255,.14) 60%, rgba(255,255,255,.08)); border: 1.5px solid rgba(255,255,255,.38); box-shadow: 0 2px 10px rgba(0,0,0,.35); transition: transform .06s linear; }
#rmStick.on #rmKnob { transition: none; }

#rmAct { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: 15vh; width: 46vh; height: 46vh; max-width: 230px; max-height: 230px; min-width: 176px; min-height: 176px; }
#rmAttack { position: absolute; right: 0; bottom: 0; width: 46%; height: 46%; border-radius: 50%;
  background: rgba(14,12,20,.28); border: 2px solid rgba(214,69,61,.75); box-shadow: 0 2px 12px rgba(0,0,0,.35); color: var(--rm-red);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-shadow: 0 1px 2px #000; }
#rmAttack svg { width: 42%; height: 42%; stroke: #ff4a3d; stroke-width: 2.2; filter: drop-shadow(0 1px 2px rgba(0,0,0,.8)); }
#rmAttack.on, .rm-skill.on { filter: brightness(1.35); transform: scale(.94); }
.rm-skill { position: absolute; width: 25%; height: 25%; border-radius: 50%; background: var(--rm-glass-strong); box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 4px 12px rgba(0,0,0,.55); overflow: hidden; padding: 0; }
.rm-skill i { position: absolute; inset: 12%; border-radius: 22%; background-repeat: no-repeat; }
.rm-skill em { position: absolute; right: 9%; bottom: 4%; font-style: normal; font-weight: 800; font-size: 11px; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.rm-skill.cur { box-shadow: 0 0 0 3px var(--rm-gold), 0 0 14px var(--rm-gold-soft); }
.rm-skill.empty { opacity: .35; }
.rm-skill[data-n="1"] { right: 52%; bottom: 0; }
.rm-skill[data-n="2"] { right: 48%; bottom: 31%; }
.rm-skill[data-n="3"] { right: 25%; bottom: 54%; }
.rm-skill[data-n="4"] { right: 0; bottom: 56%; }

.rm-pill { position: fixed; height: 38px; padding: 0 14px; border-radius: 19px; background: var(--rm-glass); box-shadow: inset 0 0 0 1.5px var(--rm-line); font-weight: 700; font-size: 13px; letter-spacing: .04em; display: flex; align-items: center; gap: 7px; }
.rm-pill.on { background: rgba(226, 176, 74, .3); box-shadow: inset 0 0 0 1.5px var(--rm-gold); color: #fff3d2; }
.rm-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #6b6457; }
.rm-pill.on .dot { background: var(--rm-green); box-shadow: 0 0 8px var(--rm-green); }
/* AUTO y PICK arriba del cristal de mana (el cristal del juego queda a ~71% del ancho) */
/* POT / PICK / AUTO: en fila, chiquitos, justo arriba de la barra de experiencia (el HUD del juego
   mide 480 de alto y la barra empieza 44 unidades arriba del borde de abajo). */
#rmBar { position: fixed; left: 50%; bottom: calc(100vh * 44 / 480 + 2px); transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
#rmBar .rm-pill { position: static; pointer-events: auto; height: 22px; padding: 0 9px; gap: 5px; border-radius: 11px; font-size: 10px; }
#rmBar .rm-pill .dot { width: 6px; height: 6px; }
#rmTarget { position: absolute; right: 54%; bottom: 62%; width: 22%; height: 22%; border-radius: 50%; background: var(--rm-glass-strong); box-shadow: 0 0 0 2px var(--rm-gold-soft), 0 4px 12px rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; color: var(--rm-gold); }
#rmTarget svg { width: 58%; height: 58%; }
#rmTarget.on { filter: brightness(1.4); }
#rmLock { top: calc(max(10px, env(safe-area-inset-top)) + 58px); left: 50%; transform: translateX(-50%); display: none; max-width: 46vw; background: var(--rm-glass-strong); box-shadow: inset 0 0 0 1.5px var(--rm-gold); white-space: nowrap; }
#rmLock span { overflow: hidden; text-overflow: ellipsis; }
#rmLock.pvp { box-shadow: inset 0 0 0 1.5px var(--rm-red); }
#rmMark { position: fixed; left: -22px; top: -60px; width: 44px; height: 22px; display: none; pointer-events: none !important; border-radius: 50%; border: 3px solid var(--rm-gold); box-shadow: 0 0 10px var(--rm-gold); will-change: transform; }

.rm-round { position: fixed; width: 46px; height: 46px; border-radius: 14px; background: var(--rm-glass); box-shadow: inset 0 0 0 1.5px var(--rm-line); display: flex; align-items: center; justify-content: center; }
.rm-round svg { width: 24px; height: 24px; }
.rm-round:active { background: rgba(226, 176, 74, .3); }
#rmMenuBtn { top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); background: rgba(226,176,74,.25); box-shadow: inset 0 0 0 1.5px var(--rm-gold); }
#rmChatBtn { top: max(10px, env(safe-area-inset-top)); right: calc(max(12px, env(safe-area-inset-right)) + 54px); }
#rmZoomIn { top: max(10px, env(safe-area-inset-top)); right: calc(max(12px, env(safe-area-inset-right)) + 108px); }
#rmZoomOut { top: max(10px, env(safe-area-inset-top)); right: calc(max(12px, env(safe-area-inset-right)) + 162px); }
#rmClose { top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); height: 42px; display: none; background: var(--rm-glass-strong); box-shadow: inset 0 0 0 1.5px var(--rm-gold); }
html.rm-panels #rmClose { display: flex; }
html.rm-panels #rmAct, html.rm-panels #rmBar, html.rm-panels #rmZoomIn, html.rm-panels #rmZoomOut { display: none; }

/* panel de chat chico (siempre a la vista) */
#rmChatLog { position: fixed; left: max(10px, env(safe-area-inset-left)); top: calc(max(8px, env(safe-area-inset-top)) + 70px); width: min(36vw, 330px); max-height: 26vh; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; pointer-events: none !important; }
#rmChatLog p, #rmChatList p { margin: 0; font-size: 12.5px; line-height: 1.25; text-shadow: 0 1px 2px #000, 0 0 4px #000; word-break: break-word; }
#rmChatLog p { background: rgba(0,0,0,.32); border-radius: 5px; padding: 1px 7px; transition: opacity .6s; }
#rmChatLog p i { font-style: normal; color: var(--rm-dim); }
#rmChatLog p.old { opacity: 0; }
.rm-who { color: var(--rm-gold); font-weight: 700; }
.rm-c1 { color: #8fc1ff; } .rm-c2 { color: #ffd36b; } .rm-c3 { color: #ff9b8f; } .rm-c4 { color: #b6ff9a; }

/* ── ventana de chat (con teclado) ────────────────────────────── */
#rmChat { position: fixed; inset: 0; z-index: 80; background: rgba(6,5,10,.72); flex-direction: column; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); gap: 8px; }
html.rm-mobile #rmChat.open { display: flex; }
#rmChatList { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 6px 4px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
#rmChatList p { font-size: 16px; }
.rm-chatrow { display: flex; gap: 8px; align-items: center; }
.rm-chatrow input { height: 46px; border-radius: 12px; border: 1.5px solid var(--rm-line); background: rgba(255,255,255,.08); color: var(--rm-text); padding: 0 14px; outline: none; }
.rm-chatrow input:focus { border-color: var(--rm-gold); }
#rmChatTo { width: 128px; }
#rmChatText { flex: 1; min-width: 0; }
.rm-btn { height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 800; letter-spacing: .05em; background: var(--rm-gold); color: #1b1307 !important; }
.rm-btn.ghost { background: rgba(255,255,255,.1); color: var(--rm-text) !important; box-shadow: inset 0 0 0 1.5px var(--rm-line); }
.rm-chips { display: flex; gap: 6px; overflow-x: auto; touch-action: pan-x; }
.rm-chips button { touch-action: pan-x !important; flex: none; height: 34px; padding: 0 12px; border-radius: 17px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px var(--rm-line); font-size: 14px; font-weight: 600; }

/* ── menu con todo ────────────────────────────────────────────── */
#rmMenu { position: fixed; inset: 0; z-index: 85; background: rgba(6,5,10,.84); flex-direction: column; padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); }
html.rm-mobile #rmMenu.open { display: flex; }
.rm-head { display: flex; align-items: center; justify-content: space-between; height: 46px; flex: none; }
.rm-head b { font-size: 19px; letter-spacing: .03em; }
.rm-head b small { color: var(--rm-dim); font-weight: 500; font-size: 14px; margin-left: 8px; }
#rmGrid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; align-content: start; overflow-y: auto; padding: 6px 0 12px; touch-action: pan-y; }
.rm-tile { touch-action: pan-y !important; height: 86px; border-radius: 16px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1.5px var(--rm-line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; font-size: 14px; font-weight: 600; text-align: center; line-height: 1.1; padding: 0 4px; }
.rm-tile svg { width: 28px; height: 28px; color: var(--rm-gold); }
.rm-tile:active { background: rgba(226,176,74,.22); }
.rm-tile kbd { font: 600 10px 'Outfit', sans-serif; color: var(--rm-dim); }
.rm-tile.warn { box-shadow: inset 0 0 0 1.5px var(--rm-red); }

/* ── ingreso y personajes ─────────────────────────────────────── */
.rm-card { position: fixed; z-index: 60; background: var(--rm-glass-strong); border-radius: 20px; box-shadow: 0 0 0 1.5px var(--rm-gold-soft), 0 18px 50px rgba(0,0,0,.6); padding: 18px 20px; }
#rmLogin { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, 90vw); flex-direction: column; gap: 10px; }
html.rm-mobile #rmLogin.open { display: flex; }
#rmLogin h2 { margin: 0 0 2px; font-size: 22px; letter-spacing: .04em; text-align: center; }
#rmLogin h2 span { color: var(--rm-gold); }
#rmLogin label { font-size: 13px; color: var(--rm-dim); font-weight: 600; margin-bottom: -6px; }
#rmLogin input[type=text], #rmLogin input[type=password] { height: 46px; border-radius: 12px; border: 1.5px solid var(--rm-line); background: rgba(255,255,255,.08); color: var(--rm-text); padding: 0 14px; outline: none; }
#rmLogin input:focus { border-color: var(--rm-gold); }
.rm-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--rm-dim); margin: 2px 0; }
.rm-check input { width: 20px; height: 20px; accent-color: var(--rm-gold); }
#rmLogin .rm-btn { height: 50px; font-size: 16px; }
#rmHint { position: fixed; z-index: 60; left: 50%; bottom: 12px; transform: translateX(-50%); background: var(--rm-glass-strong); padding: 10px 18px; border-radius: 14px; font-size: 15px; box-shadow: inset 0 0 0 1px var(--rm-line); white-space: nowrap; }
html.rm-mobile #rmHint.open { display: block; }

#rmChars { right: max(14px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); width: min(300px, 42vw); max-height: 92vh; flex-direction: column; gap: 8px; padding: 14px; }
html.rm-mobile #rmChars.open { display: flex; }
#rmChars h3 { margin: 0 0 2px; font-size: 17px; }
#rmCharList { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; touch-action: pan-y; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; }
.rm-char { touch-action: pan-y !important; flex: none; display: flex; flex-direction: column; align-items: flex-start; padding: 6px 12px; border-radius: 12px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1.5px var(--rm-line); text-align: left; }
.rm-char b { font-size: 15px; }
.rm-char span { font-size: 13px; color: var(--rm-dim); }
.rm-char.sel { background: rgba(226,176,74,.22); box-shadow: inset 0 0 0 2px var(--rm-gold); }
#rmChars .rm-btn { height: 50px; font-size: 16px; }
#rmChars .rm-btn[disabled] { opacity: .45; }
#rmChars small { color: var(--rm-dim); font-size: 12px; line-height: 1.3; }

/* escribir en un campo del juego (nombre de guild, etc.) */
#rmTypeBtn { left: 50%; bottom: 20vh; transform: translateX(-50%); height: 44px; display: none; background: var(--rm-glass-strong); box-shadow: inset 0 0 0 1.5px var(--rm-gold); }
html.rm-typing #rmTypeBtn { display: flex; }
#rmType { position: fixed; z-index: 90; left: 0; right: 0; top: 0; background: var(--rm-glass-strong); padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
html.rm-mobile #rmType.open { display: block; }

/* crear personaje: el nombre */
#rmCreate { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); top: max(8px, env(safe-area-inset-top)); width: min(440px, 92vw); background: var(--rm-glass-strong); box-shadow: inset 0 0 0 1.5px var(--rm-gold); border-radius: 14px; padding: 10px 12px; flex-direction: column; gap: 6px; }
#rmCreate b { color: var(--rm-gold); font-size: 14px; }
#rmCreate small { color: var(--rm-dim); font-size: 11px; line-height: 1.3; }
html.rm-mobile #rmCreate.open { display: flex; }

/* celulares bajitos y con el teclado abierto */
@media (max-height: 430px) {
  #rmLogin { gap: 6px; padding: 12px 18px; }
  #rmLogin h2 { font-size: 18px; }
  #rmLogin input[type=text], #rmLogin input[type=password] { height: 40px; }
  #rmLogin .rm-btn { height: 44px; }
}
@media (max-height: 300px) {
  #rmLogin { top: 6px; transform: translateX(-50%); }
  #rmLogin h2, #rmLogin .rm-check { display: none; }
}
.rm-tile kbd { background: none; border: 0; box-shadow: none; padding: 0; }

.rm-tile.off { opacity: .38; }
.rm-tile small { font-size: 11px; color: var(--rm-dim); font-weight: 500; }
@media (max-height: 450px) { #rmChars > small { display: none; } }

/* instalar como app */
#rmInstall { position: fixed; z-index: 61; top: max(10px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); background: rgba(226,176,74,.22); box-shadow: inset 0 0 0 1.5px var(--rm-gold); }
html.rm-mobile #rmInstall.open { display: flex; }
#rmIosTip { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, 90vw); z-index: 95; flex-direction: column; gap: 8px; }
html.rm-mobile #rmIosTip.open { display: flex; }
#rmIosTip h3 { margin: 0 0 4px; font-size: 18px; }
#rmIosTip p { margin: 0; font-size: 15px; line-height: 1.35; color: var(--rm-text); }
#rmIosTip .rm-btn { margin-top: 6px; }
#rmIosTip .rm-btn.ghost { margin-top: 0; height: 40px; font-size: 13px; }
#rmIosTip { max-height: 94vh; overflow-y: auto; }

/* elegir skills de los botones */
.rm-pick { height: 92px; }
.rm-pick.sel { background: rgba(226,176,74,.22); box-shadow: inset 0 0 0 2px var(--rm-gold); }
.rm-ico { display: block; width: 40px; height: 45px; border-radius: 8px; background-color: rgba(0,0,0,.4); background-repeat: no-repeat; box-shadow: 0 0 0 1px var(--rm-line); }
.rm-sep { grid-column: 1 / -1; font-size: 14px; color: var(--rm-dim); padding: 6px 2px 0; }

/* eventos */
.rm-evlist { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.rm-ev { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1.5px var(--rm-line); }
.rm-ev b { font-size: 16px; font-weight: 700; }
.rm-ev span { font-size: 15px; font-weight: 700; color: var(--rm-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rm-ev.open { box-shadow: inset 0 0 0 2px var(--rm-green); background: rgba(73,178,106,.16); }
.rm-ev.open span { color: #8ff0ae; }
.rm-ev.on { box-shadow: inset 0 0 0 2px var(--rm-gold); }
.rm-ev.on span { color: var(--rm-gold); }
.rm-ev.soon span { color: #ffb36b; }
.rm-ev.off { opacity: .45; }

/* el boton de instalar ya no va en pantalla (esta en el menu). .rm-pill le ponia display:flex. */
html.rm-mobile #rmInstall { display: none !important; }

/* con una ventana de la derecha abierta (inventario, guild...) los botones de arriba se corren
   a la izquierda del panel para no tapar su titulo */
html.rm-panels #rmMenuBtn { right: calc(23vw + 12px); }
html.rm-panels #rmChatBtn { right: calc(23vw + 66px); }

#rmToast { position: fixed; z-index: 70; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 104px); transform: translateX(-50%); max-width: 70vw; padding: 9px 16px; border-radius: 12px; background: var(--rm-glass-strong); box-shadow: inset 0 0 0 1.5px var(--rm-gold-soft); color: var(--rm-text); font: 600 14px 'Outfit', sans-serif; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
#rmToast.show { opacity: 1; }
#rmToast.mini { transform: none; max-width: 40vw; padding: 4px 10px; border-radius: 9px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* JUNTAR: chiquito, arriba del joystick */
#rmGrab { position: fixed; left: max(18px, env(safe-area-inset-left)); bottom: calc(17vh + min(max(34vh, 112px), 150px) + 8px); height: 28px; padding: 0 10px 0 7px; border-radius: 14px; display: flex; align-items: center; gap: 5px; background: var(--rm-glass); box-shadow: inset 0 0 0 1px var(--rm-line); font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--rm-dim) !important; }
#rmGrab svg { width: 15px; height: 15px; }
#rmGrab.on { background: rgba(226,176,74,.3); color: #fff3d2 !important; }

/* iPhone: la pagina ocupa la pantalla entera (tambien debajo de la barrita de inicio) */
html.rm-mobile, html.rm-mobile body { width: 100%; height: 100%; min-height: 100dvh; margin: 0; overflow: hidden; background: #000; }
#rmCreate input { flex: 1; min-width: 0; font-size: 16px; }

/* hablar con el NPC de al lado: aparece solo cuando hay uno cerca */
#rmNpc { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(15vh + min(max(46vh, 176px), 230px) + 10px); height: 34px; padding: 0 14px 0 10px; border-radius: 17px;
  display: none; align-items: center; gap: 6px; background: var(--rm-glass); box-shadow: inset 0 0 0 1px var(--rm-gold-soft); font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--rm-text) !important; }
#rmNpc.show { display: flex; }
#rmNpc svg { color: var(--rm-gold); }
#rmNpc.on { background: rgba(226,176,74,.3); }

/* BETA: el boton PERFIL (grabacion de rendimiento) era para depurar; los jugadores no lo usan. */
#rmBtnPerf { display: none !important; }

/* ══ VERSION VERTICAL (celular parado) ═════════════════════════════════════════════════════════
   El juego llena toda la pantalla (shell_login.cpp lo recorta a los costados) y la barra de abajo
   del MU se oculta: arriba van la barra propia (vida, mana, AG), POT/PICK/AUTO y las opciones;
   abajo el joystick, el ataque y las skills, con la experiencia en el borde.
   Con una ventana abierta o el boton del ojo (clase rm-pfit) el juego se ve entero arriba y
   todo lo demas pasa debajo (--rm-gh = donde termina el juego). */
#rmVit, #rmExp, #rmFit, #rmBlock { display: none; }
html.rm-mobile.rm-portrait #rmFit { display: flex; }
html.rm-mobile.rm-portrait:not(.rm-pfit) #rmVit,
html.rm-mobile.rm-portrait:not(.rm-pfit) #rmExp,
html.rm-mobile.rm-portrait:not(.rm-pfit) #rmBlock { display: block; }
html.rm-mobile.rm-portrait.rm-pfit body { background: linear-gradient(180deg, #000 0, #000 var(--rm-gh, 75vw), #120d1c var(--rm-gh, 75vw), #0b0910 100%) !important; }

/* barra propia: arriba a la izquierda */
#rmVit { position: fixed; left: 10px; top: calc(env(safe-area-inset-top) + 8px); width: min(52vw, 230px); padding: 7px 9px 8px; border-radius: 12px; background: rgba(10,8,16,.58); box-shadow: inset 0 0 0 1px rgba(226,176,74,.35); pointer-events: none !important; }
#rmVit b { display: block; font-size: 11px; letter-spacing: .08em; color: var(--rm-gold); margin-bottom: 4px; }
#rmVit .bar { position: relative; height: 15px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 4px; }
#rmVit .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; transition: width .2s; }
#rmVit .bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
#rmVit .hp i { background: linear-gradient(180deg, #ff6b5e, #b5241b); }
#rmVit .mp i { background: linear-gradient(180deg, #6aa8ff, #2450b8); }
#rmVit .ag { height: 5px; }
#rmVit .ag i { background: linear-gradient(90deg, #c9a24a, #f6d27a); }

/* experiencia: en el borde de abajo, a todo el ancho */
#rmExp { position: fixed; left: 0; right: 0; bottom: 0; height: calc(env(safe-area-inset-bottom) + 7px); background: rgba(0,0,0,.6); pointer-events: none !important; }
#rmExp i { position: absolute; left: 0; top: 0; height: 7px; background: linear-gradient(90deg, #b9852b, #f6d27a); box-shadow: 0 0 8px rgba(246,210,122,.6); transition: width .4s; }
#rmExp span { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 9px); transform: translateX(-50%); font-size: 10px; font-weight: 800; letter-spacing: .06em; color: #f6d27a; text-shadow: 0 1px 2px #000, 0 0 4px #000; white-space: nowrap; }
/* franja de abajo: ahi estaba la barra del MU (oculta). Se tapa para que un toque no use una pocion. */
#rmBlock { position: fixed; left: 0; right: 0; bottom: 0; height: calc(100vh * 48 / 480 + 4px); }

/* arriba: POT / PICK / AUTO debajo de la barra propia; opciones a la derecha */
html.rm-mobile.rm-portrait #rmBar { left: 10px; top: calc(env(safe-area-inset-top) + 82px); bottom: auto; transform: none; gap: 6px; }
html.rm-mobile.rm-portrait #rmBar .rm-pill { height: 28px; padding: 0 10px; border-radius: 14px; font-size: 11px; }
html.rm-mobile.rm-portrait .rm-round { width: 40px; height: 40px; border-radius: 12px; }
html.rm-mobile.rm-portrait .rm-round svg { width: 21px; height: 21px; }
html.rm-mobile.rm-portrait #rmMenuBtn, html.rm-mobile.rm-portrait.rm-panels #rmMenuBtn { top: calc(env(safe-area-inset-top) + 8px); right: 10px; }
html.rm-mobile.rm-portrait #rmChatBtn, html.rm-mobile.rm-portrait.rm-panels #rmChatBtn { top: calc(env(safe-area-inset-top) + 8px); right: 56px; }
html.rm-mobile.rm-portrait #rmFit { position: fixed; top: calc(env(safe-area-inset-top) + 56px); right: 10px; }
html.rm-mobile.rm-portrait #rmFit.on { background: rgba(226,176,74,.3); box-shadow: inset 0 0 0 1.5px var(--rm-gold); }
html.rm-mobile.rm-portrait #rmZoomIn { top: calc(env(safe-area-inset-top) + 56px); right: 56px; }
html.rm-mobile.rm-portrait #rmZoomOut { top: calc(env(safe-area-inset-top) + 56px); right: 102px; }

/* objetivo, chat chico y avisos: debajo de lo de arriba */
html.rm-mobile.rm-portrait #rmLock { top: calc(env(safe-area-inset-top) + 118px); max-width: 80vw; }
html.rm-mobile.rm-portrait #rmChatLog { left: 10px; width: min(72vw, 320px); top: calc(env(safe-area-inset-top) + 160px); max-height: 18vh; }
html.rm-mobile.rm-portrait #rmToast { top: calc(env(safe-area-inset-top) + 160px); max-width: 90vw; }
html.rm-mobile.rm-portrait #rmTypeBtn { top: calc(env(safe-area-inset-top) + 118px); bottom: auto; }
html.rm-mobile.rm-portrait #rmClose { top: calc(env(safe-area-inset-top) + 118px); }

/* abajo: joystick a la izquierda, ataque y skills a la derecha */
html.rm-mobile.rm-portrait #rmStick { left: 14px; bottom: calc(env(safe-area-inset-bottom) + 30px); width: min(38vw, 160px); height: min(38vw, 160px); max-width: none; max-height: none; min-width: 120px; min-height: 120px; }
html.rm-mobile.rm-portrait #rmGrab { left: 14px; bottom: calc(env(safe-area-inset-bottom) + 38px + max(min(38vw, 160px), 120px)); }
html.rm-mobile.rm-portrait #rmAct { right: 10px; bottom: calc(env(safe-area-inset-bottom) + 20px); width: min(52vw, 230px); height: min(52vw, 230px); max-width: none; max-height: none; min-width: 180px; min-height: 180px; }
html.rm-mobile.rm-portrait #rmNpc { right: 10px; bottom: calc(env(safe-area-inset-bottom) + 28px + max(min(52vw, 230px), 180px)); }

/* "ver todo" (ventana abierta u ojo): el juego entero arriba y los botones de arriba pasan debajo */
html.rm-mobile.rm-portrait.rm-pfit #rmBar { top: calc(var(--rm-gh) + 10px); }
html.rm-mobile.rm-portrait.rm-pfit #rmMenuBtn, html.rm-mobile.rm-portrait.rm-pfit.rm-panels #rmMenuBtn { top: calc(var(--rm-gh) + 8px); }
html.rm-mobile.rm-portrait.rm-pfit #rmChatBtn, html.rm-mobile.rm-portrait.rm-pfit.rm-panels #rmChatBtn { top: calc(var(--rm-gh) + 8px); }
html.rm-mobile.rm-portrait.rm-pfit #rmFit, html.rm-mobile.rm-portrait.rm-pfit #rmZoomIn, html.rm-mobile.rm-portrait.rm-pfit #rmZoomOut { top: calc(var(--rm-gh) + 56px); }
html.rm-mobile.rm-portrait.rm-pfit #rmClose { top: calc(var(--rm-gh) + 56px); left: 10px; transform: none; height: 40px; }
html.rm-mobile.rm-portrait.rm-pfit #rmLock { top: 6px; }
html.rm-mobile.rm-portrait.rm-pfit #rmChatLog, html.rm-mobile.rm-portrait.rm-pfit #rmToast, html.rm-mobile.rm-portrait.rm-pfit #rmTypeBtn { top: calc(var(--rm-gh) + 106px); }

/* pantallas de antes de entrar: el juego entero arriba y los cuadros debajo */
html.rm-mobile.rm-portrait #rmLogin { top: calc(var(--rm-gh) + 16px); transform: translateX(-50%); max-height: calc(100% - var(--rm-gh) - 24px); overflow-y: auto; }
html.rm-mobile.rm-portrait #rmChars { top: calc(var(--rm-gh) + 12px); left: 12px; right: 12px; width: auto; transform: none; max-height: calc(100% - var(--rm-gh) - 24px); }
html.rm-mobile.rm-portrait #rmCreate { top: calc(var(--rm-gh) + 10px); }

/* Celular parado con una ventana propia abierta (Auto Pick, Banco de joyas, Quests, Logros...):
   la ventana se achica para entrar en lo que se ve (DllHud.cpp) y los controles de abajo se
   esconden para poder tocar sus botones. Abajo queda CERRAR VENTANA. */
html.rm-mobile.rm-portrait.rm-pwin #rmStick, html.rm-mobile.rm-portrait.rm-pwin #rmAct,
html.rm-mobile.rm-portrait.rm-pwin #rmGrab, html.rm-mobile.rm-portrait.rm-pwin #rmNpc,
html.rm-mobile.rm-portrait.rm-pwin #rmBlock, html.rm-mobile.rm-portrait.rm-pwin #rmExp,
html.rm-mobile.rm-portrait.rm-pwin #rmChatLog { display: none !important; }
html.rm-mobile.rm-portrait.rm-pwin #rmClose { display: flex; top: auto; bottom: calc(env(safe-area-inset-bottom) + 14px); left: 50%; transform: translateX(-50%); height: 44px; }
