html { scrollbar-gutter: stable; }

/* ==================================================================
   LEGEND TOWN  —  application modal
   Same dark glass + cyan language as the rest of the site. Built
   mobile-first: on a phone it becomes a full-height sheet instead of
   a tiny box with its own scrollbar.
   ================================================================== */

.lt-ap-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 5, 12, .82);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.lt-ap-overlay.is-open { display: flex; }
.lt-ap-overlay, .lt-ap-card { contain: layout paint; }
.lt-ap-overlay { will-change: opacity; }
.lt-ap-card { will-change: transform; }

.lt-ap-card {
  --ap-accent: #22d3ee;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow: hidden;
  border: 2px solid var(--ap-accent);
  border-radius: 0;
  background: linear-gradient(180deg, #0a1220 0%, #070b14 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .62), 0 0 0 1px var(--ap-accent) inset;
  font-family: inherit;
}

/* ---- head ---- */

.lt-ap-head {
  position: relative;
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.lt-ap-tag {
  display: inline-block;
  padding: .3rem .8rem;
  border: 1px solid var(--ap-accent);
  border-radius: 0;
  color: var(--ap-accent);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .18em;
}

.lt-ap-title {
  margin: .9rem 0 0;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
}

.lt-ap-sub {
  margin: .4rem 0 0;
  font-size: .8rem;
  color: #94a3b8;
  line-height: 1.7;
}

.lt-ap-x,
.lt-ap-lang {
  position: absolute;
  z-index: 50;
  top: 1.25rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 0;
  background: rgba(255, 255, 255, .05);
  color: #cbd5e1;
  font-size: .95rem;
  cursor: pointer;
  transition: all .2s ease;
}

.lt-ap-lang {
  width: auto;
  padding: 0 .85rem;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
}

.lt-ap-card[dir="rtl"] .lt-ap-x    { left: 1.25rem; }
.lt-ap-card[dir="rtl"] .lt-ap-lang { left: 4.25rem; }
.lt-ap-card[dir="ltr"] .lt-ap-x    { right: 1.25rem; }
.lt-ap-card[dir="ltr"] .lt-ap-lang { right: 4.25rem; }

.lt-ap-x:hover,
.lt-ap-lang:hover {
  border-color: var(--ap-accent);
  color: var(--ap-accent);
}

/* ---- steps ---- */

.lt-ap-steps {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.lt-ap-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  opacity: .45;
  transition: opacity .3s ease;
}

.lt-ap-step span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: .78rem;
  font-weight: 900;
  color: #cbd5e1;
}

.lt-ap-step b {
  font-size: .6rem;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
}

.lt-ap-step.is-active { opacity: 1; }
.lt-ap-step.is-active span {
  background: var(--ap-accent);
  border-color: var(--ap-accent);
  color: #04121a;
}
.lt-ap-step.is-done { opacity: .8; }
.lt-ap-step.is-done span {
  border-color: var(--ap-accent);
  color: var(--ap-accent);
}

.lt-ap-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .12);
}

/* ---- body ---- */

.lt-ap-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.5rem 1.75rem;
}

.lt-ap-field { margin-bottom: 1.1rem; }

.lt-ap-field label {
  display: block;
  margin-bottom: .45rem;
  font-size: .78rem;
  font-weight: 700;
  color: #e2e8f0;
}

.lt-ap-field label span { color: #ef4444; }

.lt-ap-field input,
.lt-ap-field textarea,
.lt-ap-field select {
  width: 100%;
  padding: .8rem .95rem;
  border: 2px solid rgba(255, 255, 255, .14);
  border-radius: 0;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.lt-ap-field textarea { resize: vertical; min-height: 96px; line-height: 1.7; }

.lt-ap-field input:focus,
.lt-ap-field textarea:focus,
.lt-ap-field select:focus {
  border-color: var(--ap-accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .12);
}

.lt-ap-field .is-bad {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .14) !important;
}

.lt-ap-select { position: relative; }

.lt-ap-select select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.lt-ap-select::after {
  content: '▾';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ap-accent);
  pointer-events: none;
  font-size: .85rem;
}

.lt-ap-card[dir="rtl"] .lt-ap-select::after { left: .95rem; }
.lt-ap-card[dir="ltr"] .lt-ap-select::after { right: .95rem; }

.lt-ap-field select option { background: #0a1220; color: #fff; }

.lt-ap-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.lt-ap-count { display: block; margin-top: .35rem; font-size: .68rem; color: #64748b; }
.lt-ap-count.is-short b { color: #f59e0b; }
.lt-ap-count b { color: #22c55e; }

.lt-ap-dept-tag {
  display: inline-block;
  margin-bottom: 1.1rem;
  padding: .45rem .9rem;
  border: 1px solid var(--ap-accent);
  border-radius: 0;
  background: rgba(34, 211, 238, .08);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
}

/* ---- messages ---- */

.lt-ap-msg {
  margin: 0 1.75rem;
  padding: .75rem 1rem;
  border-radius: 0;
  font-size: .8rem;
  font-weight: 600;
}

.lt-ap-err {
  border: 1px solid rgba(239, 68, 68, .4);
  background: rgba(239, 68, 68, .12);
  color: #fca5a5;
}

.lt-ap-done { padding: 2.5rem 1rem; text-align: center; }

.lt-ap-tick {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: rgba(34, 197, 94, .15);
  border: 1px solid #22c55e;
  color: #22c55e;
  font-size: 2rem;
}

.lt-ap-done h3 { margin: 0; font-size: 1.25rem; font-weight: 900; color: #fff; }
.lt-ap-done p  { margin: .5rem 0 0; font-size: .85rem; color: #94a3b8; }

/* ---- foot ---- */

.lt-ap-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.1rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.lt-ap-btn {
  min-width: 128px;
  padding: .8rem 1.5rem;
  border-radius: 0;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter .2s ease, transform .15s ease;
}

.lt-ap-btn:active { transform: translateY(1px); }
.lt-ap-btn:disabled { opacity: .6; cursor: not-allowed; }

.lt-ap-go {
  background: var(--ap-accent);
  color: #04121a;
  box-shadow: 0 10px 30px rgba(34, 211, 238, .25);
}

.lt-ap-go:hover:not(:disabled) { filter: brightness(1.1); }

.lt-ap-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .15);
  color: #cbd5e1;
}

.lt-ap-ghost:hover { border-color: var(--ap-accent); color: var(--ap-accent); }

/* ==================================================================
   PHONE  —  full-height sheet, bigger tap targets, no inner scrollbar
   ================================================================== */

@media (max-width: 640px) {
  .lt-ap-overlay { padding: 0; align-items: flex-end; }

  .lt-ap-card {
    max-width: 100%;
    max-height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }

  .lt-ap-head  { padding: 1.25rem 1.1rem 1rem; padding-top: max(1.25rem, env(safe-area-inset-top)); }
  .lt-ap-title { font-size: 1.15rem; }
  .lt-ap-sub   { font-size: .74rem; }
  .lt-ap-body  { padding: 1.1rem; }
  .lt-ap-msg   { margin: 0 1.1rem; }

  .lt-ap-steps { padding: .8rem 1.1rem; }
  .lt-ap-step b { display: none; }

  .lt-ap-row { grid-template-columns: 1fr; gap: 0; }

  /* 16px stops iOS zooming the page when a field is focused */
  .lt-ap-field input,
  .lt-ap-field textarea,
  .lt-ap-field select { font-size: 16px; padding: .85rem .9rem; }

  .lt-ap-foot {
    padding: .9rem 1.1rem;
    padding-bottom: max(.9rem, env(safe-area-inset-bottom));
  }

  .lt-ap-btn { flex: 1; min-width: 0; padding: .95rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lt-ap-btn, .lt-ap-x, .lt-ap-lang, .lt-ap-step { transition: none; }
}


/* ==================================================================
   SHARP EDGE PASS
   Zero radius and heavier borders, matching the rest of the LT
   systems. Only the step numbers and avatars stay round.
   ================================================================== */

.lt-ap-card {
  border: 2px solid var(--ap-accent);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 90px rgba(0,0,0,.75),
              0 0 45px -12px var(--ap-accent);
}

.lt-ap-tag { border-width: 2px; border-radius: 0; }

.lt-ap-x,
.lt-ap-lang { border-width: 2px; border-radius: 0; }

.lt-ap-step span { border-radius: 999px; border-width: 2px; }

.lt-ap-btn { border-width: 2px; letter-spacing: .06em; text-transform: uppercase; }

.lt-ap-go {
  border-color: var(--ap-accent);
  box-shadow: 0 0 24px -6px var(--ap-accent);
}

.lt-ap-ghost { border-color: rgba(255,255,255,.22); }

.lt-ap-dept-tag {
  border-width: 2px;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.lt-ap-field input:focus,
.lt-ap-field textarea:focus,
.lt-ap-field select:focus {
  border-color: var(--ap-accent);
  box-shadow: none;
}

/* ---- Discord connect button ---- */

.lt-ap-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  width: 100%;
  padding: 1rem;
  border: 2px solid #5865f2;
  background: rgba(88, 101, 242, .14);
  color: #fff;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .2s ease;
}

.lt-ap-discord:hover { background: #5865f2; }

.lt-ap-hint {
  display: block;
  margin-top: .5rem;
  font-size: .7rem;
  color: #64748b;
  line-height: 1.6;
}

.lt-ap-verified {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  margin-bottom: 1rem;
  border: 2px solid #22c55e;
  background: rgba(34, 197, 94, .1);
}

.lt-ap-verified img,
.lt-ap-noav {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 2px solid #22c55e;
  background: #0b1120;
  object-fit: cover;
  flex: none;
}

.lt-ap-verified > div { display: flex; flex-direction: column; min-width: 0; }
.lt-ap-verified b { color: #fff; font-size: .92rem; font-weight: 900; }
.lt-ap-verified small { color: #94a3b8; font-size: .72rem; }

.lt-ap-check {
  margin-inline-start: auto;
  padding: .25rem .6rem;
  border: 2px solid #22c55e;
  color: #4ade80;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
}

.lt-ap-relink {
  width: 100%;
  padding: .6rem;
  border: 2px solid rgba(255,255,255,.16);
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
}

.lt-ap-relink:hover { border-color: #5865f2; color: #fff; }

.lt-ap-tick { border-radius: 999px; border-width: 2px; }


/* ------------------------------------------------------------------
   Department note — the short warning shown at the top of step 3 for
   any department that sets `note:` in lt-apply.js (the whitelist
   exam uses it). Inherits the accent colour of the department.
------------------------------------------------------------------ */
.lt-ap-note {
  margin: 0 0 1.1rem;
  padding: .85rem 1rem;
  border-radius: 6px;
  /* plain values first so old browsers still get something sensible,
     then the accent-tinted versions on top */
  border: 1px solid rgba(34,211,238,.32);
  background: rgba(34,211,238,.09);
  border: 1px solid color-mix(in srgb, var(--ap-accent, #22d3ee) 35%, transparent);
  background: color-mix(in srgb, var(--ap-accent, #22d3ee) 10%, transparent);
  border-inline-start: 3px solid var(--ap-accent, #22d3ee);
  color: #cbd5e1;
  font-size: .82rem;
  line-height: 1.85;
}


/* ==================================================================
   PRO SCROLLBAR PASS — application modal
   ------------------------------------------------------------------
   The form keeps one dedicated scroll surface. The scrollbar is thin,
   dark and stable instead of the default bright browser bar.
   ================================================================== */

.lt-ap-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(34,211,238,.45) rgba(255,255,255,.025);
  scrollbar-gutter: stable;
}

.lt-ap-body::-webkit-scrollbar {
  width: 8px;
}

.lt-ap-body::-webkit-scrollbar-track {
  background: rgba(255,255,255,.025);
}

.lt-ap-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34,211,238,.62), rgba(32,144,208,.45));
  border: 2px solid rgba(7,11,20,.95);
  border-radius: 999px;
}

.lt-ap-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(34,211,238,.86), rgba(32,144,208,.7));
}

.lt-ap-overlay {
  overscroll-behavior: contain;
}

.lt-ap-card {
  contain: layout paint;
}

@media (prefers-reduced-motion: reduce) {
  .lt-ap-body { scroll-behavior: auto; }
}


/* ============================================================
   LEGEND TOWN GLOBAL HEADER FIX
   Prevent fixed/sticky navigation from covering page content.
   ============================================================ */
:root {
  --lt-header-height: 84px;
  --lt-header-gap: 24px;
}

html {
  scroll-padding-top: calc(var(--lt-header-height) + var(--lt-header-gap));
}

body {
  padding-top: 0 !important;
}

/* Common fixed/sticky header selectors used by the site */
header,
.site-header,
.main-header,
.navbar,
nav.site-nav,
.topbar,
.top-nav {
  z-index: 1000;
}

/* Main page containers must begin below the fixed header */
main,
main.page,
.page-content,
.page-container,
.content,
.site-content,
.page-section,
section:first-of-type {
  scroll-margin-top: calc(var(--lt-header-height) + var(--lt-header-gap));
}

/* Explicit hero/page-title spacing. This intentionally uses margin/padding
   rather than transforms so headings cannot slide underneath the header. */
.hero,
.page-hero,
.page-title,
.leaderboard-page,
.leaderboard,
.faq-page,
.team-page,
.streams-page,
.apply-page,
.applications-page {
  position: relative;
  z-index: 1;
}

.page-hero,
.page-title,
.leaderboard-page > .page-title,
.leaderboard > .page-title {
  padding-top: calc(var(--lt-header-height) + var(--lt-header-gap)) !important;
}

@media (max-width: 900px) {
  :root {
    --lt-header-height: 72px;
    --lt-header-gap: 18px;
  }

  .page-hero,
  .page-title,
  .leaderboard-page > .page-title,
  .leaderboard > .page-title {
    padding-top: calc(var(--lt-header-height) + var(--lt-header-gap)) !important;
  }
}

@media (max-width: 640px) {
  :root {
    --lt-header-height: 64px;
    --lt-header-gap: 14px;
  }
}


/* ==================================================================
   APPLICATION MODAL — STREAMER APPLY VISUAL MATCH
   Keep the existing application logic, but make the generated
   department modal use the exact visual language of the Streamer
   application modal: blue LT accent, glass-dark card, soft radius,
   compact header, rounded controls and blue CTA.
   ================================================================== */
.lt-ap-overlay {
  padding: 1.25rem;
  align-items: center;
  justify-content: center;
  background: rgba(2, 5, 12, .88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lt-ap-card {
  --ap-accent: var(--lt-blue, #2090d0) !important;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  border: 1px solid var(--lt-line, rgba(32,144,208,.28)) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #0a0f18 0%, #05070d 100%) !important;
  box-shadow: 0 30px 90px rgba(0,0,0,.85), 0 0 70px rgba(32,144,208,.07) !important;
  font-family: inherit;
  animation: lt-ap-streamer-in .28s cubic-bezier(.2,.8,.3,1);
}

@keyframes lt-ap-streamer-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.lt-ap-head {
  padding: 0 0 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.lt-ap-tag {
  padding: .35rem .85rem;
  border: 1px solid var(--lt-line, rgba(32,144,208,.28)) !important;
  border-radius: 999px !important;
  background: rgba(32,144,208,.1) !important;
  color: var(--lt-blue-bright, #55baf0) !important;
  font-size: .62rem;
  letter-spacing: .22em;
}

.lt-ap-title {
  margin-top: .8rem;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
}

.lt-ap-sub {
  margin-top: .45rem;
  font-size: .82rem;
  color: #64748b;
  line-height: 1.7;
}

.lt-ap-x,
.lt-ap-lang {
  top: -.25rem;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.04) !important;
  color: #94a3b8;
}

.lt-ap-x:hover,
.lt-ap-lang:hover {
  border-color: rgba(32,144,208,.35) !important;
  background: rgba(32,144,208,.1) !important;
  color: var(--lt-blue-bright, #55baf0) !important;
}

.lt-ap-lang {
  width: auto;
  height: 38px;
  padding: 0 .85rem;
  border-radius: 999px !important;
}

.lt-ap-steps {
  gap: .5rem;
  margin: 1.4rem 0 1.1rem;
  padding: 0;
  border: 0;
}

.lt-ap-step span {
  width: 30px;
  height: 30px;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: #475569;
}

.lt-ap-step.is-active span {
  background: var(--lt-blue, #2090d0) !important;
  border-color: var(--lt-blue, #2090d0) !important;
  color: #fff !important;
  box-shadow: 0 0 18px rgba(32,144,208,.5) !important;
}

.lt-ap-step.is-done span {
  background: rgba(32,144,208,.2) !important;
  color: var(--lt-blue-bright, #55baf0) !important;
  border-color: var(--lt-line, rgba(32,144,208,.28)) !important;
}

.lt-ap-step.is-active b { color: var(--lt-blue-bright, #55baf0); }
.lt-ap-line { background: rgba(255,255,255,.1); }

.lt-ap-body {
  padding: 0;
  scrollbar-color: rgba(32,144,208,.45) rgba(255,255,255,.025);
}

.lt-ap-field { margin-bottom: 1.25rem; }
.lt-ap-field label {
  margin-bottom: .55rem;
  color: #cbd5e1;
  font-size: .76rem;
  font-weight: 800;
}
.lt-ap-field label span { color: var(--lt-blue-bright, #55baf0); }

.lt-ap-field input,
.lt-ap-field select,
.lt-ap-field textarea {
  background: rgba(4,9,16,.75) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  border-radius: 5px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  padding: .9rem 1.1rem !important;
  line-height: 1.6;
  color: #fff;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.lt-ap-field input:hover,
.lt-ap-field select:hover,
.lt-ap-field textarea:hover {
  border-color: rgba(255,255,255,.16) !important;
}

.lt-ap-field input:focus,
.lt-ap-field select:focus,
.lt-ap-field textarea:focus {
  border-color: var(--lt-blue, #2090d0) !important;
  box-shadow: 0 0 0 3px rgba(32,144,208,.16) !important;
  background: rgba(4,9,16,.95) !important;
}

.lt-ap-field input::placeholder,
.lt-ap-field textarea::placeholder { color: #3f4c5f; }

.lt-ap-select::after {
  color: var(--lt-blue-bright, #55baf0) !important;
}

.lt-ap-dept-tag {
  margin-bottom: 1.25rem;
  padding: .55rem .9rem;
  border: 1px solid var(--lt-line, rgba(32,144,208,.28)) !important;
  border-radius: 5px !important;
  background: rgba(32,144,208,.08) !important;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
}

.lt-ap-verified {
  border: 1px solid rgba(34,197,94,.35);
  border-radius: 5px;
  background: rgba(34,197,94,.08);
}

.lt-ap-foot {
  padding: 1.4rem 0 0;
  border-top: 0;
}

.lt-ap-btn {
  min-width: 0;
  padding: .85rem 1.2rem;
  border-radius: 5px !important;
  border: 1px solid transparent;
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.lt-ap-go {
  background: linear-gradient(135deg, var(--lt-blue, #2090d0), var(--lt-blue-deep, #146a9b)) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 6px 22px rgba(32,144,208,.35) !important;
}

.lt-ap-go:hover:not(:disabled) {
  filter: none;
  background: linear-gradient(135deg, var(--lt-blue-light, #35a9e8), var(--lt-blue, #2090d0)) !important;
  transform: translateY(-1px);
}

.lt-ap-ghost {
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.1) !important;
  color: #94a3b8 !important;
}

.lt-ap-ghost:hover {
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(32,144,208,.35) !important;
  color: #fff !important;
}

.lt-ap-msg { border-radius: 5px; }

@media (max-width: 768px) {
  .lt-ap-overlay {
    padding: .6rem;
    align-items: center;
  }
  .lt-ap-card {
    max-width: 100%;
    max-height: 94vh;
    height: auto;
    border-radius: 18px !important;
    padding: 1.15rem;
  }
  .lt-ap-head { padding-bottom: 1rem; }
  .lt-ap-title { font-size: 1.25rem; }
  .lt-ap-row { grid-template-columns: 1fr; gap: 0; }
  .lt-ap-step b { display: none; }
  .lt-ap-field input,
  .lt-ap-field select,
  .lt-ap-field textarea { font-size: 16px; }
  .lt-ap-foot { padding-top: 1rem; }
  .lt-ap-btn { padding: .8rem .9rem; font-size: .82rem; }
}


/* ==================================================================
   LEGEND TOWN APPLICATIONS — FINAL UI PASS
   Isolated from the rest of the website so Tailwind/homepage rules
   cannot collapse the modal on smaller screens.
   ================================================================== */

#lt-apply-modal.lt-ap-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: clamp(14px, 3vw, 32px) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 50% 10%, rgba(32,144,208,.13), transparent 38%),
    rgba(2, 6, 12, .90) !important;
}

#lt-apply-modal .lt-ap-card {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  width: min(760px, 100%) !important;
  max-width: 760px !important;
  height: min(860px, 92vh) !important;
  max-height: 92vh !important;
  min-height: 0 !important;
  margin: auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(96,185,235,.20) !important;
  border-radius: 22px !important;
  background: linear-gradient(180deg, rgba(12,20,31,.985), rgba(5,9,16,.995)) !important;
  box-shadow: 0 35px 100px rgba(0,0,0,.72), 0 0 80px rgba(32,144,208,.08) !important;
  isolation: isolate;
}

#lt-apply-modal .lt-ap-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ap-accent,#2090d0), transparent);
  z-index: 2;
}

#lt-apply-modal .lt-ap-head {
  position: relative !important;
  flex: 0 0 auto !important;
  min-height: 150px;
  padding: 30px 34px 24px !important;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255,255,255,.07) !important;
  background: radial-gradient(circle at 8% 0%, rgba(32,144,208,.13), transparent 35%), rgba(10,16,26,.82) !important;
}

#lt-apply-modal .lt-ap-tag {
  display: inline-flex !important;
  align-items: center;
  min-height: 28px;
  padding: 5px 11px !important;
  border: 1px solid rgba(70,170,225,.22) !important;
  border-radius: 999px !important;
  background: rgba(32,144,208,.08) !important;
  color: #72c9f4 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .12em !important;
}

#lt-apply-modal .lt-ap-title {
  margin: 13px 0 0 !important;
  color: #f8fbff !important;
  font-size: clamp(24px, 3vw, 34px) !important;
  line-height: 1.15 !important;
  font-weight: 950 !important;
}

#lt-apply-modal .lt-ap-sub {
  max-width: 620px;
  margin: 9px 0 0 !important;
  color: #8494a8 !important;
  font-size: 13px !important;
  line-height: 1.8 !important;
}

#lt-apply-modal .lt-ap-x,
#lt-apply-modal .lt-ap-lang {
  position: absolute !important;
  top: 24px !important;
  width: 42px !important;
  height: 42px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.09) !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.035) !important;
  color: #a6b4c4 !important;
  transition: .18s ease;
}

#lt-apply-modal .lt-ap-x { inset-inline-end: 24px !important; }
#lt-apply-modal .lt-ap-lang {
  inset-inline-start: 24px !important;
  width: auto !important;
  min-width: 74px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

#lt-apply-modal .lt-ap-x:hover,
#lt-apply-modal .lt-ap-lang:hover {
  color: #fff !important;
  border-color: rgba(72,181,238,.4) !important;
  background: rgba(32,144,208,.12) !important;
  transform: translateY(-1px);
}

#lt-apply-modal .lt-ap-steps {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 18px 34px 16px !important;
  box-sizing: border-box;
  background: rgba(5,10,17,.72) !important;
  border-bottom: 1px solid rgba(255,255,255,.055) !important;
}

#lt-apply-modal .lt-ap-step {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  color: #53657a;
}

#lt-apply-modal .lt-ap-step span {
  width: 32px !important;
  height: 32px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.11) !important;
  border-radius: 50% !important;
  background: #0d1621 !important;
  color: #6d8095 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

#lt-apply-modal .lt-ap-step.is-active span {
  color: #fff !important;
  border-color: #38a9e5 !important;
  background: #2090d0 !important;
  box-shadow: 0 0 22px rgba(32,144,208,.35) !important;
}
#lt-apply-modal .lt-ap-step.is-active b { color: #eaf7ff !important; }
#lt-apply-modal .lt-ap-step.is-done span {
  color: #76cdf5 !important;
  border-color: rgba(32,144,208,.42) !important;
  background: rgba(32,144,208,.13) !important;
}
#lt-apply-modal .lt-ap-step b {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #718197 !important;
  white-space: nowrap;
}
#lt-apply-modal .lt-ap-line {
  flex: 1 1 auto !important;
  min-width: 18px;
  height: 1px !important;
  margin: 0 2px !important;
  background: rgba(255,255,255,.08) !important;
}

#lt-apply-modal .lt-ap-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 28px 34px 4px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(45,155,212,.65) transparent;
}
#lt-apply-modal .lt-ap-body::-webkit-scrollbar { width: 7px; }
#lt-apply-modal .lt-ap-body::-webkit-scrollbar-track { background: transparent; }
#lt-apply-modal .lt-ap-body::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(45,155,212,.55); }

#lt-apply-modal .lt-ap-row {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) minmax(120px,.35fr) !important;
  gap: 18px !important;
}
#lt-apply-modal[dir="rtl"] .lt-ap-row {
  grid-template-columns: minmax(120px,.35fr) minmax(0,1fr) !important;
}

#lt-apply-modal .lt-ap-field { margin: 0 0 18px !important; }
#lt-apply-modal .lt-ap-field label {
  display: block !important;
  margin: 0 0 8px !important;
  color: #d7e0ea !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.4 !important;
}
#lt-apply-modal .lt-ap-field label span { color: #4fc0ef !important; }

#lt-apply-modal .lt-ap-field input,
#lt-apply-modal .lt-ap-field select,
#lt-apply-modal .lt-ap-field textarea {
  width: 100% !important;
  min-height: 48px !important;
  box-sizing: border-box !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(135,157,180,.14) !important;
  border-radius: 12px !important;
  outline: none !important;
  background: rgba(4,10,18,.9) !important;
  color: #f5f8fb !important;
  font: inherit !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
#lt-apply-modal .lt-ap-field textarea { min-height: 120px !important; resize: vertical !important; }
#lt-apply-modal .lt-ap-field input:hover,
#lt-apply-modal .lt-ap-field select:hover,
#lt-apply-modal .lt-ap-field textarea:hover { border-color: rgba(120,178,211,.28) !important; }
#lt-apply-modal .lt-ap-field input:focus,
#lt-apply-modal .lt-ap-field select:focus,
#lt-apply-modal .lt-ap-field textarea:focus {
  border-color: rgba(58,176,229,.75) !important;
  background: rgba(5,13,23,.98) !important;
  box-shadow: 0 0 0 3px rgba(32,144,208,.12), 0 8px 25px rgba(0,0,0,.16) !important;
}

#lt-apply-modal .lt-ap-dept-tag {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 0 22px !important;
  padding: 10px 13px !important;
  box-sizing: border-box;
  border: 1px solid rgba(55,164,216,.22) !important;
  border-radius: 12px !important;
  background: linear-gradient(90deg, rgba(32,144,208,.11), rgba(32,144,208,.035)) !important;
  color: #dff4ff !important;
  font-size: 13px !important;
  font-weight: 850 !important;
}
#lt-apply-modal .lt-ap-note {
  margin: -4px 0 18px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.025) !important;
  color: #91a1b4 !important;
  font-size: 12px !important;
  line-height: 1.75 !important;
}
#lt-apply-modal .lt-ap-count {
  display: block !important;
  margin-top: 7px !important;
  color: #5f7186 !important;
  font-size: 10px !important;
}
#lt-apply-modal .lt-ap-count b { color: #73c9ee !important; }
#lt-apply-modal .lt-ap-count.is-short b { color: #f59e0b !important; }

#lt-apply-modal .lt-ap-verified {
  display: flex !important;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  margin-bottom: 10px;
  padding: 12px 14px !important;
  border: 1px solid rgba(34,197,94,.22) !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(255,255,255,.02)) !important;
}
#lt-apply-modal .lt-ap-verified img,
#lt-apply-modal .lt-ap-noav {
  width: 44px !important;
  height: 44px !important;
  flex: 0 0 44px;
  border-radius: 50%;
  object-fit: cover;
}
#lt-apply-modal .lt-ap-verified b { display:block; color:#f2fbf5 !important; font-size:13px; }
#lt-apply-modal .lt-ap-verified small { display:block; margin-top:3px; color:#76908a !important; font-size:10px; }
#lt-apply-modal .lt-ap-check { margin-inline-start:auto; color:#79e3a0 !important; font-size:11px !important; font-weight:900 !important; white-space:nowrap; }

#lt-apply-modal .lt-ap-discord,
#lt-apply-modal .lt-ap-relink {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(88,101,242,.35);
  border-radius: 12px;
  background: rgba(88,101,242,.10);
  color: #e9ebff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: .18s ease;
}
#lt-apply-modal .lt-ap-discord:hover,
#lt-apply-modal .lt-ap-relink:hover {
  border-color: rgba(88,101,242,.65);
  background: rgba(88,101,242,.17);
  transform: translateY(-1px);
}
#lt-apply-modal .lt-ap-hint { display:block; margin-top:8px; color:#5e7186; font-size:10px; line-height:1.7; }

#lt-apply-modal .lt-ap-msg {
  flex: 0 0 auto !important;
  margin: 0 34px 12px !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  font-size: 12px !important;
  line-height: 1.7 !important;
}
#lt-apply-modal .lt-ap-err {
  border: 1px solid rgba(248,113,113,.32) !important;
  background: rgba(127,29,29,.18) !important;
  color: #fca5a5 !important;
}

#lt-apply-modal .lt-ap-foot {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 78px;
  padding: 14px 34px 20px !important;
  box-sizing: border-box;
  border-top: 1px solid rgba(255,255,255,.07) !important;
  background: rgba(7,12,20,.9) !important;
}
#lt-apply-modal .lt-ap-btn {
  min-width: 120px !important;
  min-height: 46px !important;
  padding: 0 18px !important;
  border-radius: 12px !important;
  border: 1px solid transparent !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  cursor: pointer;
  transition: .18s ease;
}
#lt-apply-modal .lt-ap-go {
  color: #fff !important;
  background: linear-gradient(135deg,#2aa8e4,#1778ad) !important;
  box-shadow: 0 8px 25px rgba(32,144,208,.22) !important;
}
#lt-apply-modal .lt-ap-go:hover:not(:disabled) { filter:brightness(1.08); transform:translateY(-1px); }
#lt-apply-modal .lt-ap-go:disabled { cursor:wait; opacity:.68; transform:none; }
#lt-apply-modal .lt-ap-ghost {
  color:#b2bfcd !important;
  background:rgba(255,255,255,.035) !important;
  border-color:rgba(255,255,255,.09) !important;
}
#lt-apply-modal .lt-ap-ghost:hover { color:#fff !important; background:rgba(255,255,255,.075) !important; }

@media (max-width:700px) {
  #lt-apply-modal.lt-ap-overlay { padding:10px !important; }
  #lt-apply-modal .lt-ap-card { width:100% !important; height:94vh !important; max-height:94vh !important; border-radius:18px !important; }
  #lt-apply-modal .lt-ap-head { min-height:130px; padding:24px 20px 18px !important; }
  #lt-apply-modal .lt-ap-title { font-size:23px !important; }
  #lt-apply-modal .lt-ap-sub { font-size:11px !important; max-width:100%; }
  #lt-apply-modal .lt-ap-x { top:18px !important; inset-inline-end:18px !important; }
  #lt-apply-modal .lt-ap-lang { top:18px !important; inset-inline-start:18px !important; }
  #lt-apply-modal .lt-ap-steps { padding:14px 20px !important; }
  #lt-apply-modal .lt-ap-step b { display:none; }
  #lt-apply-modal .lt-ap-body { padding:22px 20px 2px !important; }
  #lt-apply-modal .lt-ap-row,
  #lt-apply-modal[dir="rtl"] .lt-ap-row { grid-template-columns:1fr !important; gap:0 !important; }
  #lt-apply-modal .lt-ap-foot { padding:12px 20px 16px !important; }
  #lt-apply-modal .lt-ap-msg { margin-inline:20px !important; }
}

#lt-apply-modal .lt-ap-success {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 12px;
  text-align: center;
}
#lt-apply-modal .lt-ap-success-icon {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(74,211,145,.35);
  border-radius: 50%;
  background: rgba(34,197,94,.10);
  color: #70e0a1;
  font-size: 34px;
  font-weight: 950;
  box-shadow: 0 0 45px rgba(34,197,94,.12);
}
#lt-apply-modal .lt-ap-success h3 {
  margin: 22px 0 7px;
  color: #f7fbff;
  font-size: 22px;
  font-weight: 950;
}
#lt-apply-modal .lt-ap-success p {
  max-width: 520px;
  margin: 0;
  color: #8798ab;
  font-size: 12px;
  line-height: 1.9;
}
#lt-apply-modal .lt-ap-close-final { margin-inline-start: auto; }

/* ==================================================================
   LEGEND TOWN APPLICATIONS — MODERN 2026 PASS
   ================================================================== */
.lt-ap-overlay {
  padding: 1.5rem;
  background: rgba(2, 6, 15, .78);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.lt-ap-card {
  width: min(900px, 100%);
  max-width: 900px;
  max-height: min(900px, 92vh);
  border: 1px solid color-mix(in srgb, var(--ap-accent) 55%, white 10%);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--ap-accent) 13%, transparent), transparent 32%),
    linear-gradient(145deg, #0b1220 0%, #070b14 62%, #050810 100%);
  box-shadow: 0 32px 100px rgba(0,0,0,.68), 0 0 0 1px rgba(255,255,255,.035) inset, 0 0 55px -25px var(--ap-accent);
}

.lt-ap-head { padding: 1.65rem 2rem 1.35rem; background: linear-gradient(180deg, rgba(255,255,255,.035), transparent); }
.lt-ap-tag { border: 1px solid color-mix(in srgb, var(--ap-accent) 70%, white 8%); border-radius: 999px; padding: .4rem .85rem; letter-spacing: .12em; background: rgba(255,255,255,.025); }
.lt-ap-title { font-size: clamp(1.35rem, 2vw, 1.8rem); letter-spacing: -.025em; }
.lt-ap-sub { max-width: 680px; }
.lt-ap-x, .lt-ap-lang { border: 1px solid rgba(255,255,255,.13); border-radius: 12px; background: rgba(255,255,255,.045); }
.lt-ap-x { width: 42px; height: 42px; }

.lt-ap-steps { padding: 1.05rem 2rem; background: rgba(255,255,255,.018); }
.lt-ap-step span { width: 34px; height: 34px; box-shadow: 0 0 0 5px rgba(255,255,255,.018); }
.lt-ap-step.is-active span { box-shadow: 0 0 0 5px color-mix(in srgb, var(--ap-accent) 12%, transparent), 0 0 24px -8px var(--ap-accent); }
.lt-ap-line { background: linear-gradient(90deg, rgba(255,255,255,.08), color-mix(in srgb, var(--ap-accent) 35%, transparent), rgba(255,255,255,.08)); }

.lt-ap-body { padding: 1.75rem 2rem; scrollbar-color: rgba(255,255,255,.2) transparent; }
.lt-ap-body::-webkit-scrollbar { width: 8px; }
.lt-ap-body::-webkit-scrollbar-track { background: transparent; }
.lt-ap-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 999px; }
.lt-ap-dept-tag { border: 1px solid color-mix(in srgb, var(--ap-accent) 55%, white 5%); border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--ap-accent) 12%, transparent), rgba(255,255,255,.025)); text-transform:none; letter-spacing: 0; }
.lt-ap-field { margin-bottom: 1.25rem; }
.lt-ap-field label { font-size: .82rem; margin-bottom: .55rem; }
.lt-ap-field input, .lt-ap-field textarea, .lt-ap-field select { border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(3,7,16,.72); padding: .9rem 1rem; }
.lt-ap-field textarea { min-height: 118px; }
.lt-ap-field input:hover, .lt-ap-field textarea:hover, .lt-ap-field select:hover { border-color: rgba(255,255,255,.2); }
.lt-ap-field input:focus, .lt-ap-field textarea:focus, .lt-ap-field select:focus { border-color: var(--ap-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ap-accent) 12%, transparent); }
.lt-ap-row { gap: 1.1rem; }
.lt-ap-verified { display:flex; align-items:center; gap: .9rem; padding: 1rem; border:1px solid rgba(255,255,255,.1); border-radius:16px; background:rgba(255,255,255,.035); }
.lt-ap-verified img, .lt-ap-noav { width:48px; height:48px; border-radius:50%; object-fit:cover; }
.lt-ap-verified .lt-ap-check { margin-inline-start:auto; }
.lt-ap-foot { padding: 1.15rem 2rem; background: rgba(255,255,255,.018); }
.lt-ap-btn { min-width: 140px; border-radius: 12px; text-transform:none; letter-spacing:0; padding: .9rem 1.25rem; }
.lt-ap-go { background: linear-gradient(135deg, var(--ap-accent), color-mix(in srgb, var(--ap-accent) 72%, #fff 8%)); }
.lt-ap-ghost { background: rgba(255,255,255,.035); }
.lt-ap-success { padding: 3rem 1rem; text-align:center; }
.lt-ap-success-icon { width:82px; height:82px; margin:0 auto 1.25rem; display:grid; place-items:center; border-radius:50%; background:color-mix(in srgb, var(--ap-accent) 14%, transparent); border:1px solid color-mix(in srgb, var(--ap-accent) 65%, white 5%); color:var(--ap-accent); font-size:2.2rem; box-shadow:0 0 40px -15px var(--ap-accent); }

.lt-dept-card.is-snrbuns { border-color: rgba(245,158,11,.28); }
.lt-dept-card.is-snrbuns:hover { border-color: rgba(245,158,11,.75); box-shadow: 0 24px 70px rgba(245,158,11,.12); }

@media (max-width: 720px) {
  .lt-ap-overlay { padding: .5rem; }
  .lt-ap-card { width:100%; max-width:none; max-height: calc(100dvh - 1rem); border-radius:20px; }
  .lt-ap-head, .lt-ap-body, .lt-ap-foot { padding-left:1rem; padding-right:1rem; }
  .lt-ap-steps { padding-left:1rem; padding-right:1rem; }
  .lt-ap-body { padding-top:1.2rem; }
}

/* v3.11.1 close-button hardening */
.lt-ap-x {
  pointer-events: auto !important;
  z-index: 100 !important;
  touch-action: manipulation;
  cursor: pointer !important;
}

/* v3.13 close-button hardening */
.lt-ap-x {
  pointer-events: auto !important;
  position: absolute !important;
  z-index: 1000 !important;
  touch-action: manipulation;
  cursor: pointer !important;
}
