:root {
  --plum: #1f0523;
  --plum-deep: #140318;
  --plum-soft: #3a1a3f;
  --ink: #1a1220;
  --muted: #6b6174;
  --line: #e8e0ec;
  --soft: #f4f0f6;
  --surface: #ffffff;
  --page: #f7f3f0;
  --blue: #246bfe;
  --blue-status: #5688f2;
  --blue-dark: #1a56e0;
  --blue-soft: #eaf1ff;
  --orange: #ff7a1a;
  --orange-soft: #fff1e4;
  --green: #129b62;
  --red: #d92d20;
  --shadow: 0 18px 50px rgba(31, 5, 35, 0.1);
  --shadow-soft: 0 8px 24px rgba(31, 5, 35, 0.06);
  --radius: 18px;
  --font: "Lato", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Manrope", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* —— Platform chrome —— */
.app-header {
  z-index: 20;
  background: var(--plum);
}

.header-inner {
  position: relative;
  width: min(1127px, calc(100% - 32px));
  min-height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand img {
  width: 200px;
  height: 37px;
  display: block;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-nav a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.header-nav a:hover,
.header-nav a.is-active {
  color: #fff;
}

.mobile-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.62);
}

.app-footer {
  margin-top: auto;
  background: var(--plum);
  color: #725077;
}

.footer-inner {
  width: min(1127px, calc(100% - 32px));
  margin: 0 auto;
  padding: 35px 0;
  display: grid;
  grid-template-columns: 3fr 3fr 10fr;
  gap: 0;
}

.footer-inner section {
  min-width: 0;
  padding: 14px 16px;
}

.footer-inner section:first-child {
  padding-left: 0;
}

.footer-inner section + section {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.app-footer h2 {
  margin: 0 0 14px;
  color: #ccc;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2857;
}

.app-footer a,
.app-footer p {
  display: block;
  margin: 0;
  font-size: 14px;
  line-height: 1.4285;
}

.app-footer p {
  color: #725077;
}

.app-footer a,
.app-footer a:visited {
  color: rgba(255, 255, 255, 0.5);
}

.app-footer a {
  padding: 3px 0;
  line-height: 1.1428;
}

.app-footer a:hover,
.app-footer a:active {
  color: #fff;
}

/* —— Page —— */
.page {
  position: relative;
  width: min(1080px, calc(100% - 32px));
  flex: 1;
  margin: 0 auto;
  padding: 36px 0 56px;
}

.page-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  width: 100vw;
  height: 280px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse 60% 80% at 18% 30%, rgba(255, 122, 26, 0.14), transparent 60%),
    radial-gradient(ellipse 50% 70% at 78% 20%, rgba(36, 107, 254, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(31, 5, 35, 0.06), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page-intro,
.channel-rail,
.checkout {
  position: relative;
  z-index: 1;
}

.page-intro {
  margin-bottom: 22px;
  animation: rise-in 0.55s ease both;
}

.page-kicker {
  margin: 0 0 6px;
  color: var(--orange);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.channel-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  animation: rise-in 0.55s ease 0.06s both;
}

.channel-rail a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.channel-rail a:hover {
  color: var(--ink);
  background: #fff;
}

.channel-rail a.is-active {
  background: var(--plum);
  color: #fff;
  border-color: var(--plum);
  box-shadow: 0 8px 20px rgba(31, 5, 35, 0.22);
}

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 20px;
  align-items: start;
  animation: rise-in 0.6s ease 0.12s both;
}

/* —— Form sheet —— */
.sheet {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: calc(var(--radius) + 4px);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.block {
  padding: 22px 22px 20px;
  border-radius: var(--radius);
  background: var(--surface);
}

.block + .block {
  margin-top: 0;
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.block-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.block-hint,
.text-link {
  color: var(--muted);
  font-size: 13px;
}

.block-hint.is-ok {
  color: var(--blue-status);
}

.text-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--blue);
}

.text-link:hover {
  text-decoration: underline;
}

.account-field {
  position: relative;
}

.account-field input {
  width: 100%;
  height: 52px;
  padding: 0 44px 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.account-field input:focus {
  border-color: rgba(36, 107, 254, 0.55);
  box-shadow: 0 0 0 4px rgba(36, 107, 254, 0.12);
}

.account-check {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: var(--blue-status) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2l2.8 2.8 6.2-6.2' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.account-check.is-visible {
  opacity: 1;
  transform: scale(1);
}

.quick-accounts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.quick-accounts__label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.quick-accounts button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  transition: all 0.18s ease;
}

.quick-accounts button:hover,
.quick-accounts button.is-active {
  border-color: rgba(36, 107, 254, 0.35);
  background: var(--blue-soft);
  color: var(--blue);
}

.target-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.target-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.target-option img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--soft);
}

.target-option strong,
.target-option small {
  display: block;
}

.target-option strong {
  font-size: 15px;
  font-weight: 700;
}

.target-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.target-option:hover {
  border-color: #cfc3d6;
  transform: translateY(-1px);
}

.target-option.is-selected {
  border-color: var(--blue);
  background: linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
  box-shadow: 0 10px 24px rgba(36, 107, 254, 0.12);
}

.server-box {
  margin-top: 14px;
}

.server-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.server-trigger em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.server-trigger strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.server-trigger small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.server-trigger[aria-expanded="true"],
.server-trigger:hover {
  border-color: rgba(36, 107, 254, 0.45);
  box-shadow: 0 0 0 4px rgba(36, 107, 254, 0.08);
}

.server-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.server-shortcuts button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--orange-soft);
  color: #b85a10;
  font-size: 12px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.server-shortcuts button:hover,
.server-shortcuts button.is-active {
  background: #ffe0bf;
  transform: translateY(-1px);
}

.server-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  animation: panel-in 0.22s ease;
}

.search-field {
  display: block;
  margin-bottom: 10px;
}

.search-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.search-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fff;
}

.search-field input:focus {
  border-color: rgba(36, 107, 254, 0.5);
}

.server-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.server-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.server-option small {
  color: var(--muted);
  font-size: 11px;
}

.server-option:hover,
.server-option.is-selected {
  border-color: rgba(36, 107, 254, 0.35);
  background: var(--blue-soft);
}

.server-empty {
  margin: 12px 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.amount-button {
  position: relative;
  min-height: 52px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.amount-button:hover {
  transform: translateY(-1px);
  border-color: #d2c6da;
}

.amount-button.is-selected {
  border-color: transparent;
  background: linear-gradient(135deg, #ff8a2b 0%, #ff6a00 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 122, 26, 0.28);
}

.amount-button--custom {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
}

.amount-button--custom .custom-amount-editor {
  display: none;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 0 12px;
}

.amount-button--custom .custom-amount-editor em {
  font-style: normal;
  font-family: var(--display);
  font-weight: 700;
}

.amount-button--custom input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
}

.amount-button--custom.is-selected .custom-amount-display {
  display: none;
}

.amount-button--custom.is-selected .custom-amount-editor {
  display: flex;
}

.amount-button--custom.is-selected input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.amount-button--custom.is-selected.is-invalid {
  border-color: rgba(217, 45, 32, 0.55);
  background: #fff5f4;
  color: var(--red);
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.08);
}

.amount-button--custom.is-selected.is-invalid input::placeholder {
  color: rgba(217, 45, 32, 0.65);
}

.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pay-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.pay-button__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.pay-button img {
  display: block;
  width: 116px;
  height: 36px;
  object-fit: contain;
}

.pay-button:hover {
  transform: translateY(-1px);
}

.pay-button.is-selected {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 8px 20px rgba(36, 107, 254, 0.12);
}

/* —— Ticket summary —— */
.ticket {
  position: sticky;
  top: 24px;
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.ticket-top {
  padding: 22px 22px 18px;
  background:
    linear-gradient(135deg, rgba(255, 122, 26, 0.16), transparent 55%),
    linear-gradient(180deg, #2a0a2f 0%, #1f0523 100%);
  color: #fff;
}

.ticket-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.ticket-top h2 {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 700;
}

.ticket-state {
  display: inline-flex;
  margin: 12px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.ticket-state.is-ready {
  background: rgba(18, 155, 98, 0.22);
  color: #9dffc8;
}

.ticket-amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 8px;
}

.ticket-amount span {
  color: var(--muted);
  font-size: 13px;
}

.ticket-amount strong {
  color: var(--orange);
  font-family: var(--display);
  font-size: clamp(36px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  transition: transform 0.25s ease;
}

.ticket-amount strong.is-pulse {
  transform: scale(1.04);
}

.ticket-list {
  margin: 0;
  padding: 8px 22px 4px;
}

.ticket-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.ticket-list > div:last-child {
  border-bottom: 0;
}

.ticket-list dt {
  color: var(--muted);
  font-size: 13px;
}

.ticket-list dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.ticket-notice {
  margin: 8px 22px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--orange-soft);
}

.ticket-notice p {
  margin: 0;
  color: #9a5a18;
  font-size: 12px;
  line-height: 1.55;
}

.ticket-notice button {
  margin-top: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--blue);
  font-size: 12px;
}

.pay-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 44px);
  min-height: 54px;
  margin: 18px 22px 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82ff 0%, #246bfe 55%, #1a56e0 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(36, 107, 254, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.pay-cta em {
  font-family: var(--display);
  font-style: normal;
  font-weight: 800;
  opacity: 0.92;
}

.pay-cta:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(36, 107, 254, 0.34);
}

.pay-cta:disabled {
  opacity: 0.45;
  filter: grayscale(0.25);
  cursor: not-allowed;
  box-shadow: none;
}

.pay-cta--compact {
  width: auto;
  min-width: 160px;
  margin: 16px 0 0;
}

.pay-cta.is-ready {
  animation: cta-glow 1.8s ease-in-out infinite;
}

/* —— Modal / toast —— */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 3, 24, 0.55);
  backdrop-filter: blur(4px);
}

.modal {
  position: relative;
  width: min(480px, 100%);
  padding: 28px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
  animation: rise-in 0.28s ease;
}

.modal--pay {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 20px;
  align-items: center;
}

.modal--text p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.modal-label {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.modal h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.modal p {
  margin: 0;
}

.icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.fake-qr {
  display: grid;
  grid-template-columns: repeat(17, 1fr);
  gap: 2px;
  width: 148px;
  height: 148px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.fake-qr span {
  background: #f0eaf2;
  border-radius: 1px;
}

.fake-qr span.is-dark {
  background: #1f0523;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 80;
  width: min(360px, calc(100vw - 40px));
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(31, 5, 35, 0.96);
  color: #fff;
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 12px)) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cta-glow {
  0%,
  100% {
    box-shadow: 0 14px 28px rgba(36, 107, 254, 0.28);
  }
  50% {
    box-shadow: 0 16px 36px rgba(36, 107, 254, 0.42);
  }
}

@media (max-width: 920px) {
  .checkout {
    grid-template-columns: 1fr;
  }

  .ticket {
    position: static;
    order: -1;
  }

  .ticket-amount strong {
    font-size: 36px;
  }

}

@media (min-width: 768px) and (min-height: 600px) and (max-width: 920px) {
  .checkout {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  }

  .ticket {
    position: sticky;
    top: 24px;
    order: initial;
  }
}

@media (max-width: 1024px) and (max-height: 599px) {
  .checkout {
    grid-template-columns: 1fr;
  }

  .ticket {
    position: static;
    order: initial;
  }
}

@media (max-width: 767px) {
  .checkout {
    grid-template-columns: 1fr;
  }

  .ticket {
    position: static;
    order: initial;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-inner section,
  .footer-inner section:first-child {
    padding: 28px 0;
  }

  .footer-inner section + section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 0;
  }
}

@media (max-width: 700px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .header-nav {
    position: absolute;
    top: calc(100% - 2px);
    right: 0;
    z-index: 30;
    width: min(240px, calc(100vw - 32px));
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 12px 12px;
    background: var(--plum);
    box-shadow: 0 18px 30px rgba(20, 3, 24, 0.25);
  }

  .header-nav.is-open {
    display: flex;
  }

  .header-nav a {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .page {
    width: calc(100% - 20px);
    padding-top: 24px;
  }

  .channel-rail {
    display: none;
  }

  .ticket {
    order: initial;
  }

  .sheet {
    padding: 6px;
  }

  .block {
    padding: 18px 16px;
  }

  .target-switch,
  .pay-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .server-list {
    grid-template-columns: 1fr;
  }

  .target-option {
    gap: 8px;
    min-height: 72px;
    padding: 10px 8px;
  }

  .target-option img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .target-option span {
    min-width: 0;
  }

  .target-option strong {
    font-size: 14px;
  }

  .target-option small {
    font-size: 11px;
    line-height: 1.35;
  }

  .pay-button {
    min-height: 52px;
  }

  .pay-button img {
    width: min(104px, 100%);
    height: 34px;
  }

  .amount-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .amount-button {
    min-height: 48px;
    font-size: 15px;
  }

  .amount-button--custom {
    font-size: 13px;
  }

  .amount-button--custom .custom-amount-editor {
    padding: 0 7px;
  }

  .amount-button--custom input {
    font-size: 15px;
  }

  .modal--pay {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

/* —— Real payment integration —— */
.block-hint.is-error {
  color: var(--red);
}

.block-hint.is-pending {
  color: var(--blue-status);
}

.server-shortcuts[hidden] {
  display: none !important;
}

.qr-code {
  position: relative;
  width: 280px;
  height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 10px solid #fff;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.modal.modal--pay {
  width: min(680px, 100%);
  grid-template-columns: 280px minmax(0, 1fr);
}

.qr-code img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.qr-code.is-expired img {
  filter: grayscale(1) blur(1px);
  opacity: 0.28;
}

.qr-expired-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.78);
  color: #333;
  cursor: pointer;
  backdrop-filter: blur(1px);
}

.qr-expired-overlay strong {
  font-size: 18px;
  line-height: 1.4;
}

.qr-expired-overlay > span:last-child {
  color: var(--blue);
  font-size: 14px;
}

.qr-expired-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(36, 107, 254, 0.25);
}

.qr-expired-overlay:hover .qr-expired-icon,
.qr-expired-overlay:focus-visible .qr-expired-icon {
  transform: rotate(-25deg);
}

.qr-expired-overlay:focus-visible {
  outline: 3px solid rgba(36, 107, 254, 0.35);
  outline-offset: -3px;
}

.loading-layer {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 3, 24, 0.5);
  backdrop-filter: blur(5px);
}

.loading-card {
  min-width: 220px;
  padding: 28px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.loading-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  display: inline-block;
  border: 3px solid var(--blue-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: pay-spin 0.75s linear infinite;
}

body.has-modal {
  overflow: hidden;
}

@keyframes pay-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 1080px);
    padding-top: 24px;
  }

  .modal--pay {
    grid-template-columns: 1fr;
  }

  .qr-code {
    width: min(260px, 75vw);
    height: min(260px, 75vw);
    margin: 0 auto;
  }
}

.is-mobile-pay #payModal {
  display: none !important;
}
