:root {
  color-scheme: only light;
  font-family: "Nunito Sans", sans-serif;
  --cream: #fff6d5;
  --gold: #ffd977;
  --gold-deep: #a76217;
  --red: #951e15;
  --ink: #33261f;
}

* { box-sizing: border-box; }

html, body { min-width: 320px; min-height: 100%; margin: 0; }

body { overflow-x: hidden; background: #192844; color: var(--ink); }

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.scene {
  position: relative;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  place-items: center;
  background: #1f3150;
}

.castle-plane {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -2;
  width: max(100vw, 177.68vh);
  aspect-ratio: 1672 / 941;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(to bottom, rgba(18, 38, 76, 0.08), rgba(12, 22, 39, 0.2)),
    url("/img/auth/castle-dawn.webp") center / 100% 100% no-repeat;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 43%, transparent 20%, rgba(17, 24, 43, 0.1) 58%, rgba(9, 14, 26, 0.5) 125%);
}

.sky-glow {
  position: absolute;
  top: 14%;
  left: 50%;
  width: min(70vw, 960px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 232, 177, 0.22), transparent 66%);
  animation: breathe 5s ease-in-out infinite;
  pointer-events: none;
}

.language-picker {
  position: fixed;
  top: clamp(12px, 2vw, 24px);
  right: clamp(12px, 2vw, 26px);
  z-index: 20;
  display: flex;
  overflow: hidden;
  padding: 3px;
  border: 1px solid rgba(74, 43, 18, 0.65);
  border-radius: 13px;
  background: rgba(64, 36, 18, 0.72);
  box-shadow: 0 5px 20px rgba(10, 17, 30, 0.3), inset 0 1px rgba(255,255,255,.3);
  backdrop-filter: blur(6px);
}

.language-picker__button {
  min-width: 42px;
  min-height: 34px;
  padding: 4px 10px;
  border: 0;
  border-right: 1px solid rgba(123, 72, 20, 0.24);
  background: #ffe4a0;
  color: #49301f;
  cursor: pointer;
  font-weight: 800;
  transition: background .2s, color .2s, transform .2s;
}

.language-picker__button:last-child { border-right: 0; }
.language-picker__button:hover { background: #fff4c9; }
.language-picker__button:active { transform: translateY(1px); }
.language-picker__button.is-active { background: #ffc95e; color: #691e16; }
.language-picker__button--chat { min-width: 72px; }
.language-picker small { font-size: .69em; }

.portal {
  position: relative;
  width: min(96vw, 720px);
  height: min(96vw, 720px);
  max-height: 92svh;
  display: grid;
  place-items: center;
  margin-block: 3.5rem 1.5rem;
}

.portal__content {
  position: relative;
  z-index: 5;
  width: min(78%, 438px);
  transform: translateY(9px);
}

.magic-circle {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: auto;
  border-radius: 50%;
  pointer-events: none;
  filter: drop-shadow(0 0 13px rgba(255, 236, 172, 0.52));
}

.magic-circle__halo {
  position: absolute;
  inset: 4.8%;
  border: 2px solid rgba(255, 245, 194, 0.75);
  border-radius: 50%;
  box-shadow:
    0 0 5px #fff,
    0 0 16px rgba(255, 224, 122, .95),
    0 0 48px rgba(255, 188, 73, .35),
    inset 0 0 22px rgba(255, 224, 122, .2);
  animation: halo-pulse 3.6s ease-in-out infinite;
}

.magic-circle__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: center;
}

.magic-circle__ring--outer { animation: spin 42s linear infinite; }
.magic-circle__ring--middle { animation: spin-reverse 58s linear infinite; }
.magic-circle__ring--inner { animation: spin 78s linear infinite; }

.ring-line, .sigil {
  fill: none;
  stroke: rgba(255, 239, 177, .92);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.ring-line--thin { stroke-width: 1.4; opacity: .78; }
.ring-line--hairline { stroke-width: 1; opacity: .6; }
.ring-line--faint { stroke-width: 1.5; opacity: .55; }
.ring-line--ticks { stroke-width: 8; stroke-dasharray: 2 20; stroke-linecap: round; opacity: .76; }
.ring-line--ticks-small { stroke-width: 5; stroke-dasharray: 2 13; opacity: .5; }
.ring-line--dashed { stroke-width: 1.6; stroke-dasharray: 14 7 2 7; opacity: .66; }
.sigil { stroke-width: 2; opacity: .72; }
.sigil--soft { opacity: .31; }
.nodes circle { fill: #fff7c9; filter: drop-shadow(0 0 5px #ffd45e); }
.arcane-spokes { fill: none; stroke: rgba(255, 239, 177, .76); stroke-width: 2; filter: drop-shadow(0 0 4px rgba(255, 215, 96, .8)); }

.runes {
  fill: #fff5c6;
  font-family: "Segoe UI Symbol", "Noto Sans Runic", serif;
  font-size: 19px;
  letter-spacing: 2px;
}
.runes--inner { font-size: 16px; letter-spacing: 5px; opacity: .85; }

.magic-circle__particles { position: absolute; inset: 0; }
.magic-circle__particles i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fffbd4;
  box-shadow: 0 0 8px 3px #ffe19a;
  animation: sparkle 3.5s var(--delay) ease-in-out infinite;
}

.brand {
  position: relative;
  z-index: 2;
  width: min(130%, 560px);
  /* wider than the card, so auto margins left it hanging to the right: its left edge goes to the card's middle and
     it moves back by half of itself. 51%, not 50%: the whole picture, knight included, centred over the card
     (its outline and its weight both centre at 51% of its width) */
  margin: -80px 0 -54px 50%;
  transform: translateX(-51%);
}

.brand__logo {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 3px rgba(55, 9, 7, .42));
}

.mini-badge {
  display: inline-grid;
  place-items: center;
  border: 2px solid #681a10;
  border-radius: 7px;
  background: linear-gradient(#ffd955, #e77d11);
  color: #7c1e13;
  font-weight: 900;
  transform: rotate(5deg);
  box-shadow: inset 0 1px #fff4b0;
}

.login-card {
  position: relative;
  padding: 11px;
  border: 3px solid #8c5119;
  border-radius: 35px 35px 24px 24px;
  background: linear-gradient(135deg, #c99745, #fff0ad 22%, #a96820 48%, #f6d47d 75%, #7f4618);
  box-shadow: 0 12px 30px rgba(29, 20, 18, .48), inset 0 0 0 2px #fff0a9;
}

.login-card::before, .login-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 22px;
  width: 42px;
  height: 74%;
  border: 5px double #bf8535;
  border-radius: 60% 20%;
  background: #e7b85b;
  box-shadow: 0 0 0 2px #794218;
}
.login-card::before { left: -24px; transform: rotate(-7deg); }
.login-card::after { right: -24px; transform: rotate(7deg) scaleX(-1); }

.login-card__body {
  padding: 25px clamp(18px, 5vw, 36px) 19px;
  border: 2px solid rgba(125, 79, 26, .75);
  border-radius: 25px 25px 16px 16px;
  background:
    linear-gradient(rgba(255,255,255,.25), transparent 24%),
    #fff7dc;
  box-shadow: inset 0 0 24px rgba(174, 111, 29, .16);
}

.login-card__ornament {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: -13px;
  translate: -50%;
  color: #f9dc78;
  text-shadow: 0 1px #7b3d16, 0 0 0 4px #b67827;
  font-size: 1.25rem;
}

.login-card__eyebrow {
  margin: 0 0 3px;
  color: #9b632b;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-align: center;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #392117;
  font-family: "Cinzel", serif;
  font-size: clamp(1.55rem, 5vw, 2.05rem);
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.mini-badge { padding: 2px 5px; font-family: "Nunito Sans", sans-serif; font-size: .54em; vertical-align: middle; }
.login-card__intro { margin: 6px 0 17px; font-size: .89rem; text-align: center; }
form label { display: block; margin: 9px 0 5px; font-size: .81rem; font-weight: 800; }

.input-shell {
  display: flex;
  align-items: center;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid #b49a68;
  border-radius: 9px;
  background: rgba(255,255,255,.86);
  box-shadow: inset 0 1px 4px rgba(71, 49, 23, .12), 0 1px #fff;
  transition: border-color .2s, box-shadow .2s;
}

.input-shell:focus-within { border-color: #3685a2; box-shadow: 0 0 0 3px rgba(60, 147, 179, .18), inset 0 1px 4px rgba(71,49,23,.1); }
.input-shell > span { padding-left: 12px; color: #9f7744; font-size: .82rem; }
.input-shell input { flex: 1; min-width: 0; padding: 8px 10px; border: 0; outline: 0; background: transparent; color: #33261f; }

.password-toggle {
  align-self: stretch;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: #765e2d;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
}
.password-toggle:hover { color: #9b361e; }

.signup { margin: 13px 0 11px; font-size: .8rem; text-align: center; }
.signup a { color: #7a3b24; font-weight: 800; text-underline-offset: 3px; }
.form-message { min-height: 1.1em; margin: 7px 0 -5px; color: #a62d23; font-size: .74rem; font-weight: 800; text-align: center; }

.start-button {
  position: relative;
  width: 100%;
  min-height: 54px;
  padding: 4px;
  border: 3px solid #8c2417;
  border-radius: 17px;
  background: linear-gradient(#ffdf54, #ff9d0b 58%, #dc5811 59%);
  box-shadow: inset 0 0 0 3px #ffca2e, inset 0 2px #fff4a5, 0 4px 0 #65180f, 0 7px 12px rgba(80,25,11,.28);
  color: #6f1c15;
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-size: clamp(1.2rem, 4.5vw, 1.65rem);
  font-weight: 800;
  text-transform: uppercase;
  text-shadow: 0 1px #fff2a6;
  transition: filter .2s, transform .15s, box-shadow .15s;
}
.start-button::after { content: ""; position: absolute; inset: 7px 14px auto; height: 10px; border-radius: 50%; background: rgba(255,255,255,.37); filter: blur(3px); }
.start-button:hover { filter: brightness(1.08) saturate(1.08); }
.start-button:active { transform: translateY(3px); box-shadow: inset 0 0 0 3px #ffca2e, inset 0 2px #fff4a5, 0 1px 0 #65180f; }

.flags { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.flag { position: absolute; width: 88px; height: 105px; transform: translate(-2px, -100%) scale(var(--scale)); transform-origin: bottom left; }
.flag--far-left { left: 9.05%; top: 31.15%; }
.flag--mid-left { left: 20.9%; top: 24.6%; }
.flag--left { left: 37.65%; top: 4.55%; }
.flag--right { left: 62.62%; top: 4.55%; }
.flag--mid-right { left: 78.77%; top: 24.6%; }
.flag--far-right { left: 90.9%; top: 31.15%; }
.flag__pole { position: absolute; left: 1px; bottom: 0; width: 4px; height: 82px; border-radius: 5px; background: linear-gradient(90deg, #3f2518, #c58c3e 50%, #392016); box-shadow: 1px 0 1px rgba(0,0,0,.25); }
.flag__pole::before { content: ""; position: absolute; top: -6px; left: -3px; width: 10px; height: 10px; border-radius: 50%; background: #d8a64e; box-shadow: inset -2px -2px #6b391b; }
.flag__cloth {
  position: absolute;
  left: 4px;
  top: 24px;
  width: 72px;
  height: 34px;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 9%, 84% 50%, 100% 91%, 0 80%);
  background: linear-gradient(100deg, #75151b 0%, #d8482f 45%, #9b2021 78%, #cf3928 100%);
  box-shadow: inset 0 5px 8px rgba(255,196,115,.3), inset 0 -8px 9px rgba(72,5,13,.3);
  transform-origin: left center;
  animation: flag-wave 1.35s var(--delay) cubic-bezier(.45,.05,.55,.95) infinite alternate;
}
.flag__cloth::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 20%, rgba(255,211,135,.46) 39%, rgba(74,4,12,.22) 55%, transparent 72%); animation: flag-shine 1.35s var(--delay) ease-in-out infinite alternate; }
.flag__cloth b { position: absolute; top: -8%; bottom: -8%; width: 34%; border-radius: 50%; background: linear-gradient(90deg, transparent, rgba(255,220,154,.18), transparent); mix-blend-mode: screen; animation: cloth-ripple 1.35s var(--delay) ease-in-out infinite alternate; }
.flag__cloth b:nth-child(1) { left: 0; }
.flag__cloth b:nth-child(2) { left: 31%; animation-delay: calc(var(--delay) - .16s); }
.flag__cloth b:nth-child(3) { left: 62%; animation-delay: calc(var(--delay) - .32s); }

.sound-hint {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 10;
  margin: 0;
  translate: -50%;
  color: rgba(255, 246, 210, .8);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-align: center;
  text-shadow: 0 2px 5px #172137;
  text-transform: uppercase;
}

.auth-legal {
  position: fixed;
  left: 50%;
  bottom: max(34px, env(safe-area-inset-bottom));
  z-index: 11;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  width: min(100%, calc(100vw - 20px));
  margin: 0;
  padding: 0 8px;
  translate: -50%;
  text-align: center;
}
.auth-legal a {
  color: #fff6d5;
  font-size: .72rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 2px 5px #172137;
}
.auth-legal__sep {
  color: rgba(255, 246, 213, .55);
  font-size: .72rem;
  font-weight: 800;
  user-select: none;
}
.auth-legal a:focus-visible { outline: 3px solid #fff6d5; outline-offset: 4px; border-radius: 2px; }
@media (max-width: 520px) {
  .auth-legal {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: max(52px, calc(env(safe-area-inset-bottom) + 40px));
    flex-direction: column;
    gap: 6px;
  }
  .auth-legal__sep { display: none; }
  .auth-legal a { font-size: .68rem; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-reverse { to { transform: rotate(-360deg); } }
@keyframes halo-pulse { 50% { opacity: .76; box-shadow: 0 0 9px #fff, 0 0 27px rgba(255,224,122,.95), 0 0 62px rgba(255,188,73,.42), inset 0 0 32px rgba(255,224,122,.27); } }
@keyframes sparkle { 0%, 100% { opacity: 0; transform: scale(.3) translateY(9px); } 42% { opacity: 1; transform: scale(1.25) translateY(-6px); } }
@keyframes breathe { 50% { opacity: .7; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes flag-wave { 0% { transform: perspective(140px) rotateY(-22deg) skewY(-3deg) scaleX(.84); } 52% { transform: perspective(140px) rotateY(6deg) skewY(2deg) scaleX(1.01); } 100% { transform: perspective(140px) rotateY(-10deg) skewY(-1deg) scaleX(.93); } }
@keyframes flag-shine { from { translate: -11px 0; } to { translate: 17px 0; } }
@keyframes cloth-ripple { from { transform: translateY(-2px) skewY(-7deg) scaleY(.86); } to { transform: translateY(2px) skewY(7deg) scaleY(1.12); } }

@media (max-aspect-ratio: 4/5) {
  .portal { width: min(104vw, 680px); height: min(104vw, 680px); margin-top: 4rem; }
  .portal__content { width: min(76%, 410px); }
  .flags { opacity: .82; }
  .flag--far-left, .flag--mid-left, .flag--mid-right, .flag--far-right { display: none; }
}

@media (max-width: 520px) {
  .portal { width: 100vw; height: min(118vw, 590px); max-height: none; min-width: 0; }
  .portal__content { width: min(86vw, 380px); min-width: 0; transform: translateY(4px); }
  .magic-circle {
    inset: 50% auto auto 50%;
    width: 118vw;
    height: 118vw;
    max-width: 590px;
    max-height: 590px;
    opacity: .87;
    transform: translate(-50%, -50%);
  }
  .login-card { padding: 8px; border-radius: 28px 28px 20px 20px; }
  .login-card__body { padding: 18px 18px 14px; }
  .brand { width: min(112%, 420px); margin: -52px 0 -35px 50%; }
  .login-card__eyebrow { display: none; }
  .login-card__intro { margin-bottom: 10px; }
  .start-button { min-height: 49px; }
  .sound-hint { display: none; }
}

@media (max-height: 700px) and (min-width: 600px) {
  .portal { width: 630px; height: 630px; transform: scale(.9); margin-block: -1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .magic-circle__ring--outer { transform: rotate(12deg); }
  .magic-circle__ring--middle { transform: rotate(-9deg); }
  .magic-circle__ring--inner { transform: rotate(-8deg); }
}

/* ---- marco, menú de idioma, retratos y páginas altas ---- */
/* ---- Variante 2: marco ornamentado ---- */
.login-card {
  padding: 14px;
  border: 3px solid #4a230a;
  border-radius: 30px 30px 22px 22px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #fff3b8 0%, #eab752 16%, #9a5a17 38%, #f7d77a 55%, #c07c26 74%, #6b3610 100%);
  box-shadow:
    0 0 0 2px #2a1305,
    0 0 26px 6px rgba(255, 210, 100, .38),
    0 20px 40px rgba(18, 9, 4, .6),
    inset 0 0 0 2px #fff0a9,
    inset 0 -4px 6px rgba(70, 30, 6, .45),
    inset 0 3px 3px rgba(255, 250, 220, .6);
  animation: frame-glow 4s ease-in-out infinite;
}

/* reemplaza las "orejas" laterales por un brillo que recorre el marco */
.login-card::before {
  left: -3px; right: -3px; top: -3px; bottom: -3px;
  width: auto; height: auto;
  z-index: 3;
  padding: 17px;
  border: 0;
  border-radius: inherit;
  transform: none;
  box-shadow: none;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,235,.85) 50%, transparent 58%) 0 0 / 300% 100% no-repeat;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: frame-shine 7s ease-in-out infinite;
}
.login-card::after { display: none; }

.login-card__body {
  position: relative;
  border: 2px solid #6e3c12;
  border-radius: 20px 20px 13px 13px;
  background:
    radial-gradient(ellipse at 50% -10%, #fffdf1 0%, transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(214, 160, 70, .22), transparent 60%),
    #fbf0cc;
  box-shadow:
    0 0 0 2px #f6dc8e,
    0 0 0 4px rgba(74, 35, 10, .55),
    inset 0 0 28px rgba(160, 100, 28, .28),
    inset 0 2px 0 rgba(255,255,255,.7);
}

.frame-corner {
  position: absolute;
  z-index: 4;
  width: 64px;
  height: 64px;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(40, 15, 3, .5));
}
.frame-corner--tl { top: -10px; left: -10px; }
.frame-corner--tr { top: -10px; right: -10px; transform: scaleX(-1); }
.frame-corner--bl { bottom: -10px; left: -10px; transform: scaleY(-1); }
.frame-corner--br { bottom: -10px; right: -10px; transform: scale(-1, -1); }

.frame-gem {
  position: absolute;
  z-index: 4;
  width: 20px;
  height: 20px;
  border: 3px solid #f2c45a;
  border-radius: 4px;
  background: radial-gradient(circle at 35% 30%, #ffb4a0, #e2382a 40%, #5c0b0b);
  box-shadow: 0 0 0 2px #3d1d08, 0 0 10px rgba(255, 90, 60, .55), inset 0 0 3px rgba(255,255,255,.6);
  transform: rotate(45deg);
}
.frame-gem--left { left: -11px; top: 50%; margin-top: -10px; }
.frame-gem--right { right: -11px; top: 50%; margin-top: -10px; }
.frame-gem--bottom { left: 50%; bottom: -13px; margin-left: -10px; width: 22px; height: 22px; }
.frame-gem::after {
  content: ""; position: absolute; top: 2px; left: 3px; width: 5px; height: 5px;
  border-radius: 50%; background: rgba(255,255,255,.85);
}

@keyframes frame-shine { 0%, 55% { background-position: 120% 0; } 100% { background-position: -20% 0; } }
@keyframes frame-glow { 50% { box-shadow: 0 0 0 2px #2a1305, 0 0 36px 10px rgba(255, 214, 110, .5), 0 20px 40px rgba(18, 9, 4, .6), inset 0 0 0 2px #fff0a9, inset 0 -4px 6px rgba(70, 30, 6, .45), inset 0 3px 3px rgba(255, 250, 220, .6); } }

@media (max-width: 520px) {
  .login-card { padding: 10px; border-radius: 26px 26px 18px 18px; }
  .login-card::before { padding: 13px; }
  .frame-corner { width: 48px; height: 48px; }
  .frame-corner--tl, .frame-corner--tr { top: -8px; }
  .frame-corner--bl, .frame-corner--br { bottom: -8px; }
  .frame-corner--tl, .frame-corner--bl { left: -8px; }
  .frame-corner--tr, .frame-corner--br { right: -8px; }
  .frame-gem { width: 16px; height: 16px; }
  .frame-gem--left { left: -9px; margin-top: -8px; }
  .frame-gem--right { right: -9px; margin-top: -8px; }
}

/* el logo siempre por encima del marco, esquinas y gemas */
.brand { z-index: 10; }

/* ---- textos del formulario ---- */
.login-card__intro { margin-bottom: 12px; }
.form-message:empty { min-height: 0; margin: 0; }
.signup { margin: 8px 0 12px; }
/* no "create an account" line in between (the staff login): the button keeps away from the password */
.form-message + .start-button { margin-top: 16px; }

/* ---- selector de idioma: globo + menú ---- */
.lang-menu { position: fixed; top: clamp(12px, 2vw, 24px); right: clamp(12px, 2vw, 26px); z-index: 30; }
.lang-menu__toggle {
  display: flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 5px 12px 5px 6px;
  border: 2px solid #4a230a; border-radius: 999px;
  background: linear-gradient(#ffe9a8, #f2c45a 55%, #c98a2c);
  box-shadow: 0 0 0 2px rgba(255, 240, 180, .55), 0 4px 0 #6b3610, 0 8px 16px rgba(10, 17, 30, .35), inset 0 2px #fff6cc;
  color: #4a230a; cursor: pointer; font-weight: 900; letter-spacing: .04em;
  transition: transform .15s, box-shadow .15s, filter .2s;
}
.lang-menu__toggle:hover { filter: brightness(1.06); }
.lang-menu__toggle:active { transform: translateY(3px); box-shadow: 0 0 0 2px rgba(255,240,180,.55), 0 1px 0 #6b3610, inset 0 2px #fff6cc; }
.lang-menu__toggle:focus-visible, .lang-menu__item:focus-visible { outline: 3px solid #3c93b3; outline-offset: 2px; }
.lang-menu__chevron { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.lang-menu.is-open .lang-menu__chevron { transform: rotate(180deg); }

.lang-menu__list {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 190px; margin: 0; padding: 6px; list-style: none;
  border: 2px solid #4a230a; border-radius: 14px;
  background: #fbf0cc;
  box-shadow: 0 0 0 3px #f2c45a, 0 0 0 5px #4a230a, 0 14px 30px rgba(10, 17, 30, .45);
  animation: menu-in .16s ease-out;
}
.lang-menu__list[hidden] { display: none; }
.lang-menu__item {
  text-decoration: none;
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 9px;
  background: transparent; color: #33261f; cursor: pointer; font-weight: 700; text-align: left;
}
.lang-menu__item b { min-width: 30px; padding: 2px 0; border-radius: 6px; background: #f2dca0; color: #6b3610; font-size: .78rem; text-align: center; }
.lang-menu__item small { color: #9b632b; font-size: .72em; }
.lang-menu__item:hover { background: #f6e3ae; }
.lang-menu__item[aria-checked="true"] { background: #f2c45a; color: #4a230a; }
.lang-menu__item[aria-checked="true"] b { background: #951e15; color: #fff3c4; }
.lang-menu__item[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: #951e15; font-weight: 900; }

@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

/* separa el contenido de la tarjeta del logo que la monta por arriba */
.login-card__body { padding-top: 46px; }
@media (max-width: 520px) { .login-card__body { padding-top: 34px; } }

/* el pie del servidor también se ve en móvil */
@media (max-width: 520px) {
  .sound-hint { display: block; bottom: max(10px, env(safe-area-inset-bottom)); font-size: .62rem; letter-spacing: .1em; white-space: nowrap; }
}

/* globo ilustrado (reemplaza el SVG) */
.lang-menu__toggle { padding-left: 4px; }
.lang-menu__globe-img {
  width: 40px; height: 40px; margin: -6px 0 -6px -4px;
  filter: drop-shadow(0 2px 2px rgba(40, 15, 3, .45));
  transition: transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.lang-menu__toggle:hover .lang-menu__globe-img, .lang-menu.is-open .lang-menu__globe-img { transform: rotate(-18deg) scale(1.08); }

/* ---- círculo mágico en azul claro ---- */
.magic-circle { filter: drop-shadow(0 0 13px rgba(140, 210, 255, .6)); }
.magic-circle__halo {
  border-color: rgba(205, 238, 255, .8);
  box-shadow: 0 0 5px #fff, 0 0 16px rgba(120, 200, 255, .95), 0 0 48px rgba(70, 160, 255, .38), inset 0 0 22px rgba(120, 200, 255, .22);
  animation-name: halo-pulse-blue;
}
.ring-line, .sigil { stroke: rgba(200, 236, 255, .92); }
.arcane-spokes { stroke: rgba(200, 236, 255, .78); filter: drop-shadow(0 0 4px rgba(110, 190, 255, .85)); }
.nodes circle { fill: #eaf8ff; filter: drop-shadow(0 0 5px #6cc4ff); }
.runes { fill: #e2f5ff; }
.magic-circle__particles i { background: #f0faff; box-shadow: 0 0 8px 3px #8fd0ff; }
@keyframes halo-pulse-blue { 50% { opacity: .76; box-shadow: 0 0 9px #fff, 0 0 27px rgba(120, 200, 255, .95), 0 0 62px rgba(70, 160, 255, .45), inset 0 0 32px rgba(120, 200, 255, .3); } }

/* =========================================================
   Celular: vertical y horizontal
   ========================================================= */

/* lo que no quepa debe poder alcanzarse con scroll (teclado abierto, pantallas bajas) */
.scene { overflow: clip; }  /* recorta decoraciones; con min-height la escena crece si el formulario no cabe */

/* ---- vertical ---- */
@media (orientation: portrait) and (max-width: 520px) {
  .scene { grid-template-rows: 1fr auto; padding-top: env(safe-area-inset-top); }
  .portal { height: auto; min-height: min(118vw, 590px); margin-block: 3.75rem .5rem; }
  .sound-hint { position: static; translate: none; margin: 0 0 max(12px, env(safe-area-inset-bottom)); }
}
/* teléfonos bajos (iPhone SE, 360×640…) */
@media (orientation: portrait) and (max-width: 520px) and (max-height: 680px) {
  .portal { margin-block: 3.25rem .25rem; }
  .brand { width: min(100%, 330px); margin: -44px 0 -30px 50%; }
  .login-card__body { padding: 28px 16px 12px; }
  .login-card__intro { margin: 2px 0 6px; font-size: .82rem; }
  form label { margin: 6px 0 4px; }
  .input-shell { min-height: 38px; }
  .signup { margin: 6px 0 8px; }
  .start-button { min-height: 44px; }
}

/* ---- horizontal: logo a la izquierda, tarjeta a la derecha ---- */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --land-w: min(calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)), 920px); --land-card: 340px; --land-gap: 32px; }

  .scene { min-height: 100svh; place-items: center; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
  .portal { width: var(--land-w); height: auto; max-height: none; min-height: calc(100svh - 20px); margin: 0; transform: none; }

  .portal__content {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr var(--land-card);
    gap: var(--land-gap);
    align-items: center;
    transform: none;
  }
  .brand { width: 100%; max-width: 400px; margin: 0 auto; transform: none; }

  /* círculo centrado detrás de la tarjeta */
  .magic-circle {
    inset: auto;
    top: 50%;
    left: calc(50% + var(--land-w) / 2 - var(--land-card) / 2);
    width: min(118svh, 520px);
    height: min(118svh, 520px);
    translate: -50% -50%;
    opacity: .9;
  }

  /* tarjeta compacta: ya no tiene el logo encima */
  .login-card { padding: 10px; }
  .login-card::before { padding: 13px; }
  .login-card__body { padding: 16px 20px 12px; }
  h1 { font-size: 1.45rem; }
  .login-card__intro { margin: 2px 0 6px; font-size: .8rem; }
  form label { margin: 6px 0 4px; font-size: .78rem; }
  .input-shell { min-height: 38px; }
  .signup { margin: 6px 0 8px; font-size: .76rem; }
  .start-button { min-height: 44px; font-size: 1.25rem; }
  .frame-corner { width: 48px; height: 48px; }
  .frame-gem { width: 16px; height: 16px; }
  .frame-gem--left { left: -9px; margin-top: -8px; }
  .frame-gem--right { right: -9px; margin-top: -8px; }

  /* idioma arriba a la izquierda para no chocar con la tarjeta */
  .lang-menu { top: 10px; right: auto; left: max(12px, env(safe-area-inset-left)); }
  .lang-menu__list { right: auto; left: 0; }
  .lang-menu__toggle { min-height: 40px; }

  /* pie centrado bajo el logo */
  .sound-hint {
    display: block;
    left: calc(50% - (var(--land-card) + var(--land-gap)) / 2);
    bottom: max(8px, env(safe-area-inset-bottom));
    font-size: .6rem;
    white-space: nowrap;
  }
  .flags { opacity: .8; }
}
/* horizontal muy bajo (iPhone SE: 568×320) */
@media (orientation: landscape) and (max-height: 340px) {
  :root { --land-card: 310px; --land-gap: 20px; }
  .login-card__intro { display: none; }
  .login-card__body { padding: 12px 16px 10px; }
  h1 { font-size: 1.25rem; margin-bottom: 4px; }
  .input-shell { min-height: 34px; }
  .start-button { min-height: 40px; }
}


/* =========================================================
   Formularios: registro y recuperación
   ========================================================= */
.h1--small { font-size: clamp(1.25rem, 4.4vw, 1.6rem); }
h1:focus { outline: none; }

.field-hint { margin: 4px 2px 0; color: #7b6440; font-size: .72rem; line-height: 1.35; }
.field-hint--center { text-align: center; }
.input-shell.is-invalid { border-color: #b8322a; box-shadow: 0 0 0 3px rgba(184, 50, 42, .15); }

.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.label-row label { margin-bottom: 5px; }
.forgot-link { color: #7a3b24; font-size: .74rem; font-weight: 800; text-underline-offset: 3px; white-space: nowrap; }
.forgot-link:hover { color: #9b361e; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row > div { min-width: 0; }

.avatar-picker { min-width: 0; margin: 10px 0 0; padding: 0; border: 0; }
.avatar-picker legend { padding: 0; margin-bottom: 5px; font-size: .81rem; font-weight: 800; }
.avatar-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #c99745 transparent;
}
.avatar-option { position: relative; flex: none; scroll-snap-align: start; cursor: pointer; }
.avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-option img {
  display: block; width: 48px; height: 48px; border-radius: 10px; object-fit: cover;
  border: 2px solid #b49a68; box-shadow: 0 1px 3px rgba(71, 49, 23, .25);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.avatar-option:hover img { transform: translateY(-2px); }
.avatar-option input:checked + img { border-color: #951e15; box-shadow: 0 0 0 3px #f2c45a, 0 0 0 5px #4a230a, 0 4px 8px rgba(71, 49, 23, .35); }
.avatar-option input:focus-visible + img { outline: 3px solid #3c93b3; outline-offset: 3px; }

.signup--after { margin: 12px 0 0; }
.signup--after a, .link-button { color: #7a3b24; font-weight: 800; text-underline-offset: 3px; }
.link-button { padding: 0; border: 0; background: none; cursor: pointer; text-decoration: underline; }
.link-button:disabled { color: #a08a6a; cursor: default; text-decoration: none; }

.start-button--link { display: grid; place-items: center; text-decoration: none; font-size: clamp(1rem, 4.2vw, 1.3rem); line-height: 1.1; padding-inline: 14px; }

.sent-state { text-align: center; }
.sent-state .login-card__intro { margin-bottom: 10px; }
.sent-state b { overflow-wrap: anywhere; }
.seal {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 10px;
  border: 3px solid #4a230a; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffb4a0, #c9302a 45%, #6b0f0f);
  box-shadow: 0 0 0 3px #f2c45a, 0 0 0 5px #4a230a, 0 6px 12px rgba(71, 30, 10, .35);
  color: #fff3c4; font-size: 1.8rem; text-shadow: 0 1px 2px rgba(0,0,0,.4);
  animation: seal-in .45s cubic-bezier(.3, 1.6, .5, 1);
}
.seal--ok { background: radial-gradient(circle at 35% 30%, #c9f5a0, #4c9a2a 45%, #22520f); }
.seal--key { width: 56px; height: 56px; font-size: 1.5rem; background: radial-gradient(circle at 35% 30%, #fff1b8, #e0a83a 45%, #8a4f12); }
.pass-rules { list-style: none; margin: 8px 2px 2px; padding: 0; display: grid; gap: 4px; font-size: .78rem; color: #7b6440; }
.pass-rules li { display: flex; align-items: center; gap: 7px; transition: color .2s; }
.pass-rules li::before {
  content: ""; flex: none; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid #c9a46a; background: #fff8e6; box-sizing: border-box; transition: background .2s, border-color .2s;
}
.pass-rules li.is-ok { color: #2f6d16; font-weight: 700; }
.pass-rules li.is-ok::before {
  border-color: #3f8a22; background: #4c9a2a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5 7 11l5-6' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}
@keyframes seal-in { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }

/* las páginas con más campos son más altas que el círculo: dejar que crezcan */
.page-registro .portal, .page-recuperar .portal, .page-nueva-clave .portal { height: auto; min-height: min(96vw, 720px); max-height: none; padding-block: 70px 30px; }
.page-registro .portal__content { width: min(84%, 470px); }

@media (max-width: 520px) {
  .page-registro .portal, .page-recuperar .portal, .page-nueva-clave .portal { padding-block: 40px 10px; }
  .page-registro .portal__content { width: min(92vw, 400px); }
}
@media (max-width: 380px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .page-registro, .page-recuperar, .page-nueva-clave { --land-card: 400px; }
  .page-registro .portal, .page-recuperar .portal, .page-nueva-clave .portal { padding-block: 0; min-height: calc(100svh - 20px); }
  .page-registro .portal__content { width: 100%; }
  /* en horizontal el logo queda fijo a la izquierda mientras se desplaza el formulario */
  .page-registro .brand { position: sticky; top: 50%; translate: 0 -50%; align-self: start; margin-top: 50svh; }
  .avatar-option img { width: 42px; height: 42px; }
}

/* el castillo queda fijo a la pantalla aunque la página sea más alta (registro, teclado abierto) */
.castle-plane { position: fixed; }

/* el pie va al final de la página, nunca encima del formulario */
@media not ((orientation: landscape) and (max-height: 560px)) {
  .scene { grid-template-rows: 1fr auto; }
  .sound-hint { position: static; translate: none; margin: 0 0 max(12px, env(safe-area-inset-bottom)); }
}

/* la columna del portal no debe crecer con contenido desplazable (fila de retratos) */
.portal { grid-template-columns: minmax(0, 1fr); }
.portal__content { min-width: 0; justify-self: center; }

/* en páginas altas el portal deja de ser cuadrado: el círculo se centra en la tarjeta y mantiene su proporción */
.page-registro .magic-circle, .page-recuperar .magic-circle, .page-nueva-clave .magic-circle {
  inset: auto;
  top: var(--circle-y, 50%);
  left: 50%;
  width: min(96vw, 720px);
  height: auto;
  max-width: none;
  max-height: none;
  aspect-ratio: 1;
  transform: none;
  translate: -50% -50%;
}
@media (max-width: 520px) {
  .page-registro .magic-circle, .page-recuperar .magic-circle, .page-nueva-clave .magic-circle { width: min(118vw, 590px); }
}
@media (orientation: landscape) and (max-height: 560px) {
  .page-registro .magic-circle, .page-recuperar .magic-circle, .page-nueva-clave .magic-circle {
    left: calc(50% + var(--land-w) / 2 - var(--land-card) / 2);
    width: min(118svh, 520px);
  }
}

/* =========================================================
   Retrato: vista previa + diálogo
   ========================================================= */
.portrait-field { margin-top: 10px; }
.portrait-field__label { display: block; margin-bottom: 5px; font-size: .81rem; font-weight: 800; }
.portrait-current {
  display: flex; align-items: center; gap: 12px; padding: 8px;
  border: 1px solid #b49a68; border-radius: 12px; background: rgba(255,255,255,.6);
  box-shadow: inset 0 1px 4px rgba(71, 49, 23, .1);
}
.portrait-current img {
  flex: none; width: 60px; height: 60px; border-radius: 12px; object-fit: cover;
  border: 2px solid #4a230a; box-shadow: 0 0 0 2px #f2c45a, 0 3px 6px rgba(71, 30, 10, .3);
}
.portrait-current img.is-new { animation: portrait-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes portrait-pop { from { transform: scale(.7) rotate(-6deg); } }
.portrait-current__info { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.portrait-current__info b { min-width: 0; color: #4a230a; font-size: .86rem; overflow-wrap: anywhere; }

.secondary-button {
  min-height: 36px; padding: 6px 16px;
  border: 2px solid #4a230a; border-radius: 999px;
  background: linear-gradient(#fff3c4, #f2c45a 60%, #d39b3a);
  box-shadow: 0 3px 0 #6b3610, inset 0 2px #fffbe6;
  color: #4a230a; cursor: pointer; font-weight: 900; letter-spacing: .02em;
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.secondary-button:hover { filter: brightness(1.05); }
.secondary-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #6b3610, inset 0 2px #fffbe6; }
.secondary-button:focus-visible { outline: 3px solid #3c93b3; outline-offset: 2px; }

.portrait-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: min(680px, calc(100svh - 24px));
  padding: 0; border: 0; background: transparent; overflow: visible;
}
.portrait-dialog::backdrop { background: rgba(10, 16, 32, .62); backdrop-filter: blur(3px); }
.portrait-dialog[open] { animation: dialog-in .2s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }

.portrait-dialog__frame {
  display: flex; flex-direction: column; gap: 10px;
  max-height: inherit; padding: 16px;
  border: 3px solid #4a230a; border-radius: 22px;
  background: radial-gradient(ellipse at 50% -10%, #fffdf1, transparent 60%), #fbf0cc;
  box-shadow: 0 0 0 4px #f2c45a, 0 0 0 7px #4a230a, 0 0 30px 8px rgba(120, 200, 255, .35), 0 20px 40px rgba(0, 0, 0, .5);
}
.portrait-dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.portrait-dialog__header h2 { margin: 0; color: #392117; font-family: "Cinzel", serif; font-size: clamp(1.1rem, 4vw, 1.45rem); text-transform: uppercase; }
.portrait-dialog__close {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px;
  border: 2px solid #4a230a; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffb4a0, #c9302a 50%, #6b0f0f);
  box-shadow: 0 2px 0 #3d1d08; color: #fff3c4; cursor: pointer; font-weight: 900;
}
.portrait-dialog__close:focus-visible { outline: 3px solid #3c93b3; outline-offset: 2px; }
.portrait-dialog__search { flex: none; }
.portrait-dialog__search input::-webkit-search-cancel-button { cursor: pointer; }

.portrait-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px;
  min-height: 0; overflow-y: auto; padding: 6px 4px 6px 2px;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c99745 transparent;
}
.portrait-option {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 7px 4px 6px; border-radius: 12px; cursor: pointer; text-align: center;
  transition: background .15s;
}
.portrait-option[hidden] { display: none; }
.portrait-option:hover { background: rgba(242, 196, 90, .25); }
.portrait-option input { position: absolute; opacity: 0; pointer-events: none; }
.portrait-option img {
  width: 72px; height: 72px; border-radius: 12px; object-fit: cover;
  border: 2px solid #b49a68; box-shadow: 0 2px 4px rgba(71, 49, 23, .25);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.portrait-option span { color: #4a3420; font-size: .7rem; font-weight: 700; line-height: 1.2; }
.portrait-option:hover img { transform: translateY(-2px); }
.portrait-option:has(input:checked) { background: rgba(242, 196, 90, .45); }
.portrait-option input:checked + img { border-color: #951e15; box-shadow: 0 0 0 3px #f2c45a, 0 0 0 5px #4a230a, 0 4px 8px rgba(71, 49, 23, .35); }
.portrait-option input:checked ~ span { color: #951e15; font-weight: 900; }
.portrait-option input:focus-visible + img { outline: 3px solid #3c93b3; outline-offset: 3px; }
.portrait-dialog__empty { margin: 12px 0; color: #7b6440; font-weight: 700; text-align: center; }

.portrait-dialog__footer { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex: none; }
.start-button--small { width: auto; min-width: 140px; min-height: 44px; font-size: 1.15rem; }

@media (max-width: 520px) {
  .portrait-dialog__frame { padding: 12px; }
  .portrait-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
  .portrait-option img { width: 58px; height: 58px; }
  .portrait-dialog__footer > * { flex: 1; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .portrait-dialog { width: min(760px, calc(100vw - 24px)); }
  .portrait-dialog__frame { padding: 10px 14px; gap: 6px; }
  .portrait-option img { width: 52px; height: 52px; }
  .portrait-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .portrait-current img { width: 48px; height: 48px; }
}

/* lista de retratos agrupada por tipo */
.portrait-list { min-height: 0; overflow-y: auto; padding: 0 4px 6px 2px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c99745 transparent; }
.portrait-list .portrait-grid { overflow: visible; min-height: auto; padding: 4px 0; }
.portrait-group[hidden] { display: none; }
.portrait-group__title {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 2px; padding: 6px 4px;
  background: linear-gradient(#fbf0cc 80%, rgba(251, 240, 204, 0));
  color: #6b3610; font-family: "Cinzel", serif; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase;
}
.portrait-group__title::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, #c99745, transparent); }
.portrait-group__title small { padding: 1px 7px; border-radius: 999px; background: #f2dca0; color: #7b5420; font-family: "Nunito Sans", sans-serif; font-size: .68rem; letter-spacing: 0; }

/* Registro: aire entre el retrato y "Crear imperio" */
.page-registro .start-button,
.page-recuperar .start-button,
.page-nueva-clave .start-button { margin-top: 20px; }
@media (orientation: landscape) and (max-height: 560px) {
  .page-registro .start-button,
  .page-recuperar .start-button,
  .page-nueva-clave .start-button { margin-top: 14px; }
}

/* Selector de retratos: 2 columnas más (escritorio 7, móvil 5, horizontal 8) */
.portrait-list .portrait-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.portrait-list .portrait-option { min-width: 0; padding: 6px 2px 5px; }
.portrait-list .portrait-option img { width: 100%; max-width: 72px; height: auto; aspect-ratio: 1; }
.portrait-list .portrait-option span { font-size: .66rem; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .portrait-list .portrait-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .portrait-list .portrait-option { padding: 4px 1px; border-radius: 9px; }
  .portrait-list .portrait-option img { border-radius: 9px; border-width: 1.5px; }
  .portrait-list .portrait-option span { font-size: .56rem; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .portrait-list .portrait-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
  .portrait-list .portrait-option img { max-width: 56px; }
}

/* =========================================================
   Rendimiento: animar solo transform/opacity (se componen en la GPU,
   sin repintar cada fotograma)
   ========================================================= */
/* resplandor del marco: antes animaba box-shadow (repintaba la tarjeta entera) */
.login-card { animation: none; }
.frame-aura {
  position: absolute; inset: -3px; z-index: -1;
  border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 36px 10px rgba(255, 214, 110, .5);
  opacity: .45;
  will-change: opacity;
  animation: aura-pulse 4s ease-in-out infinite;
}
@keyframes aura-pulse { 50% { opacity: 1; } }
/* el brillo que recorre el marco va en su propia capa */
.login-card::before { will-change: background-position; contain: paint; }

/* círculo: el drop-shadow del contenedor se recalculaba en cada giro */
.magic-circle { filter: none; }
.magic-circle__ring { filter: drop-shadow(0 0 10px rgba(140, 210, 255, .55)); will-change: transform; }
.magic-circle__halo { will-change: opacity; animation-name: halo-fade; }
@keyframes halo-fade { 50% { opacity: .6; } }
.magic-circle__particles i { will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  .frame-aura, .login-card::before, .magic-circle__halo { animation: none !important; }
}

/* aviso del servidor (error / listo) y formulario de reenvío */
.form-message--ok { color: #477226; }
.resend-form { display: inline; margin: 0; }

/* Suspended account: "contacta con soporte aquí" under the message, and its appeal dialog (ban_appeal.py) */
.appeal-line { margin: 10px 0 0; color: #4a3420; font-size: .78rem; font-weight: 700; text-align: center; }
.appeal-dialog { width: min(480px, calc(100vw - 24px)); }
.appeal-dialog__fields { display: flex; flex-direction: column; }
.appeal-dialog__fields[hidden] { display: none; }
.appeal-dialog__intro { margin: 0 0 4px; color: #4a3420; font-size: .86rem; font-weight: 600; line-height: 1.35; }
.appeal-dialog label { color: #392117; }
.input-shell--area { align-items: stretch; }
.input-shell--area textarea {
  flex: 1; min-width: 0; min-height: 110px; padding: 9px 10px; border: 0; outline: 0; resize: vertical;
  background: transparent; color: #33261f; font: inherit; font-size: .9rem;
}
.appeal-dialog .form-message { margin: 2px 0 0; }
.appeal-dialog .form-message--ok { color: #24613a; font-size: .86rem; }
.input-shell.is-invalid textarea { background: rgba(166, 45, 35, .05); }
