:root {
  --yellow: #ffd91a;
  --yellow-hover: #f1c900;
  --yellow-ink: #17150a;
  --cyan: #58bdff;
  --green: #2dd879;
  --red: #fb7185;
  --text: #f8fafc;
  --text-soft: #d7e1ec;
  --muted: #8e9daf;
  --line: rgba(188, 218, 243, .25);
  --line-soft: rgba(188, 218, 243, .13);
  --input: rgba(3, 8, 15, .74);
  --scene-width: min(calc(100vw - 36px), 1084px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  color-scheme: dark;
}

body {
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: #070a10;
  background-image: url("ui-bg-night-v1.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(3, 7, 13, .5);
  content: "";
  pointer-events: none;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

.site-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.topbar {
  position: relative;
  z-index: 20;
  height: 64px;
  flex: 0 0 64px;
  background: rgba(7, 15, 27, .5);
  border-bottom: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 0 26px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 20px;
  font-weight: 750;
  text-decoration: none;
}

.brand > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--yellow);
}

.auth-entry-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.auth-entry-label::before {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(45, 216, 121, .1);
  content: "";
}

.window-lights {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 2px;
}

.window-lights i {
  display: block;
  width: 10px;
  height: 10px;
  background: #ff626b;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 98, 107, .3);
}

.window-lights i:nth-child(2) {
  background: #ffc94a;
}

.window-lights i:nth-child(3) {
  background: #31d77b;
}

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #cbd8e6;
  cursor: pointer;
  text-decoration: none;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(88, 189, 255, .1);
  border-color: rgba(88, 189, 255, .26);
  color: #fff;
  outline: none;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.action-divider {
  width: 1px;
  height: 22px;
  background: var(--line-soft);
}

.account-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 210px;
  padding: 12px 14px;
  background: rgba(7, 13, 22, .96);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .38);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.account-popover strong,
.account-popover span {
  display: block;
}

.account-popover strong {
  font-size: 13px;
}

.account-popover span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.auth-scene {
  position: relative;
  width: var(--scene-width);
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  grid-template-rows: auto 1fr;
  margin: auto;
  overflow: visible;
  background: rgba(12, 25, 41, .48);
  border: 1px solid rgba(203, 229, 250, .48);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(22px) saturate(118%);
  backdrop-filter: blur(22px) saturate(118%);
}

.scene-ghost,
.scene-spark,
.scene-sticker {
  position: absolute;
  z-index: 4;
  display: block;
  pointer-events: none;
}

.scene-ghost {
  top: 32px;
  left: 18px;
  width: 72px;
  height: 72px;
  color: rgba(213, 229, 244, .24);
  transform: rotate(-9deg);
}

.scene-spark {
  width: 7px;
  height: 25px;
  background: var(--yellow);
  box-shadow: 0 0 14px rgba(255, 217, 26, .2);
  transform: rotate(32deg);
}

.scene-spark.one {
  top: 58px;
  left: 57%;
}

.scene-spark.two {
  top: 82px;
  left: calc(57% + 18px);
  height: 15px;
  transform: rotate(68deg);
}

.scene-sticker {
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}

.scene-sticker.yellow {
  top: -26px;
  left: 55%;
  width: 126px;
  background: rgba(255, 225, 76, .9);
  transform: rotate(-7deg);
}

.scene-sticker.blue {
  top: -38px;
  right: -48px;
  width: 106px;
  background: rgba(77, 190, 255, .9);
  transform: rotate(5deg);
}

.intro {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  padding: 42px 44px 8px 104px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #ffe76a;
  font-size: 11px;
  font-weight: 750;
}

.eyebrow span {
  width: 20px;
  height: 2px;
  background: var(--yellow);
}

.intro h1 {
  color: var(--text);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  text-shadow: 0 4px 20px rgba(0, 0, 0, .42);
}

.intro h1 b {
  color: var(--yellow);
  font-weight: inherit;
}

.title-emphasis {
  position: relative;
  z-index: 1;
  display: inline-block;
}

.title-emphasis::after {
  position: absolute;
  right: -3px;
  bottom: 2px;
  left: -3px;
  z-index: -1;
  height: 6px;
  background: var(--yellow);
  content: "";
  transform: rotate(-1deg);
}

.intro p {
  margin-top: 8px;
  color: #b9c6d4;
  font-size: 14px;
}

.media-panel {
  grid-column: 1;
  grid-row: 2;
  position: relative;
  min-width: 0;
  height: 400px;
  min-height: 400px;
  margin: 0 44px 34px;
  overflow: hidden;
}

.preview-banner {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  width: 80%;
  height: auto;
  aspect-ratio: 1125 / 552;
  overflow: hidden;
  background: #101827;
  border: 1px solid rgba(205, 226, 244, .42);
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .3);
}

.preview-banner img,
.preview-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-banner > span {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  background: rgba(4, 8, 15, .76);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 5px;
  color: #fff;
  font-size: 9px;
  font-weight: 650;
}

.preview-avatar {
  position: absolute;
  top: 18%;
  left: 0;
  z-index: 4;
  width: 31%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #101827;
  border: 3px solid #61c3ff;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(5, 10, 18, .7), 0 16px 36px rgba(0, 0, 0, .4);
}

.avatar-mascot {
  position: absolute;
  z-index: 6;
  display: none;
  height: auto;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .3));
  pointer-events: none;
}

.frame-rail {
  position: absolute;
  top: auto;
  right: 0;
  bottom: 78px;
  left: 20%;
  display: grid;
  height: auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.frame {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #111827;
  border: 1px solid rgba(188, 215, 240, .42);
  border-radius: 5px;
  cursor: pointer;
  aspect-ratio: 1.34;
}

.frame:hover,
.frame:focus-visible {
  border-color: #8dd4ff;
  outline: none;
}

.frame.active {
  border-color: var(--yellow);
  box-shadow: inset 0 0 0 1px var(--yellow), 0 0 16px rgba(255, 217, 26, .14);
}

.frame img {
  position: absolute;
  top: 50%;
  left: 0;
  display: block;
  width: 500%;
  max-width: none;
  height: auto;
  transform: translateY(-50%);
}

.frame:nth-child(2) img {
  left: -100%;
}

.frame:nth-child(3) img {
  left: -200%;
}

.frame:nth-child(4) img {
  left: -300%;
}

.frame:nth-child(5) img {
  left: -400%;
}

.play-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  transform: translate(-50%, -50%);
  background: rgba(4, 8, 15, .8);
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 50%;
  color: #fff;
}

.play-mark svg {
  width: 10px;
  height: 10px;
}

.media-legend {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.media-legend > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.media-legend > div + div {
  margin-left: 18px;
  padding-left: 18px;
  border-left: 1px solid var(--line-soft);
}

.legend-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  background: rgba(34, 134, 196, .16);
  border: 1px solid rgba(88, 189, 255, .4);
  border-radius: 6px;
  color: #76cbff;
}

.legend-icon.background-icon {
  background: rgba(255, 217, 26, .08);
  border-color: rgba(255, 217, 26, .34);
  color: var(--yellow);
}

.legend-icon svg {
  width: 15px;
  height: 15px;
}

.media-legend strong,
.media-legend small {
  display: block;
}

.media-legend strong {
  font-size: 11px;
}

.media-legend small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
}

.auth-panel {
  grid-column: 2;
  grid-row: 1 / 3;
  position: relative;
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: rgba(22, 40, 59, .5);
  border-left: 1px solid rgba(203, 229, 250, .34);
  border-radius: 0 8px 8px 0;
}

.panel-mascot {
  position: absolute;
  top: -82px;
  left: 50%;
  z-index: 5;
  display: block;
  width: 180px;
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .28));
  pointer-events: none;
}

.panel-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 48px 36px 34px;
}

.verify-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin: 0 auto 14px;
  background: rgba(25, 210, 126, .14);
  border: 1px solid rgba(55, 235, 150, .48);
  border-radius: 8px;
  color: #32e58b;
  box-shadow: 0 12px 28px rgba(27, 211, 128, .1);
}

.verify-mark svg {
  width: 33px;
  height: 33px;
}

.verify-state {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--text-soft);
  font-size: 18px;
  font-weight: 550;
  text-align: center;
}

.verify-state span {
  display: none;
}

.auth-panel h2 {
  font-size: 32px;
  font-weight: 780;
  line-height: 1.3;
  text-align: center;
}

.panel-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

#authForm {
  margin-top: 28px;
}

#authForm label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

#authForm label svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

#codeInput {
  width: 100%;
  min-height: 58px;
  padding: 0 12px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

#codeInput::placeholder {
  color: #657488;
}

#codeInput:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 217, 26, .12);
}

#codeInput.invalid,
#codeInput[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, .1);
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 12px;
  background: rgba(127, 29, 29, .2);
  border: 1px solid rgba(251, 113, 133, .45);
  border-radius: 6px;
  color: #fecdd3;
  font-size: 12px;
  line-height: 1.5;
}

.auth-error svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
  color: var(--red);
}

.auth-error + #authForm {
  margin-top: 16px;
}

.code-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.form-message {
  min-height: 18px;
  margin-top: 3px;
  color: var(--red);
  font-size: 11px;
}

.form-message.ok {
  color: #72f1aa;
}

.primary-button {
  display: inline-flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 4px;
  background: var(--yellow);
  border: 1px solid var(--yellow);
  border-radius: 6px;
  color: var(--yellow-ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  box-shadow: 0 13px 30px rgba(255, 217, 26, .14);
  transition: background .15s, border-color .15s, transform .15s;
}

.primary-button:hover {
  background: var(--yellow-hover);
  border-color: var(--yellow-hover);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:focus-visible {
  outline: 3px solid rgba(88, 189, 255, .4);
  outline-offset: 2px;
}

.primary-button svg {
  width: 14px;
  height: 14px;
}

.panel-footer {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background: rgba(3, 7, 13, .2);
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.panel-footer svg {
  display: none;
}

.panel-footer::before,
.panel-footer::after {
  content: none;
}

.footer {
  position: relative;
  z-index: 12;
  min-height: 48px;
  display: flex;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  padding: 7px 18px;
  background: rgba(3, 8, 15, .56);
  border-top: 1px solid rgba(181, 211, 238, .11);
  color: #7f8ea0;
  font-size: 11px;
  text-align: center;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.footer-inner {
  width: min(calc(100vw - 36px), 1084px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
}

.copyright {
  white-space: nowrap;
}

.footer-divider {
  width: 1px;
  height: 14px;
  background: rgba(181, 211, 238, .2);
}

.support-wrap {
  position: relative;
}

.support-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 9px;
  background: rgba(255, 217, 26, .06);
  border: 1px solid rgba(255, 217, 26, .18);
  border-radius: 6px;
  color: #d8dee6;
  cursor: pointer;
  text-decoration: none;
}

.support-button:hover {
  background: rgba(255, 217, 26, .12);
  border-color: rgba(255, 217, 26, .34);
  color: #fff6b0;
}

.support-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--yellow);
}

.support-button .external-icon {
  width: 12px;
  height: 12px;
  flex-basis: 12px;
  color: currentColor;
  opacity: .66;
}

@media (max-width: 860px) {
  :root {
    --scene-width: min(calc(100vw - 28px), 700px);
  }

  body {
    background-attachment: scroll;
  }

  .auth-scene {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 18px;
    margin: 26px auto;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .intro {
    grid-column: 1;
    grid-row: 1;
    padding: 0 6px;
  }

  .intro h1 {
    font-size: 34px;
  }

  .intro p {
    font-size: 13px;
  }

  .media-panel {
    grid-column: 1;
    grid-row: 2;
    height: 420px;
    background: rgba(10, 20, 33, .68);
    border: 1px solid rgba(193, 220, 243, .4);
    border-radius: 8px;
    box-shadow: 0 22px 58px rgba(0, 0, 0, .32);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  .preview-banner {
    top: 20px;
    right: 20px;
    left: 22%;
    height: 51%;
  }

  .preview-avatar {
    top: 56px;
    left: 22px;
    width: 27%;
  }

  .frame-rail {
    top: calc(51% + 32px);
    right: 20px;
    left: 22%;
    height: 82px;
  }

  .media-legend {
    right: 22px;
    bottom: 18px;
    left: 22px;
  }

  .auth-panel {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    margin-top: 54px;
    background: rgba(9, 18, 31, .76);
    border: 1px solid rgba(193, 220, 243, .4);
    border-radius: 8px;
    box-shadow: 0 22px 58px rgba(0, 0, 0, .32);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }

  .panel-mascot {
    position: absolute;
    top: -88px;
    left: 50%;
    z-index: 5;
    display: block;
    width: 200px;
    height: auto;
    transform: translateX(-50%);
    filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .28));
    pointer-events: none;
  }

  .panel-main {
    padding: 48px 38px 34px;
  }

  .verify-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin: 0 auto 14px;
    background: rgba(45, 216, 121, .1);
    border: 1px solid rgba(45, 216, 121, .42);
    border-radius: 8px;
    color: #40ec8e;
  }

  .verify-mark svg {
    width: 27px;
    height: 27px;
  }

  .verify-state {
    margin-right: auto;
    margin-left: auto;
  }

  .auth-panel h2,
  .panel-copy {
    text-align: center;
  }

  .auth-panel h2 {
    font-size: 30px;
  }

  .panel-copy {
    font-size: 13px;
  }

  #authForm {
    margin-top: 28px;
  }

  #authForm label {
    font-size: 13px;
  }

  #codeInput,
  .primary-button {
    min-height: 58px;
    font-size: 14px;
  }

  .code-meta,
  .form-message,
  .panel-footer {
    font-size: 11px;
  }
}

@media (max-width: 600px) {
  :root {
    --scene-width: calc(100vw - 24px);
  }

  .topbar {
    height: 56px;
    flex-basis: 56px;
  }

  .window-lights,
  .action-divider {
    display: none;
  }

  .brand {
    font-size: 15px;
  }

  .top-actions {
    gap: 3px;
  }

  .auth-scene {
    gap: 16px;
    margin: 22px auto 26px;
  }

  .intro {
    padding: 0 4px;
  }

  .eyebrow {
    font-size: 10px;
  }

  .intro h1 {
    font-size: 26px;
  }

  .intro p {
    margin-top: 5px;
    font-size: 12px;
  }

  .media-panel {
    height: 310px;
  }

  .preview-banner {
    top: 16px;
    right: 13px;
    left: 20%;
    height: 43%;
  }

  .preview-avatar {
    top: 36px;
    left: 13px;
    width: 28%;
    border-width: 3px;
  }

  .frame-rail {
    top: calc(43% + 29px);
    right: 13px;
    left: 20%;
    height: 66px;
    gap: 4px;
  }

  .media-legend {
    right: 14px;
    bottom: 12px;
    left: 14px;
    padding-top: 10px;
  }

  .media-legend > div {
    gap: 7px;
  }

  .media-legend > div + div {
    margin-left: 9px;
    padding-left: 9px;
  }

  .legend-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .media-legend strong {
    font-size: 10px;
  }

  .media-legend small {
    font-size: 8px;
  }

  .auth-panel {
    margin-top: 42px;
  }

  .panel-mascot {
    top: -75px;
    width: 168px;
  }

  .panel-main {
    padding: 42px 20px 28px;
  }

  .auth-panel h2 {
    font-size: 25px;
  }

  #codeInput,
  .primary-button {
    min-height: 54px;
  }

  .panel-footer {
    min-height: 54px;
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (max-width: 370px) {
  .top-actions .icon-button:first-child {
    display: none;
  }

  .intro h1 {
    font-size: 24px;
  }

  .media-legend small {
    display: none;
  }
}

/* Match the original site's responsive container and stacking behavior. */
@media (max-width: 860px) {
  :root {
    --scene-width: min(calc(100vw - 36px), 640px);
  }

  .auth-scene {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 0;
    margin: auto;
    overflow: hidden;
    background: rgba(7, 14, 24, .78);
    border: 1px solid rgba(193, 220, 243, .32);
    border-radius: 8px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
    -webkit-backdrop-filter: blur(22px) saturate(118%);
    backdrop-filter: blur(22px) saturate(118%);
  }

  .intro {
    grid-column: 1;
    grid-row: 1;
    padding: 34px 34px 8px;
  }

  .scene-ghost {
    display: none;
  }

  .intro h1 {
    font-size: 30px;
  }

  .intro p {
    font-size: 13px;
  }

  .media-panel {
    grid-column: 1;
    grid-row: 2;
    height: 400px;
    min-height: 400px;
    margin: 0 34px 34px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .preview-banner {
    top: 0;
    right: 0;
    left: auto;
    width: 80%;
    height: auto;
  }

  .preview-avatar {
    top: 18%;
    left: 0;
    width: 31%;
  }

  .frame-rail {
    top: auto;
    right: 0;
    bottom: 78px;
    left: 20%;
    height: auto;
  }

  .media-legend {
    right: 0;
    bottom: 0;
    left: 0;
  }

  .auth-panel {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    margin: 0;
    background: rgba(9, 15, 25, .72);
    border: 0;
    border-top: 1px solid var(--line-soft);
    border-radius: 0 0 8px 8px;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .verify-mark {
    display: grid;
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
  }

  .panel-mascot {
    display: none;
  }

  .avatar-mascot {
    top: 10px;
    left: 15.5%;
    display: block;
    width: min(100px, 31%);
    transform: translateX(-50%);
  }

  .panel-main {
    padding: 38px 34px 32px;
  }

  .verify-state {
    margin-right: 0;
    margin-left: 0;
  }

  .auth-panel h2,
  .panel-copy {
    text-align: center;
  }

  .auth-panel h2 {
    font-size: 24px;
  }

  .panel-copy {
    font-size: 13px;
  }

  #codeInput,
  .primary-button {
    min-height: 50px;
    font-size: 14px;
  }

  .code-meta,
  .form-message,
  .panel-footer {
    font-size: 11px;
  }

  .panel-footer {
    padding-right: 34px;
    padding-left: 34px;
  }
}

@media (max-width: 520px) {
  :root {
    --scene-width: calc(100vw - 24px);
  }

  .auth-scene {
    margin: 12px auto 24px;
    border-radius: 7px;
  }

  .window-lights {
    display: inline-flex;
  }

  .action-divider {
    display: block;
  }

  .topbar-inner {
    padding-right: 12px;
    padding-left: 12px;
  }

  .scene-ghost,
  .scene-spark,
  .scene-sticker {
    display: none;
  }

  .intro {
    padding: 24px 20px 8px;
  }

  .auth-entry-label {
    display: none;
  }

  .intro h1 {
    font-size: 23px;
  }

  .intro p {
    font-size: 12px;
    line-height: 1.65;
  }

  .media-panel {
    height: 270px;
    min-height: 270px;
    margin: 0 20px 22px;
  }

  .frame-rail {
    bottom: 68px;
  }

  .media-legend {
    padding-top: 10px;
  }

  .media-legend > div + div {
    margin-left: 10px;
    padding-left: 10px;
  }

  .legend-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .panel-main {
    padding: 29px 20px 25px;
  }

  .verify-mark {
    width: 46px;
    height: 46px;
  }

  .verify-mark svg {
    width: 27px;
    height: 27px;
  }

  .panel-mascot {
    display: none;
  }

  .avatar-mascot {
    top: 0;
    left: 15.5%;
    display: block;
    width: min(100px, 31%);
    transform: translateX(-50%);
  }

  .auth-panel h2 {
    font-size: 21px;
  }

  #authForm {
    margin-top: 23px;
  }

  .panel-footer {
    padding: 14px 20px;
  }

  .footer {
    min-height: 46px;
    flex-basis: 46px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .footer-inner {
    width: 100%;
    gap: 9px;
  }

  .support-button {
    padding-right: 7px;
    padding-left: 7px;
  }
}

@media (max-width: 340px) {
  .intro {
    padding-right: 16px;
    padding-left: 16px;
  }

  .intro h1 {
    font-size: 20px;
  }
}

/* Mobile fallback: preserves the visual hierarchy without continuous backdrop compositing. */
@media (max-width: 860px) {
  body { background-attachment: scroll; }
  .topbar,
  .footer,
  .auth-scene {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .topbar { background: rgba(4, 10, 18, .94); }
  .auth-scene { background: rgba(7, 14, 24, .94); }
  .footer { background: rgba(3, 8, 15, .92); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
