/* =====================================================================
   AETHERIA — title.css
   Title "gate" (first stage of the title screen, ui.js buildGate): code-
   drawn crest, logo, main menu (stone plaques), Opções pane, login / register,
   account panel, crypt vignette and fog. The loading screen (#loading in
   index.html) shares the crest / logo / fog classes so loader → gate reads
   as one screen. Gótico sombrio: cold blue-violet world, warm gold / ember UI.
   The character select ('chars' stage) keeps its style.css rules.
   ===================================================================== */

:root {
  --ts-ember: #ff8a24;
  --ts-ember-hot: #fff0a0;
  --ts-blood: #5a0c14;
  --ts-crypt: #3c3654;
}

/* ---------- stages (ui.js setTitleStage) ---------- */
.title.st-gate {
  background:
    radial-gradient(ellipse 75% 70% at 50% 45%, transparent 30%, rgba(7, 6, 11, .72) 78%, #07060b),
    linear-gradient(180deg, rgba(7, 6, 11, .7), transparent 24%, transparent 72%, rgba(7, 6, 11, .85));
}
.title.st-gate .t-scroll, .title.st-chars .t-gate, .title.st-chars .tg-bg { display: none; }

/* ---------- crypt fog: two wide layers drifting (transform only, runs on the compositor) ---------- */
.tg-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.tg-fog {
  position: absolute;
  left: 0;
  bottom: -8%;
  width: 200%;
  height: 48%;
  background:
    radial-gradient(closest-side, rgba(60, 54, 84, .9), rgba(60, 54, 84, 0)) 0 100% / 25% 85% repeat-x,
    radial-gradient(closest-side, rgba(60, 54, 84, .6), rgba(60, 54, 84, 0)) 50% 20% / 25% 55% repeat-x;
  opacity: .34;
  animation: tgFog 90s linear infinite;
  will-change: transform;
}
.tg-fog.f2 { bottom: 22%; height: 30%; opacity: .2; animation-duration: 64s; animation-direction: reverse; }

/* ---------- gate column ---------- */
.t-gate {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  scrollbar-width: thin;
  scrollbar-color: var(--bronze) transparent;
  scrollbar-gutter: stable both-edges;       /* a tall pane's scrollbar never shifts the centred head sideways */
  font-variant-ligatures: none;             /* Pixelify's "fi" ligature reads as an "A" at small sizes */
}
/* the head sits at a fixed height (the loader's .ld-box uses the same offset: 14px + 6px + max(0, 50vh − 250px)),
   so loader → gate, login / register and opening Opções never move the logo; the account panel takes the leftover space */
.tg-main { display: flex; flex-direction: column; align-items: center; width: 100%; margin: max(0px, calc(50vh - 250px)) 0 auto; padding: 6px 0 12px; }

/* crest: two bronze wings around an ember gem, on a gold rule */
.tg-crest {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 0 #1a0e04) drop-shadow(0 0 1px #000);
}
.tg-crest::before {
  content: "";
  position: absolute;
  left: -64px;
  right: -64px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: linear-gradient(90deg, transparent, var(--bronze) 30%, var(--gold) 50%, var(--bronze) 70%, transparent);
}
.tg-wing {
  position: relative;
  width: 60px;
  height: 26px;
  background: linear-gradient(180deg, var(--gold2) 0 20%, var(--gold) 20% 48%, var(--bronze) 48% 76%, #5a3610 76%);
  clip-path: polygon(100% 34%, 72% 0, 66% 24%, 46% 6%, 40% 32%, 18% 18%, 24% 44%, 0 46%, 28% 64%, 18% 76%, 56% 76%, 50% 94%, 100% 72%);
}
.tg-wing.r { transform: scaleX(-1); }
.tg-gemc {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 32px;
  margin: 0 -2px;
  background: linear-gradient(135deg, #fff2c0, var(--gold) 40%, var(--bronze) 68%, #3a2410);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.tg-gemc::after {
  content: "";
  position: absolute;
  inset: 8px 7px;
  background: radial-gradient(circle at 50% 38%, var(--ts-ember-hot), var(--ts-ember) 45%, var(--ts-blood));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: tgEmber 3.2s steps(3) infinite;
}

/* logo (gate + loader): gold gradient text, stacked drop-shadows, warm glow, slow shine sweep.
   Sizes are multiples of Jacquard 12's pixel grid (font-size / 20.8): 62.4 / 83.2 / 124.8px keep its pixels even */
.t-logo.tg-logo { font-size: 83.2px; line-height: .9; letter-spacing: 6px; }
.tg-logo .t-logo-txt {
  background: linear-gradient(180deg, #fff8dc 0, #f4d47c 30%, #d6a84c 55%, #a8742a 76%, #5a3610 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 1px 0 #1a0e04) drop-shadow(0 4px 0 #2a1608) drop-shadow(0 0 1px #000);
}
.tg-logo .t-logo-glow { color: #ff9a3c; filter: blur(10px); opacity: .45; }   /* opacity: reduced motion (logoGlow off) */
.tg-shine {
  position: absolute;
  inset: 0;
  color: transparent;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 250, 225, .85) 48%, transparent 56%) 100% 0 / 250% 100% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
  animation: tgShine 9s steps(12) 2.5s infinite;
}
.t-sub.tg-sub { white-space: nowrap; margin-top: 8px; }
.tg-sub .t-orn { flex-shrink: 1; min-width: 12px; }

/* ---------- main menu ---------- */
.tg-menu { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: min(300px, 100%); margin-top: clamp(18px, 4.5vh, 44px); }
.btn.tg-prim { flex-direction: column; gap: 4px; min-height: 60px; padding: 7px 18px; }
.btn.tg-prim:focus-visible { box-shadow: inset 0 0 0 2px #3a2410, inset 0 0 0 3px #fff6cc, inset 0 -3px 0 rgba(90, 60, 20, .45); }
.tg-prim .tg-pl { position: relative; font-size: calc(22px * var(--txt-h)); }
.tg-prim .tg-ps {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font: 400 calc(10px * var(--txt))/calc(12px * var(--txt)) var(--f-num);       /* 12px: the accent of "Último" is not clipped by overflow: hidden */
  letter-spacing: .5px;
  color: #3a2410;
  text-shadow: none;
}
/* stone plaque (gothic HUD stone + con-plate bevels) */
.btn.tg-plq {
  min-height: 46px;
  font: 600 calc(18px * var(--txt))/1 var(--f-ui);
  color: #d8ccb4;
  text-shadow: 0 1px 0 #000, 0 0 6px rgba(0, 0, 0, .8);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(7, 6, 11, .38)), var(--hud-stone, none) center / 128px 96px repeat, #242528;
  border: 2px solid #151316;
  border-top-color: #878175;
  border-bottom: 3px solid #08090b;
  box-shadow: inset 0 2px 0 #494a48, inset 0 4px 0 #17191a, inset 0 -3px 0 #45423a, inset 0 -5px 0 #121214;
}
.btn.tg-plq:hover, .btn.tg-plq:focus-visible {
  outline: none;
  color: var(--gold2);
  background: linear-gradient(180deg, rgba(255, 190, 110, .06), rgba(7, 6, 11, .3)), var(--hud-stone, none) center / 128px 96px repeat, #2a2a2c;
  border-color: var(--gold);
  border-bottom-color: #8a6a3a;
  box-shadow: inset 0 0 18px rgba(255, 138, 36, .25), inset 0 2px 0 #494a48, inset 0 -3px 0 #45423a;
}
.btn.tg-plq:active { transform: translateY(1px); box-shadow: inset 0 0 18px rgba(255, 138, 36, .2), inset 0 2px 6px rgba(0, 0, 0, .6); }
/* selected item: small gold diamonds on both sides of the label (Diablo style) */
.tg-plq > span, .tg-prim .tg-pl { position: relative; }
.tg-plq > span::before, .tg-plq > span::after, .tg-prim .tg-pl::before, .tg-prim .tg-pl::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  background: var(--gold2);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  opacity: 0;
}
.tg-plq > span::before, .tg-prim .tg-pl::before { right: calc(100% + 12px); }
.tg-plq > span::after, .tg-prim .tg-pl::after { left: calc(100% + 12px); }
.tg-prim .tg-pl::before, .tg-prim .tg-pl::after { background: var(--ts-blood); }
.tg-plq:hover > span::before, .tg-plq:hover > span::after, .tg-plq:focus-visible > span::before, .tg-plq:focus-visible > span::after,
.tg-prim:hover .tg-pl::before, .tg-prim:hover .tg-pl::after, .tg-prim:focus-visible .tg-pl::before, .tg-prim:focus-visible .tg-pl::after { opacity: 1; }

/* ---------- Opções pane (replaces the menu while open) ---------- */
.tg-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, 100%);
  margin-top: clamp(16px, 4vh, 40px);
  padding: 14px 14px 12px;
  animation: tgRise .32s steps(4) backwards;
}
.tg-pane-h { margin: 0 0 4px; text-align: center; font: 400 30px/1 var(--f-title); color: var(--gold2); text-shadow: 0 2px 0 #000, 0 0 10px rgba(214, 168, 76, .3); }
.tg-pane-h::after { content: ""; display: block; width: 140px; height: 2px; margin: 8px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.tg-zoom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 0 4px 0 14px;
  font: 600 calc(14px * var(--txt))/1 var(--f-ui);
  background: rgba(10, 8, 14, .55);
  border: 2px solid var(--edge);
}
.tg-zoom-c { display: flex; align-items: center; gap: 6px; }
.btn.tg-zoom-b { width: 32px; min-height: 28px; padding: 0; font-size: 18px; }   /* − / + glyphs: icon size, fixed with "Tamanho do texto" */
.tg-zoom-v { min-width: 44px; text-align: center; font: 400 calc(11px * var(--txt))/1 var(--f-num); color: var(--gold2); }

/* ---------- login / register (ui.js buildAuth: local accounts; replaces the menu while logged out) ---------- */
.tg-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, 100%);
  margin-top: clamp(16px, 4vh, 40px);
  padding: 14px 16px 12px;
}
.tg-fld { display: grid; gap: 5px; }
.tg-lbl { font: 400 calc(10px * var(--txt))/1 var(--f-num); letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.tg-in {                                   /* same well as the hero name field (style.css .t-name); 18px: no iOS focus zoom */
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  font: 600 calc(18px * var(--txt)) var(--f-ui);
  color: var(--parch);
  background: var(--well);
  border: 2px solid var(--bronze);
  border-radius: 0;
  box-shadow: inset 0 0 0 1px var(--ink), inset 0 3px 10px rgba(0, 0, 0, .6);
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.tg-in:focus { border-color: var(--gold2); box-shadow: inset 0 0 0 1px var(--ink), 0 0 0 2px rgba(244, 212, 124, .25); }
.tg-in:disabled { opacity: .5; cursor: var(--cur-disabled); }
.tg-in:-webkit-autofill { -webkit-text-fill-color: var(--parch); caret-color: var(--parch); box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 60px var(--well); }
.tg-auth-err { min-height: 16px; font-size: calc(13px * var(--txt)); line-height: 1.3; text-align: center; color: var(--danger); }
.btn.tg-auth-go { margin-top: 2px; }
.tg-auth-legacy { margin: 0 0 6px; padding: 6px 8px; font-size: calc(12px * var(--txt)); line-height: 1.35; text-align: center; color: var(--gold2); background: rgba(214, 168, 76, .08); border: 1px solid rgba(214, 168, 76, .3); }
.tg-auth-note { margin: 2px 0 0; text-align: center; font-size: calc(11px * var(--txt)); color: var(--dim); }
@media (min-height: 501px) and (max-height: 960px) {   /* laptops: Criar conta fits without scrolling the gate (up to 960: the large logo starts at 821) */
  .tg-auth { gap: 6px; margin-top: 12px; padding-top: 10px; }
  .tg-auth .tg-pane-h { font-size: calc(26px * var(--txt-h)); }
}

/* ---------- account recovery (ui.js: register e-mail note, "Esqueci a senha" link, forgot panel .tg-fg (e-mail only),
   Opções › Conta .tg-ao) ---------- */
.tg-fld-note { margin-bottom: 6px; font-size: calc(11px * var(--txt)); line-height: 1.3; color: var(--dim); }   /* apart from the next field's label */
.btn.tg-link {                             /* link-style: no plaque, underlined; 44px tall target */
  align-self: center;
  min-height: 44px;
  padding: 0 12px;
  font: 600 calc(15px * var(--txt))/1 var(--f-ui);
  color: var(--dim);
  text-decoration: underline;
  text-decoration-color: rgba(214, 168, 76, .5);
  text-underline-offset: 4px;
  background: none;
  border: 0;
  box-shadow: none;
  clip-path: none;
}
.btn.tg-link:hover, .btn.tg-link:focus-visible { color: var(--gold2); background: none; box-shadow: none; text-decoration-color: var(--gold2); }
.btn.tg-link:focus-visible { outline: 1px dashed var(--gold); outline-offset: -8px; }
.tg-fg-sent { margin: 0; text-align: center; font-size: calc(14px * var(--txt)); line-height: 1.35; color: var(--parch); }
.tg-fg-sent b { color: var(--gold2); overflow-wrap: anywhere; }
.tg-fg-sent small { display: block; margin-top: 3px; font-size: calc(12px * var(--txt)); color: var(--dim); }
.tg-fg-row { display: flex; gap: 8px; }
.tg-fg-row .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; }
.tg-fg .btn.big { padding: 0 8px; font-size: calc(clamp(14px, 4.6vw, 18px) * var(--txt)); }   /* the gold buttons ("Enviar código por e-mail") fit a phone */
/* Opções › Conta */
.tg-ao { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid rgba(138, 106, 58, .45); }
.tg-ao-h { margin: 0; text-align: center; font: 400 calc(10px * var(--txt))/1 var(--f-num); letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.tg-ao-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  min-height: 36px;
  padding: 6px 12px 6px 14px;
  font: 600 calc(14px * var(--txt))/1.2 var(--f-ui);
  background: rgba(10, 8, 14, .55);
  border: 2px solid var(--edge);
}
.tg-ao-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 calc(13px * var(--txt))/1.2 var(--f-ui); color: var(--gold2); }
.tg-ao-v.off { color: var(--dim); }
.tg-ao-form { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: rgba(10, 8, 14, .55); border: 2px solid var(--edge); }
.tg-ao-t { margin: 0; text-align: center; font: 600 calc(14px * var(--txt))/1.3 var(--f-ui); color: var(--gold2); }
.tg-ao-acts { display: flex; gap: 8px; }
.tg-ao-acts .btn { flex: 1 1 0; min-height: 44px; }
.tg-ao .tg-auth-err:empty { display: none; }
.tg-auth-err.ok { color: var(--gold2); }

/* ---------- account panel (docked at the bottom of the gate) ---------- */
.tg-acct { display: flex; flex: none; align-items: flex-start; gap: 11px; width: min(calc(300px * var(--txt)), 100%); margin-top: 10px; padding: 9px 14px 10px; }
.tg-gem { flex: 0 0 10px; width: 10px; height: 10px; margin-top: 16px; background: #6b6478; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.tg-gem.on { background: var(--exc); animation: tgPulse 2.4s steps(4) infinite; }
.tg-gem.wait { background: var(--gold); animation: tgBlink .8s steps(2) infinite; }
.tg-acct-tx { display: grid; gap: 3px; min-width: 0; }
.tg-acct-l { font: 400 calc(9px * var(--txt))/1.1 var(--f-num); letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.tg-acct-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 calc(14px * var(--txt))/1.15 var(--f-ui); color: var(--parch); }
.tg-acct-d { font-size: calc(11px * var(--txt)); line-height: 1.3; color: var(--dim); }
.tg-acct-d:empty { display: none; }

/* ---------- 'chars' stage: back to the gate ---------- */
.btn.tg-plq.t-back {
  position: absolute;
  z-index: 2;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(14px + env(safe-area-inset-left));
  min-height: 36px;
  padding: 0 16px 0 28px;
  font-size: calc(15px * var(--txt));
}
.t-back::before { content: ""; position: absolute; left: 11px; top: 50%; width: 7px; height: 10px; margin-top: -5px; background: currentColor; clip-path: polygon(100% 0, 100% 100%, 0 50%); }
.t-back > span::before, .t-back > span::after { display: none; }

/* ---------- entrance: staggered rise after the loader fade (.boot), stepped ---------- */
.t-gate .tg-rise { animation: tgRise .5s steps(4) backwards; animation-delay: calc(var(--i, 0) * 80ms); }
.t-gate.boot .tg-rise { animation-delay: calc(.45s + var(--i, 0) * 80ms); }
.t-gate.calm .tg-rise { animation: none; }   /* after a pane closes (ui.js showPane): no replay */

@keyframes tgRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tgFog { to { transform: translateX(-50%); } }
@keyframes tgShine { 0% { background-position: 100% 0; } 12%, 100% { background-position: 0 0; } }
@keyframes tgEmber { 50% { opacity: .55; } }
@keyframes tgPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes tgBlink { 0% { opacity: 1; } 100% { opacity: .25; } }

/* ---------- responsive / touch ---------- */
@media (pointer: coarse) {
  .btn.tg-plq { min-height: 48px; }
  .tg-pane .btn, .tg-zoom { min-height: 44px; }
  .btn.tg-zoom-b { width: 44px; }
  .btn.tg-plq.t-back { min-height: 44px; }
}
@media (max-width: 1100px) {     /* up to here the 'chars' logo would run under an absolute Voltar */
  .btn.tg-plq.t-back { position: relative; top: auto; left: auto; align-self: flex-start; margin-bottom: 6px; }
}
@media (min-width: 1100px) and (min-height: 821px) {
  .t-logo.tg-logo { font-size: 124.8px; }
  .tg-crest { transform: scale(2); margin: 16px 0 22px; }
}
@media (max-width: 560px) {
  .t-logo.tg-logo { font-size: 62.4px; letter-spacing: 2px; }
  .t-sub.tg-sub { letter-spacing: 1.5px; gap: 8px; }
}
@media (max-width: 380px) {
  .t-sub.tg-sub { font-size: calc(11px * var(--txt)); letter-spacing: 1px; gap: 6px; }
}
@media (max-width: 400px) {       /* 'chars' stage logo (style.css) is wider than a phone */
  .t-head .t-logo { font-size: 62.4px; letter-spacing: 2px; }
}
/* short landscape (phones sideways): logo on the left, menu / panes on the right */
@media (max-height: 500px) and (min-width: 561px) {
  .t-logo.tg-logo { font-size: 62.4px; letter-spacing: 3px; }
  .tg-crest { margin-bottom: 2px; }
  .tg-sub .t-orn { width: clamp(12px, 3vw, 40px); }
  .tg-main {
    display: grid;
    grid-template-columns: auto minmax(200px, 280px);
    grid-template-rows: 1fr auto auto auto 1fr;   /* head rows stay together; the menu spans all rows */
    justify-content: center;
    align-items: center;
    column-gap: clamp(20px, 5vw, 56px);
    margin: auto 0;
  }
  .tg-crest, .tg-logo, .tg-sub { grid-column: 1; justify-self: center; }
  .tg-crest { grid-row: 2; }
  .tg-logo { grid-row: 3; }
  .tg-sub { grid-row: 4; }
  .tg-menu, .tg-pane, .tg-auth { grid-column: 2; grid-row: 1 / -1; width: 100%; margin-top: 0; }
  .tg-menu { gap: 8px; }
  .btn.tg-prim { min-height: 52px; }
  .tg-pane, .tg-auth { max-height: calc(100vh - 40px); overflow-y: auto; }
  .tg-auth { gap: 4px; padding: 8px 14px; scrollbar-width: thin; scrollbar-color: var(--bronze) transparent; }
  .tg-auth .tg-pane-h { font-size: calc(22px * var(--txt-h)); }
  .tg-auth .tg-pane-h::after { margin-top: 4px; }
}
@media (max-height: 500px) and (min-width: 561px) and (max-width: 639px) {   /* small phones sideways: head + menu must fit side by side */
  .t-logo.tg-logo { font-size: 41.6px; letter-spacing: 2px; }
  .t-sub.tg-sub { font-size: calc(11px * var(--txt)); letter-spacing: 1px; gap: 6px; }
}

/* ---------- reduced motion: no drift, shine or pulses; entrances become plain fades ---------- */
@media (prefers-reduced-motion: reduce) {
  .tg-fog, .tg-gemc::after, .tg-gem.on, .tg-gem.wait { animation: none !important; }
  .tg-shine { display: none; }
  .t-gate .tg-rise, .tg-pane { animation-name: fadeIn; animation-duration: .3s; animation-timing-function: linear; animation-delay: 0s; }
  .t-gate.boot .tg-rise { animation-delay: .45s; }
}

/* login ⇄ register ⇄ gate (.still): the new panel / menu comes in quickly, no empty column */
.t-gate.still .tg-rise { animation-duration: .24s; animation-delay: calc((var(--i, 0) - 3) * 40ms); }

/* first gate after boot: crest / logo / subtitle are already on screen in the loader (same place),
   so only the menu and account panel rise; same when switching login / register / gate (.still).
   Last, so the reduced-motion fadeIn above cannot revive it */
.t-gate.boot .tg-crest, .t-gate.boot .tg-logo, .t-gate.boot .tg-sub,
.t-gate.still .tg-crest, .t-gate.still .tg-logo, .t-gate.still .tg-sub { animation: none; }
/* except short landscape: the loader centres the head, the gate puts it on the left, so it rises there after the fade */
@media (max-height: 500px) and (min-width: 561px) and (prefers-reduced-motion: no-preference) {
  .t-gate.boot .tg-crest, .t-gate.boot .tg-logo, .t-gate.boot .tg-sub { animation: tgRise .5s steps(4) .45s backwards; }
}

/* =====================================================================
   Title v3 — account panel (ui.js buildAuthPanel .tg-acc): tabs Entrar / Criar conta, "Entrar com Google", the
   "ou" divider, fields with the eye toggle, "Lembrar de mim", busy states; server list (.tg-srv, MU style)
   ===================================================================== */
.tg-auth.tg-acc { gap: 0; width: min(372px, 100%); padding: 0; }
.tg-auth-b { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px 12px; }

/* tabs: two stone tabs across the top edge; the selected one opens into the panel, a gold bar slides under it */
.tg-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: linear-gradient(180deg, #0d0a12, #17121c); border-bottom: 2px solid var(--bronze); }
.tg-tabs::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold2) 18%, #fff2c0 50%, var(--gold2) 82%, transparent);
  box-shadow: 0 0 8px rgba(244, 212, 124, .55);
  transition: transform .2s steps(4);
}
.tg-acc.reg .tg-tabs::after { transform: translateX(100%); }
.tg-tab {
  position: relative;
  min-height: 48px;
  padding: 6px 10px 4px;
  font: 400 calc(26px * var(--txt-h))/1 var(--f-title);
  letter-spacing: .5px;
  color: #8d8270;
  text-shadow: 0 2px 0 #000;
  background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(0, 0, 0, .35));
  border: 0;
  cursor: var(--cur-pointer);
}
.tg-tab + .tg-tab { box-shadow: inset 2px 0 0 #0b0810, inset 3px 0 0 rgba(138, 106, 58, .35); }
.tg-tab:hover { color: #d8ccb4; }
.tg-tab.on { color: var(--gold2); background: linear-gradient(180deg, rgba(214, 168, 76, .14), rgba(214, 168, 76, .03) 70%, transparent); text-shadow: 0 2px 0 #000, 0 0 12px rgba(244, 212, 124, .35); cursor: var(--cur-default); }
.tg-tab:focus-visible { outline: 1px dashed var(--gold2); outline-offset: -6px; }
.tg-tab:disabled { cursor: var(--cur-disabled); }
.tg-tp { display: flex; flex-direction: column; gap: 8px; animation: fadeIn .18s steps(3); }
.tg-tp.hide { display: none; }

/* "Entrar com Google": Google's dark sign-in button (fill #131314, 1px #8e918f, #e3e3e3 Roboto Medium 14px, standard G
   mark); with real Google its own button (GIS, theme filled_black) replaces it in .tg-gslot */
.tg-grow { display: flex; flex-direction: column; gap: 6px; }
.tg-gbtn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: 500 14px/20px Roboto, Arial, sans-serif;   /* fixed with "Tamanho do texto": Google's branding size (the real GIS button does not scale either) */
  letter-spacing: .25px;
  color: #e3e3e3;
  background: #131314;
  border: 1px solid #8e918f;
  border-radius: 4px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .55);
  cursor: var(--cur-pointer);
  transition: background-color .12s, box-shadow .12s;
}
.tg-g-ic { position: absolute; left: 12px; top: 50%; width: 20px; height: 20px; margin-top: -10px; }
.tg-g-ic svg { display: block; }
.tg-gbtn:hover { background: #1f1f20 linear-gradient(rgba(227, 227, 227, .08), rgba(227, 227, 227, .08)); box-shadow: 0 2px 0 rgba(0, 0, 0, .55), 0 0 12px rgba(214, 168, 76, .22); }
.tg-gbtn:active { background: #2a2a2b; }
.tg-gbtn:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }
.tg-gbtn:disabled { cursor: var(--cur-disabled); color: #9b9d9e; }
.tg-gbtn:disabled .tg-g-ic { opacity: .6; }
.tg-gbtn.busy { cursor: progress; }
.tg-gbtn.busy::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border: 2px solid rgba(227, 227, 227, .25);
  border-top-color: #e3e3e3;
  animation: spin .8s steps(8) infinite;
}
.tg-gslot { display: flex; justify-content: center; min-height: 44px; align-items: center; }
.tg-gslot.hide { display: none; }
.tg-g-err { font-size: calc(13px * var(--txt)); line-height: 1.3; text-align: center; color: var(--danger); }
.tg-g-err:empty { display: none; }
.tg-g-err.soft { color: var(--dim); }
/* "ou" between Google and the local form */
.tg-or { display: flex; align-items: center; gap: 10px; margin: 2px 0 0; font: 400 calc(10px * var(--txt))/1 var(--f-num); letter-spacing: 2px; text-transform: uppercase; color: var(--dim); }
.tg-or::before, .tg-or::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, transparent, var(--bronze)); }
.tg-or::after { transform: scaleX(-1); }
.tg-or span { position: relative; padding: 0 2px; }

/* fields: label above, eye toggle inside the password well, inline message below */
.tg-fld { display: grid; gap: 5px; }
.tg-fmsg { font-size: calc(12px * var(--txt)); line-height: 1.3; color: var(--danger); }
.tg-fmsg:empty { display: none; }
.tg-fld.bad .tg-in { border-color: #b8323a; box-shadow: inset 0 0 0 1px var(--ink), 0 0 0 2px rgba(255, 77, 77, .18); }
.tg-pw { position: relative; display: block; }
.tg-pw .tg-in { padding-right: 46px; }
.tg-eye {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--dim);
  background: none;
  border: 0;
  cursor: var(--cur-pointer);
}
.tg-eye svg { display: block; }
.tg-eye .tg-eye-x { display: none; }
.tg-eye.on .tg-eye-x { display: inline; }
.tg-eye.on .tg-eye-p { display: none; }
.tg-eye:hover, .tg-eye.on { color: var(--gold2); }
.tg-eye:focus-visible { outline: 1px dashed var(--gold2); outline-offset: -5px; }
.tg-eye:disabled { opacity: .4; cursor: var(--cur-disabled); }
/* "Lembrar de mim" + "Esqueci a senha" */
.tg-auth-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 10px; margin-top: -2px; }
.tg-rem { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: calc(14px * var(--txt)); color: #cfc3aa; cursor: var(--cur-pointer); }
.tg-rem-in { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tg-rem-in:checked + .t-check { background: var(--gold2); box-shadow: inset 0 0 0 3px #2a1a08; }
.tg-rem-in:focus-visible + .t-check { border-color: var(--gold2); outline: 2px solid rgba(244, 212, 124, .5); outline-offset: 1px; }
.tg-rem-in:disabled + .t-check, .tg-rem-in:disabled ~ span { opacity: .5; }
.tg-rem:hover .t-check { border-color: var(--gold); }
.tg-auth-row .btn.tg-link { min-height: 40px; margin-left: auto; padding: 0 2px; font-size: calc(14px * var(--txt)); }   /* right-aligned, also when wrapped (phone) */
@media (max-width: 400px) {   /* "Lembrar de mim" + "Já tem conta? Entrar" share one row on 360–400 px phones */
  .tg-rem, .tg-auth-row .btn.tg-link { font-size: calc(13px * var(--txt)); }
}
.tg-acc .tg-auth-err:empty { min-height: 0; }
/* busy: the submitting button keeps its colour and spins a pixel square */
.btn.busy { cursor: progress; }
.btn.busy:disabled { opacity: .9; filter: none; }
.btn.gold.busy::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 3px solid rgba(26, 16, 8, .3);
  border-top-color: #1a1008;
  animation: spin .8s steps(8) infinite;
}
.tg-acc .tg-auth-note { margin-top: 4px; }
/* a disabled stone plaque (character select actions while a delete is asked) does not light up under the mouse */
.btn.tg-plq:disabled:hover {
  color: #d8ccb4;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(7, 6, 11, .38)), var(--hud-stone, none) center / 128px 96px repeat, #242528;
  border-color: #151316;
  border-top-color: #878175;
  border-bottom-color: #08090b;
  box-shadow: inset 0 2px 0 #494a48, inset 0 4px 0 #17191a, inset 0 -3px 0 #45423a, inset 0 -5px 0 #121214;
}
.tg-plq:disabled > span::before, .tg-plq:disabled > span::after { opacity: 0 !important; }
/* Opções › Conta: the local account block or the Google one (ui.js buildAcctOpts) */
.tg-ao-loc { display: flex; flex-direction: column; gap: 8px; }
/* "Sair da conta" of a Google account: red under the pointer, a little apart from "Fechar" */
.btn.tg-plq.tg-out { margin-bottom: 6px; }
.btn.tg-plq.tg-out:hover, .btn.tg-plq.tg-out:focus-visible { color: #ffb4a8; border-color: #c4232e; box-shadow: inset 0 0 18px rgba(196, 35, 46, .3), inset 0 2px 0 #494a48, inset 0 -3px 0 #45423a; }
.tg-out:hover > span::before, .tg-out:hover > span::after, .tg-out:focus-visible > span::before, .tg-out:focus-visible > span::after { background: #c4232e; }
/* the forgot panel as wide as the account panel: no width jump when "Esqueci a senha" opens it */
.tg-auth.tg-fg { width: min(372px, 100%); }
@media (min-height: 501px) and (max-height: 960px) {   /* laptops: Criar conta fits */
  .tg-auth.tg-acc { padding: 0; }
  .tg-auth-b { gap: 6px; padding-top: 12px; }
  .tg-tab { min-height: 44px; font-size: calc(24px * var(--txt-h)); }
  .tg-grow:has(> .tg-g-err:not(:empty)) + .tg-or { display: none; }   /* a Google note takes the "ou" divider's room */
}
.tg-pair { display: contents; }
.tg-acc.reg .tg-auth-note { display: none; }   /* the e-mail note above already says "Fica salvo neste PC" */
.tg-fld { align-content: start; }
.tg-acc .tg-in::placeholder { color: transparent; }   /* the label says it; shown only where labels hide (short landscape) */
@media (min-width: 561px) {   /* register's two passwords share a row at any height: "Criar conta" stays above the fold */
  .tg-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 10px; }
}
@media (min-height: 501px) and (max-height: 960px) and (pointer: fine) {   /* laptops with a mouse: slimmer wells (up to 960: the large logo) */
  .tg-acc .tg-in { height: 40px; }
  .tg-acc .tg-eye { width: 36px; height: 36px; }
  .tg-acc .tg-fld { gap: 3px; }
  .tg-acc .tg-fld-note { margin-bottom: 0; }
  .tg-acc .btn.tg-auth-go { min-height: 46px; }
}
@media (min-height: 501px) and (max-height: 700px) {   /* 1366×657 (a 768 px laptop with the browser's bars): Criar conta still fits */
  .tg-auth.tg-acc { margin-top: 8px; }
  .tg-auth-b { padding-top: 8px; padding-bottom: 8px; }
  .tg-acc .tg-tp { gap: 5px; }
  .tg-tab { min-height: 40px; }
}

/* ---------- server list ---------- */
.tg-srv { display: flex; flex-direction: column; gap: 8px; width: min(620px, 100%); margin-top: clamp(16px, 4vh, 40px); padding: 14px 14px 12px; }
.tg-srv-hd, .btn.tg-srv-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 84px 96px 58px; align-items: center; column-gap: 10px; }
.tg-srv-hd { padding: 0 12px 6px; font: 400 calc(9px * var(--txt))/1 var(--f-num); letter-spacing: 1px; text-transform: uppercase; color: var(--dim); border-bottom: 1px solid rgba(138, 106, 58, .5); }
.tg-srv-hd span:first-child { grid-column: 1 / 3; }
.tg-srv-hd span:last-child { text-align: right; }
.tg-srv-list { display: flex; flex-direction: column; gap: 8px; }
.btn.tg-srv-row {
  width: 100%;
  min-height: 66px;
  padding: 8px 12px;
  text-align: left;
  white-space: normal;
  font: 600 calc(14px * var(--txt))/1.2 var(--f-ui);
  color: var(--parch);
  background: linear-gradient(90deg, rgba(214, 168, 76, .06), transparent 40%), linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(7, 6, 11, .45)), var(--hud-stone, none) center / 128px 96px repeat, #1d1b20;
  border: 2px solid #2c2219;
  border-left: 3px solid var(--bronze);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -2px 0 rgba(0, 0, 0, .5);
  clip-path: none;
  animation: tgRise .32s steps(4) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.btn.tg-srv-row:hover, .btn.tg-srv-row:focus-visible {
  outline: none;
  color: #fff3d6;
  background: linear-gradient(90deg, rgba(255, 138, 36, .14), transparent 55%), linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(7, 6, 11, .35)), var(--hud-stone, none) center / 128px 96px repeat, #24211f;
  border-color: var(--gold);
  border-left-color: var(--gold2);
  box-shadow: inset 0 0 18px rgba(255, 138, 36, .18), 0 0 14px rgba(214, 168, 76, .18);
}
.btn.tg-srv-row:active { transform: translateY(1px); }
.tg-srv-flag {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 30px;
  font: 700 calc(11px * var(--txt))/1 var(--f-num);
  letter-spacing: .5px;
  color: #fff2c0;
  text-shadow: 0 1px 0 #000;
  border: 2px solid #0b0810;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 0 0 1px var(--bronze);
  clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px);
}
.tg-srv-flag.lumen { background: linear-gradient(180deg, #e8c21a 0 3px, #23874a 3px calc(100% - 3px), #e8c21a calc(100% - 3px)); }
.tg-srv-flag.eldor { background: linear-gradient(180deg, #2c4a9a 0 calc(100% - 7px), #c4232e calc(100% - 7px) calc(100% - 5px), #e8e2d6 calc(100% - 5px) calc(100% - 3px), #c4232e calc(100% - 3px)); }
.tg-srv-name { display: grid; gap: 3px; min-width: 0; }
.tg-srv-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 calc(17px * var(--txt))/1.1 var(--f-ui); }
.tg-srv-name small { font: 400 calc(9px * var(--txt))/1.2 var(--f-num); letter-spacing: .5px; text-transform: uppercase; color: var(--dim); }   /* "EUA-Leste · mais próximo do Brasil" on one line */
.tg-srv-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tg-srv-tags:empty { display: none; }
.tg-srv-tag { padding: 2px 5px 1px; font: 400 calc(8px * var(--txt))/1 var(--f-num); font-style: normal; letter-spacing: .5px; text-transform: uppercase; }
.tg-srv-tag.hide { display: none; }
.tg-srv-tag.rec { color: #0d2410; text-shadow: none; background: linear-gradient(180deg, #9be86a, #4fe06a); box-shadow: 0 0 6px rgba(79, 224, 106, .45); }
.tg-srv-tag.last { color: var(--gold2); border: 1px solid var(--bronze); }
.tg-srv-st { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px * var(--txt)); color: #a6e89a; }
.tg-srv-gem { flex: none; width: 9px; height: 9px; background: var(--exc); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); animation: tgPulse 2.4s steps(4) infinite; }
.tg-srv-st.pre { color: var(--uni); }                                    /* "Prévia": no realm server yet, amber and still */
.tg-srv-st.pre .tg-srv-gem { background: var(--uni); animation: none; }
.tg-srv-pop { display: grid; gap: 4px; justify-items: start; }
.tg-srv-pop small { font: 400 calc(9px * var(--txt))/1 var(--f-num); letter-spacing: .5px; text-transform: uppercase; color: var(--dim); }
.tg-srv-bar { display: flex; gap: 2px; padding: 2px; background: var(--well); border: 1px solid var(--edge); }
.tg-srv-bar i { width: 18px; height: 7px; background: #2a2430; }
.tg-srv-bar i.on { background: linear-gradient(180deg, #b8ffb0, var(--exc) 55%, #1e7a2a); }
.tg-srv-ping { text-align: right; font: 400 calc(12px * var(--txt))/1 var(--f-num); color: var(--dim); }
.tg-srv-note { margin: 2px 0 0; text-align: center; font-size: calc(11px * var(--txt)); line-height: 1.35; color: var(--dim); }
/* phones, and short landscape (the list sits in the narrow right column): name on top, status · population · ping below */
@media (max-width: 560px), (max-height: 500px) and (min-width: 561px) {
  .tg-srv { padding: 12px 10px 10px; }
  .tg-srv-hd { display: none; }
  .btn.tg-srv-row { grid-template-columns: 46px minmax(0, 1fr) auto auto; grid-template-rows: auto auto; row-gap: 8px; padding: 9px 10px; }
  .tg-srv-row .tg-srv-flag { grid-row: 1 / 3; align-self: start; }
  .tg-srv-row .tg-srv-name { grid-column: 2 / 5; }
  .tg-srv-row .tg-srv-st { grid-column: 2; grid-row: 2; }
  .tg-srv-row .tg-srv-pop { grid-column: 3; grid-row: 2; grid-template-columns: auto; }
  .tg-srv-row .tg-srv-pop small { display: none; }
  .tg-srv-row .tg-srv-ping { grid-column: 4; grid-row: 2; min-width: 28px; }
}
@media (max-height: 500px) and (min-width: 561px) {
  .tg-srv { grid-column: 2; grid-row: 1 / -1; width: 100%; margin-top: 0; max-height: calc(100vh - 40px); overflow-y: auto; gap: 6px; padding: 8px 10px; scrollbar-width: thin; scrollbar-color: var(--bronze) transparent; }
  .tg-srv .tg-pane-h { font-size: calc(22px * var(--txt-h)); }
  .btn.tg-srv-row { min-height: 0; padding: 7px 10px; }
  .tg-srv-note { font-size: calc(10px * var(--txt)); }
  .tg-auth.tg-acc { padding: 0; }
  .tg-auth-b { gap: 4px; padding: 8px 14px; }
  .tg-tab { min-height: 36px; font-size: calc(22px * var(--txt-h)); }
  .tg-rem, .tg-auth-row .btn.tg-link { font-size: calc(13px * var(--txt)); }
  /* the login tab fits the panel without scrolling: labels become the placeholders (still the inputs' names), slimmer wells */
  .tg-acc .tg-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tg-acc .tg-in::placeholder { color: #6f6656; }
  .tg-acc .tg-in { height: 38px; font-size: calc(16px * var(--txt)); }
  .tg-acc .tg-eye { width: 34px; height: 34px; }
  .tg-gbtn { height: 40px; }
  .tg-acc .tg-tp { gap: 6px; }
  .tg-rem, .tg-auth-row .btn.tg-link { min-height: 32px; }
  .tg-acc .btn.tg-auth-go { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .tg-tabs::after { transition: none; }
  .tg-tp { animation: none; }
  .btn.tg-srv-row { animation-name: fadeIn; animation-timing-function: linear; }
  .tg-srv-gem { animation: none; }
}
