/* LokoOwneD Rework - login screen (owner, 2026-10-09). Full-screen lobby under the nebula (rework.css .rw-cena /
   .rw-vignette / .rw-load + js/lobby.js), the server's logo in the middle, a glass login card below it, and the
   ORIGINAL register form in a centered card that replaces it (js/login.js). No navbar, no footer.
   Markup: rework_login() in core/main/char3d.php. Redesign 2026-10-09 with the ui-ux-pro-max skill: dark glass,
   gold accent of the Rework, orange call to action like the logo, Rajdhani titles + Inter text, 46 px targets. */

body:has(#rw-login) { overflow: hidden; background: #04050c; }
body:has(#rw-login) nav.navbar,
body:has(#rw-login) footer.footer { display: none !important; }
body:has(#rw-login) main[role="main"] { margin: 0 !important; padding: 0 !important; }
body:has(#rw-login) #panel-container { padding: 0 !important; }
/* the 2FA modal lives inside the login card (its Verify button submits the login form): the backdrop goes under the
   card. So the card itself may not get transform / filter / backdrop-filter while visible (the glass blur is on its
   ::before) - otherwise the modal ends up under its own backdrop or squeezed into the card. */
body:has(#rw-login) .modal-backdrop { z-index: 4; }

.rw-login {
  --rwl-text: #eef1f5;
  --rwl-muted: #a3adb8;
  --rwl-line: rgb(255 255 255 / 12%);
  --rwl-line-2: rgb(255 255 255 / 24%);
  --rwl-field: rgb(255 255 255 / 4%);
  --rwl-field-2: rgb(255 255 255 / 7%);
  --rwl-gold: #f1d38a;
  --rwl-ring: rgb(241 211 138 / 22%);
  --rwl-cta-1: #ffc061; --rwl-cta-2: #ff8a2a; --rwl-cta-3: #f0601f; --rwl-cta-ink: #1d0e04;
  --rwl-ok: #3ecf8e; --rwl-bad: #ff6b6b;
  --rwl-title: Rajdhani, Inter, "Segoe UI", Arial, sans-serif;
  color: var(--rwl-text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
.rw-login .rw-cena { background: #04050c; }
.rw-login .rw-vignette { transition: background-color .3s ease; }
.rw-login:not([data-view="login"]) .rw-vignette { background-color: rgb(2 3 8 / 45%); }

/* ---------------------------------------------------------------- logo (game: about 1/3 from the top) */
.rwl-logo {
  position: fixed; z-index: 3; left: 0; right: 0; top: 14vh;
  width: min(680px, 86vw); margin: 0 auto; text-align: center; pointer-events: none;
  animation: rwl-in .9s ease-out backwards; transition: opacity .25s ease;
}
.rw-login:not([data-view="login"]) .rwl-logo { opacity: 0; }
.rwl-logo img { display: block; max-width: 100%; max-height: 28vh; margin: 0 auto; object-fit: contain;
  filter: drop-shadow(0 6px 24px rgb(0 0 0 / 55%)); }
.rwl-logo-text {
  display: inline-block; padding: 0 .1em; font-size: clamp(40px, 8vw, 104px); font-weight: 900; font-style: italic;
  letter-spacing: -.02em; line-height: 1.05; text-transform: uppercase;
  background: linear-gradient(180deg, #ffd27a 0%, #ff8a2a 45%, #e8361c 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 3px 0 #5a1206) drop-shadow(0 8px 22px rgb(0 0 0 / 60%));
}

/* ---------------------------------------------------------------- cards (login + register) */
.rwl-card {
  position: fixed; z-index: 5; margin: 0 auto; padding: 22px 22px 20px; border-radius: 16px;
  color: var(--rwl-text);
  background: linear-gradient(180deg, rgb(18 22 34 / 78%), rgb(8 10 18 / 88%));
  border: 1px solid var(--rwl-line);
  box-shadow: 0 24px 60px rgb(0 0 0 / 55%), inset 0 1px 0 rgb(255 255 255 / 6%);
}
.rwl-card::before {              /* the glass: blur behind the card, on a layer of its own */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
.rwl-card::after {               /* gold-orange accent on the top edge */
  content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--rwl-gold) 30%, var(--rwl-cta-2) 70%, transparent);
}

.rwl-head { margin: 0 0 18px; }
.rwl-head-row { display: flex; align-items: center; gap: 12px; }
.rwl-eyebrow { display: block; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--rwl-gold); opacity: .85; }
.rwl-title { margin: 2px 0 0; font-family: var(--rwl-title); font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: .05em; text-transform: uppercase; color: #fff; }

/* login card: below the station's middle */
/* HORIZONTAL (owner, 2026-10-09 - less of the screen): title on top, then one row: ID | Password | LOGIN | REGISTER.
   .rwl-btns is display: contents, so each button is a column of the grid; hidden ones (Recovery) take no room.
   A second world adds the Server column; phones stack it all (max-width 760px below). */
.rwl-box {
  left: 0; right: 0; bottom: 7vh; width: min(900px, calc(100% - 32px)); padding: 18px 22px 20px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; align-items: end; column-gap: 12px; row-gap: 10px;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear 0s;
}
.rwl-box:has(.rwl-field:not([hidden]) #login-server) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr) auto auto; }
.rwl-box > .rwl-head, .rwl-box > [id='2fa-input'], .rwl-box > .page-login { grid-column: 1 / -1; }
.rwl-box > [id='2fa-input']:empty { display: none; }
.rwl-box .rwl-btns { display: contents; }
.rwl-box .rwl-btn { width: auto; min-width: 140px; }
.rwl-box .rwl-field { position: relative; }
.rwl-box .rwl-caps { position: absolute; left: 0; top: 100%; margin-top: 4px; white-space: nowrap; }
.rw-login:not([data-view="login"]) .rwl-box {
  opacity: 0; visibility: hidden; transform: translateY(12px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.rwl-box .rwl-head { margin: 0 0 2px; display: flex; align-items: baseline; gap: 12px; }
.rwl-box .rwl-head .rwl-title { margin: 0; font-size: 22px; }

/* ---------------------------------------------------------------- fields */
.rwl-field { display: block; margin: 0; }
.rwl-field[hidden] { display: none; }
.rwl-field > label { display: block; margin: 0 0 6px 2px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--rwl-muted); }
.rwl-input { position: relative; display: flex; align-items: center; }
.rwl-input > .rwl-ico { position: absolute; left: 14px; color: var(--rwl-muted); pointer-events: none; transition: color .2s ease; }
.rwl-input:focus-within > .rwl-ico { color: var(--rwl-gold); }
.rwl-input input, .rwl-input select {
  display: block; width: 100%; height: 46px; padding: 0 46px 0 42px; border-radius: 10px;
  background: var(--rwl-field); color: var(--rwl-text); font-size: 15px;
  border: 1px solid var(--rwl-line); box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.rwl-input-select select { padding: 0 14px; }
.rwl-input select option { background: #10141f; color: var(--rwl-text); }
.rwl-input input::placeholder { color: rgb(255 255 255 / 32%); }
.rwl-input input:hover, .rwl-input select:hover { border-color: var(--rwl-line-2); }
.rwl-input input:focus, .rwl-input select:focus { outline: none; border-color: var(--rwl-gold); background: var(--rwl-field-2); box-shadow: 0 0 0 3px var(--rwl-ring); }
.rw-login input:-webkit-autofill { -webkit-text-fill-color: var(--rwl-text); caret-color: var(--rwl-text); box-shadow: 0 0 0 100px #151a26 inset; transition: background-color 9999s; }
.rwl-eye {
  position: absolute; right: 6px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--rwl-muted); cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}
.rwl-eye:hover { color: var(--rwl-text); background: rgb(255 255 255 / 7%); }
.rwl-eye[aria-pressed="true"] { color: var(--rwl-gold); }
.rwl-eye:focus-visible { outline: 2px solid var(--rwl-gold); outline-offset: 1px; }
.rwl-caps { margin: 6px 0 0 2px; font-size: 12px; color: #ffcf6e; }
.rwl-box .page-login { margin: 0 !important; }

/* ---------------------------------------------------------------- buttons */
.rwl-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.rwl-btn {
  position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 46px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 10px;
  font-family: var(--rwl-title); font-size: 17px; font-weight: 700; letter-spacing: .1em; line-height: 1; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, filter .2s ease;
}
.rwl-btn[hidden] { display: none; }
.rwl-btn:focus-visible { outline: 2px solid var(--rwl-gold); outline-offset: 3px; }
.rwl-btn:disabled { opacity: .55; cursor: not-allowed; filter: none; box-shadow: none; }
.rwl-btn-primary {
  color: var(--rwl-cta-ink);
  background: linear-gradient(180deg, var(--rwl-cta-1) 0%, var(--rwl-cta-2) 55%, var(--rwl-cta-3) 100%);
  box-shadow: 0 8px 22px rgb(255 120 40 / 28%), inset 0 1px 0 rgb(255 255 255 / 35%);
}
.rwl-btn-primary:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 10px 28px rgb(255 120 40 / 40%), inset 0 1px 0 rgb(255 255 255 / 40%); }
.rwl-btn-primary:active:not(:disabled) { filter: brightness(.94); }
.rwl-btn-ghost { color: var(--rwl-text); background: var(--rwl-field); border-color: var(--rwl-line); }
.rwl-btn-ghost:hover:not(:disabled) { color: #fff; background: rgb(255 255 255 / 9%); border-color: var(--rwl-line-2); text-decoration: none; }
/* Login busy while the panel answers (js/login.js) */
.rwl-spin { display: none; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgb(29 14 4 / 30%); border-top-color: var(--rwl-cta-ink); animation: rwl-spin .7s linear infinite; }
.rwl-btn.is-busy { pointer-events: none; }
.rwl-btn.is-busy .rwl-btn-label { visibility: hidden; }
.rwl-btn.is-busy .rwl-spin { display: block; }

/* ---------------------------------------------------------------- register card (the original form, restyled) */
.rwl-reg {
  z-index: 6; inset: 0; width: min(560px, calc(100% - 32px)); height: fit-content; max-height: calc(100dvh - 48px);
  margin: auto; overflow-y: auto; padding: 24px;
  animation: rwl-pop .28s ease-out;
}
.rwl-reg[hidden] { display: none; }
.rwl-back {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 10px;
  color: var(--rwl-text); background: var(--rwl-field); border: 1px solid var(--rwl-line); cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.rwl-back:hover { background: rgb(255 255 255 / 9%); border-color: var(--rwl-line-2); }
.rwl-back:focus-visible { outline: 2px solid var(--rwl-gold); outline-offset: 2px; }

#rw-register .reg-form { margin-left: -8px; margin-right: -8px; }
#rw-register .reg-form > [class*="col"] { padding-left: 8px; padding-right: 8px; }
#rw-register .alert {
  margin: 0 0 16px; padding: 10px 14px !important; border-radius: 10px !important; font-size: 13px; line-height: 1.5;
  color: #ece4cc; background: rgb(241 211 138 / 8%); border: 1px solid rgb(241 211 138 / 22%);
}
#rw-register .form-group { margin-bottom: 14px; }
#rw-register label { display: block; margin: 0 0 6px 2px !important; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--rwl-muted); }
#rw-register .input-group { flex-wrap: nowrap; }
#rw-register .input-group-text {
  min-width: 44px; justify-content: center; height: 46px; border-radius: 10px 0 0 10px;
  color: var(--rwl-muted); background: var(--rwl-field); border: 1px solid var(--rwl-line); border-right: 0;
  transition: color .2s ease, border-color .2s ease;
}
#rw-register .form-control {
  height: 46px; border-radius: 0 10px 10px 0; font-size: 15px; color: var(--rwl-text);
  background-color: var(--rwl-field); border: 1px solid var(--rwl-line); box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
#rw-register .form-control::placeholder { color: rgb(255 255 255 / 32%); }
#rw-register .form-control:hover { border-color: var(--rwl-line-2); }
#rw-register .form-control:focus { border-color: var(--rwl-gold); background-color: var(--rwl-field-2); box-shadow: 0 0 0 3px var(--rwl-ring); }
#rw-register .input-group:focus-within .input-group-text { color: var(--rwl-gold); border-color: var(--rwl-gold); }
#rw-register .form-control.is-valid { border-color: var(--rwl-ok); }
#rw-register .form-control.is-invalid { border-color: var(--rwl-bad); }
#rw-register .form-control:disabled { opacity: .55; }
.rwl-terms { display: block; margin: 2px 0 12px; font-size: 13px; color: var(--rwl-muted); }
.rwl-terms a { color: var(--rwl-gold); }
.rwl-reg-captcha:empty { display: none; }
#rw-register .reg-buttons { display: flex; gap: 10px; margin-top: 4px; }
#rw-register .reg-buttons > * { flex: 1 1 0; min-width: 0; }
#rw-register .reg-buttons .btn {   /* Signup (and "Registration Closed") from extend.php: same look as Login */
  height: 46px; margin: 0; border: 0; border-radius: 10px;
  font-family: var(--rwl-title); font-size: 17px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rwl-cta-ink); background: linear-gradient(180deg, var(--rwl-cta-1) 0%, var(--rwl-cta-2) 55%, var(--rwl-cta-3) 100%);
  box-shadow: 0 8px 22px rgb(255 120 40 / 28%), inset 0 1px 0 rgb(255 255 255 / 35%);
  transition: filter .2s ease, box-shadow .2s ease;
}
#rw-register .reg-buttons .btn:hover:not(:disabled) { filter: brightness(1.07); }
#rw-register .reg-buttons .btn:focus-visible { outline: 2px solid var(--rwl-gold); outline-offset: 3px; }
#rw-register .reg-buttons .btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* ---------------------------------------------------------------- bottom-right label, like the game's build string */
.rwl-ver { position: fixed; z-index: 3; right: 8px; bottom: 4px; font-size: 11px; color: rgb(255 255 255 / 55%); text-shadow: 0 1px 2px #000; }

@keyframes rwl-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rwl-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rwl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .rwl-logo, .rwl-reg { animation: none; }
  .rwl-box, .rw-login:not([data-view="login"]) .rwl-box { transition: none; transform: none; }
}

/* touch: 16 px text (no zoom on iOS) */
@media (pointer: coarse) {
  .rwl-input input, .rwl-input select, #rw-register .form-control { font-size: 16px; }
}
@media (max-height: 760px) {
  .rwl-logo { top: 5vh; }
  .rwl-logo img { max-height: 20vh; }
  .rwl-box { bottom: 3vh; }
}
/* phones / narrow: back to a column */
@media (max-width: 760px) {
  .rwl-box { grid-template-columns: minmax(0, 1fr) !important; width: min(380px, calc(100% - 32px)); }
  .rwl-box .rwl-btn { width: 100%; }
  .rwl-box .rwl-head { display: block; }
  .rwl-box .rwl-caps { position: static; }
}

/* ---------------------------------------------------------------- login OK (RWLogin.enter in js/lobby.js) */
/* the card goes away, the screen goes dark while the camera zooms into the tower (duration from lobby.js) */
.rw-login.is-entering .rwl-box { animation: rwl-out .3s ease-in forwards; pointer-events: none; }
@keyframes rwl-out { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }
.rwl-fade { position: fixed; inset: 0; z-index: 2000; background: #000; opacity: 0; pointer-events: none; transition: opacity 1.8s cubic-bezier(.55, 0, .9, .45); }
.rwl-fade.is-on { opacity: 1; }

/* ---------------------------------------------------------------- register: prefix (2026-10-09) */
.rwl-opt { font-weight: 500; letter-spacing: 0; text-transform: none; color: rgb(255 255 255 / 45%); }

#rw-register .rwl-prefix {
  min-width: 58px; font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 16px; font-weight: 700;
  letter-spacing: .08em; color: var(--rwl-gold); text-transform: lowercase;
}
#rw-register .rwl-prefix.is-new { animation: rwl-prefix .3s ease-out; }
@keyframes rwl-prefix { 0% { color: #fff; text-shadow: 0 0 12px var(--rwl-gold); } 100% { color: var(--rwl-gold); text-shadow: none; } }
#rw-register .rwl-prefix-group .rwl-reroll {
  border-radius: 0; min-width: 42px; cursor: pointer; color: var(--rwl-muted);
  border-left: 1px solid var(--rwl-line);
}
#rw-register .rwl-prefix-group .rwl-reroll:hover { color: var(--rwl-gold); background: rgb(255 255 255 / 8%); }
#rw-register .rwl-prefix-group .rwl-reroll:focus-visible { outline: 2px solid var(--rwl-gold); outline-offset: -2px; }
#rw-register .rwl-prefix-group .rwl-reroll[aria-disabled="true"] .fa { animation: rwl-spin .3s linear; }
.rwl-login-preview { display: block; margin: 6px 0 0 2px; font-size: 12px; color: var(--rwl-muted); }
.rwl-login-preview b { font-family: Consolas, "SFMono-Regular", Menlo, monospace; color: var(--rwl-text); letter-spacing: .04em; }
.rwl-login-preview [data-prefix] { color: var(--rwl-gold); }
@media (prefers-reduced-motion: reduce) {
  #rw-register .rwl-prefix.is-new, #rw-register .rwl-prefix-group .rwl-reroll[aria-disabled="true"] .fa { animation: none; }
}
/* the original e-mail group is "form-group input-group" (label beside the field): stack it like the others */
#rw-register .form-group.input-group { display: block; }

/* ---------------------------------------------------------------- Beta notice before the register form (2026-10-09) */
/* card in the middle, same glass as the others; js/login.js shows it on REGISTER, "Criar conta nova" opens the form */
.rwl-note {
  z-index: 6; inset: 0; width: min(440px, calc(100% - 32px)); height: fit-content; margin: auto; padding: 28px 24px 22px;
  text-align: center; animation: rwl-pop .28s ease-out;
}
.rwl-note[hidden] { display: none; }
.rwl-note-ico {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  color: var(--rwl-gold); background: rgb(241 211 138 / 10%); border: 1px solid rgb(241 211 138 / 30%);
}
.rwl-note-ico .rwl-ico { width: 28px; height: 28px; }
.rwl-note-text { margin: 10px 0 22px; font-size: 16px; line-height: 1.6; color: var(--rwl-text); }
.rwl-note-btns { display: flex; gap: 10px; }
.rwl-note-btns .rwl-btn { flex: 1 1 0; min-width: 0; font-size: 15px; letter-spacing: .06em; }
@media (max-width: 420px) { .rwl-note-btns { flex-direction: column-reverse; } }
@media (prefers-reduced-motion: reduce) { .rwl-note { animation: none; } }
