:root {
  --bg: #f7f5f2;
  --text: #1c1917;
  --muted: #78716c;
  --surface: #ffffff;
  --surface-alt: #f0eeeb;
  --border: rgba(28, 25, 23, 0.09);
  --primary: #ff7a00;
  --primary-hover: #e66d00;
  --primary-soft: rgba(255, 122, 0, 0.1);
  --success: #16803c;
  --danger: #c2413b;
  --shadow: 0 18px 60px rgba(67, 46, 27, 0.11);
  --radius: 18px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.page-glow {
  position: fixed;
  z-index: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
  opacity: .62;
  background: radial-gradient(circle, rgba(255, 122, 0, .13), rgba(255, 122, 0, 0) 69%);
  animation: drift 10s ease-in-out infinite alternate;
}

.page-glow-one {
  top: -240px;
  right: -130px;
}

.page-glow-two {
  bottom: -310px;
  left: -180px;
  animation-delay: -4s;
}

@keyframes drift {
  from { transform: translate3d(0, -8px, 0) scale(.96); }
  to { transform: translate3d(-18px, 22px, 0) scale(1.06); }
}

.navbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand img {
  border-radius: 9px;
  box-shadow: 0 5px 18px rgba(255, 122, 0, .22);
}

.brand-sub {
  margin-left: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .03em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-link {
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: .2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 48px));
  min-height: calc(100vh - 128px);
  margin: 0 auto;
}

.auth-page .page-shell {
  min-height: calc(100vh - 62px);
}

.auth-layout {
  min-height: calc(100vh - 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0 64px;
}

.auth-story {
  padding: 24px 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, .11);
}

.auth-story h1 {
  max-width: 650px;
  margin: 22px 0 18px;
  font-size: clamp(44px, 5.4vw, 76px);
  line-height: 1.03;
  letter-spacing: -.055em;
}

.auth-story h1 span,
.account-heading h1 span,
.complete-page h1 span {
  color: var(--primary);
}

.auth-story > p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.player-ticket {
  position: relative;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 34px;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: 0 12px 35px rgba(65, 43, 22, .07);
}

.player-ticket::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: var(--primary);
}

.player-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #ff9b3d, #ff6900);
  font-weight: 900;
  box-shadow: 0 7px 20px rgba(255, 122, 0, .22);
}

.player-ticket > div:nth-child(2) {
  display: grid;
}

.player-ticket small,
.complete-server small {
  color: var(--muted);
  font-size: 11px;
}

.player-ticket strong {
  font-size: 17px;
}

.player-ticket span {
  color: var(--muted);
  font-size: 12px;
}

.ticket-state {
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 800;
}

.standalone-note {
  max-width: 560px;
  display: grid;
  gap: 3px;
  margin-top: 34px;
  padding: 17px 20px;
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  background: var(--primary-soft);
}

.standalone-note span {
  color: var(--muted);
  font-size: 13px;
}

.trust-list {
  display: grid;
  gap: 11px;
  margin: 27px 0 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
  font-size: 13px;
}

.trust-list li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trust-list span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.auth-panel {
  width: min(100%, 520px);
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-heading {
  margin-bottom: 25px;
}

.auth-heading-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.auth-mode-switch {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 58px);
  gap: 2px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-alt);
}

.auth-mode-switch a {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: color .25s ease;
}

.auth-mode-switch a.active {
  color: #fff;
}

.auth-mode-indicator {
  position: absolute;
  z-index: 0;
  top: 3px;
  left: 3px;
  width: 58px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  box-shadow: 0 5px 16px rgba(255, 122, 0, .26);
  transform: translateX(0);
  transition: transform .24s cubic-bezier(.22, .8, .32, 1);
  will-change: transform;
}

.auth-mode-switch.mode-register .auth-mode-indicator {
  transform: translateX(60px);
}

.auth-mode-switch.mode-reset .auth-mode-indicator {
  display: none;
}

.auth-heading h2 {
  margin: 0 0 4px;
  font-size: 30px;
  letter-spacing: -.035em;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-forms {
  position: relative;
  overflow: hidden;
  transition: height .24s cubic-bezier(.22, .8, .32, 1);
}

.auth-pane {
  width: 100%;
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity .16s ease,
    transform .24s cubic-bezier(.22, .8, .32, 1);
  will-change: opacity, transform;
}

.auth-pane.is-leaving {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-10px);
}

.auth-pane.is-entering {
  opacity: 0;
  transform: translateX(10px);
}

.field {
  display: grid;
  gap: 7px;
}

.field > span:first-child {
  font-size: 13px;
  font-weight: 700;
}

.field > small {
  color: var(--muted);
  font-size: 11px;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  outline: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-alt);
  font-size: 14px;
  transition: border .2s ease, box-shadow .2s ease, background .2s ease;
}

.field input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.field input::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

.password-wrap,
.inline-field,
.captcha-field {
  position: relative;
  display: flex;
  gap: 9px;
}

.password-wrap input {
  padding-right: 59px;
}

.inline-field input,
.captcha-field input {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
}

.text-button {
  position: absolute;
  right: 8px;
  top: 8px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.inline-field .secondary-button {
  flex: 0 0 112px;
}

.secondary-button,
.quiet-button {
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: .2s ease;
}

.secondary-button:hover,
.quiet-button:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

.secondary-button:disabled {
  cursor: wait;
  opacity: .6;
}

.captcha-field input {
  min-width: 0;
}

.captcha-button {
  flex: 0 0 150px;
  height: 48px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f0eeeb;
  cursor: pointer;
}

.captcha-button img {
  display: block;
  width: 150px;
  height: 48px;
}

.primary-button {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(255, 122, 0, .22);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.primary-button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 122, 0, .27);
}

.primary-button span {
  transition: transform .2s ease;
}

.primary-button:hover span {
  transform: translateX(3px);
}

.auth-links {
  min-height: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.auth-links a,
.secondary-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.auth-links a:hover,
.secondary-link:hover {
  text-decoration: underline;
}

.alert {
  margin-bottom: 17px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  animation: alert-in .25s ease both;
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-5px); }
}

.alert-error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 22%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.alert-success {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 22%, transparent);
  background: color-mix(in srgb, var(--success) 8%, transparent);
}

.alert-info {
  color: var(--primary);
  background: var(--primary-soft);
}

.hidden {
  display: none;
}

.state-page {
  max-width: 650px;
  min-height: calc(100vh - 128px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 70px 0;
  text-align: center;
}

.state-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 22px;
  font-size: 34px;
  font-weight: 900;
}

.state-success {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--success) 5%, transparent);
}

.state-error {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.state-page h1 {
  margin: 10px 0 12px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -.045em;
}

.state-page > p {
  max-width: 560px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
}

.state-action {
  min-width: 178px;
}

.complete-server {
  min-width: 330px;
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 4px 0 24px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.complete-server img {
  border-radius: 12px;
}

.complete-server div {
  display: grid;
  text-align: left;
}

.complete-server > span {
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 99px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  font-size: 11px;
  font-weight: 800;
}

.account-page {
  padding: 70px 0 90px;
}

.account-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.account-heading h1 {
  margin: 8px 0 2px;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -.05em;
}

.account-heading p {
  margin: 0;
  color: var(--muted);
}

.quiet-button {
  min-width: 94px;
  height: 42px;
  padding: 0 14px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  align-items: start;
}

.account-section {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--border);
}

.section-heading > div {
  display: grid;
  gap: 3px;
}

.section-heading span {
  color: var(--muted);
  font-size: 11px;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.025em;
}

.section-badge {
  padding: 5px 9px;
  border-radius: 99px;
  color: var(--primary) !important;
  background: var(--primary-soft);
  font-weight: 700;
}

.player-list {
  padding: 0 26px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.player-row:last-child {
  border: 0;
}

.player-data {
  min-width: 0;
  display: grid;
  flex: 1;
}

.player-data span {
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
}

.reputation {
  display: grid;
  text-align: right;
}

.reputation small {
  color: var(--muted);
  font-size: 10px;
}

.reputation strong {
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
}

.empty-state {
  padding: 42px 26px;
  text-align: center;
}

.empty-state p {
  max-width: 440px;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 13px;
}

.security-card {
  position: sticky;
  top: 88px;
  padding: 25px;
  border-radius: var(--radius);
  color: #fff;
  background: #1c1917;
  box-shadow: var(--shadow);
}

[data-theme="dark"] .security-card {
  color: #1c1917;
  background: #f5f5f4;
}

.security-index {
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.security-card h2 {
  margin: 22px 0 8px;
  font-size: 25px;
}

.security-card p {
  margin: 0 0 23px;
  color: #a8a29e;
  font-size: 13px;
}

[data-theme="dark"] .security-card p {
  color: #57534e;
}

.security-card a {
  display: flex;
  justify-content: space-between;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.footer {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 48px));
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--primary);
}

@media (max-width: 900px) {
  .auth-layout {
    padding-top: 36px;
  }

  .auth-story {
    padding: 0;
    text-align: center;
  }

  .auth-story > p,
  .player-ticket,
  .standalone-note {
    margin-right: auto;
    margin-left: auto;
  }

  .trust-list {
    display: none;
  }

  .auth-story h1 {
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(42px, 10vw, 66px);
  }

  .auth-story .eyebrow {
    justify-content: center;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .security-card {
    position: static;
  }
}

@media (max-width: 600px) {
  .navbar {
    height: 60px;
    padding: 0 16px;
  }

  .brand-sub,
  .nav-link {
    display: none;
  }

  .page-shell,
  .footer {
    width: min(100% - 28px, 1160px);
  }

  .auth-layout {
    min-height: auto;
    padding: 32px 0 50px;
  }

  .auth-story h1 {
    margin-top: 15px;
    margin-bottom: 9px;
    font-size: 36px;
  }

  .auth-story > p {
    display: none;
  }

  .player-ticket {
    margin-top: 18px;
    text-align: left;
  }

  .ticket-state {
    display: none;
  }

  .auth-panel {
    margin: 0 -2px;
    padding: 25px 20px;
    border-radius: 17px;
  }

  .auth-heading-top {
    gap: 12px;
  }

  .auth-mode-switch {
    grid-template-columns: repeat(2, 52px);
  }

  .auth-mode-indicator {
    width: 52px;
  }

  .auth-mode-switch.mode-register .auth-mode-indicator {
    transform: translateX(54px);
  }

  .inline-field,
  .captcha-field {
    gap: 7px;
  }

  .inline-field .secondary-button {
    flex-basis: 104px;
  }

  .captcha-button,
  .captcha-button img {
    width: 126px;
    flex-basis: 126px;
  }

  .auth-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .complete-server {
    min-width: 0;
    width: 100%;
  }

  .account-heading {
    align-items: flex-start;
  }

  .account-heading h1 {
    font-size: 36px;
  }

  .section-heading,
  .player-list {
    padding-right: 18px;
    padding-left: 18px;
  }

  .footer {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
}

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