/*
  [server extension] The look the cashier and the public ranking share (pay.<domain>; the owner, 2026-10-19: 高级, 游戏元素, 背景图片图标全部用上;
  mir4global.com: black, the MIR4 red, white type over the game's key art). Dark only (the game's own look). Tokens, the page backdrop
  (the client's dark panel art, a veil and slow embers), the nav, the hero over the client's loading key art, cards, buttons, fields,
  the foot. Motion stops for prefers-reduced-motion.
*/

:root {
  --ink-0: #07080b;
  --ink-1: #0c0f15;
  --ink-2: #12161e;
  --ink-3: #1a1f2a;
  --ink-4: #232a37;
  --line: rgb(216 178 106 / 14%);
  --line-strong: rgb(216 178 106 / 42%);
  --gold: #d8b26a;
  --gold-hi: #f4dca6;
  --gold-lo: #8c6a2c;
  --red: #da1e15;
  --red-deep: #a81718;
  --red-dark: #5e0b08;
  --jade: #8fb5ae;
  --text: #efe9dc;
  --muted: #a39d90;
  --faint: #6f6c66;
  --ok: #4fbf8a;
  --error: #ff6b5e;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -24px rgb(0 0 0 / 80%);
  --display: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink-0);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
}

/* ---- the backdrop: the client's dark panel art under a veil, with slow embers ---- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.backdrop__art {
  position: absolute;
  inset: 0;
  background: url('/cashier/art/backdrop.webp') center / cover no-repeat;
  opacity: 0.55;
}

.backdrop__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgb(218 30 21 / 12%), transparent 70%),
    radial-gradient(80% 60% at 50% 100%, rgb(216 178 106 / 7%), transparent 70%),
    linear-gradient(180deg, rgb(7 8 11 / 30%), var(--ink-0) 85%);
}

.embers i {
  position: absolute;
  bottom: -20px;
  width: 3px;
  height: 3px;
  background: var(--gold-hi);
  border-radius: 50%;
  box-shadow: 0 0 8px 2px rgb(244 180 90 / 70%);
  opacity: 0;
  animation: ember 16s linear infinite;
}

.embers i:nth-child(1) { left: 6%; animation-delay: 0s; }
.embers i:nth-child(2) { left: 17%; animation-delay: 3s; animation-duration: 19s; }
.embers i:nth-child(3) { left: 29%; animation-delay: 7s; }
.embers i:nth-child(4) { left: 41%; animation-delay: 1.5s; animation-duration: 21s; }
.embers i:nth-child(5) { left: 53%; animation-delay: 9s; }
.embers i:nth-child(6) { left: 64%; animation-delay: 4.5s; animation-duration: 18s; }
.embers i:nth-child(7) { left: 73%; animation-delay: 11s; }
.embers i:nth-child(8) { left: 82%; animation-delay: 2s; animation-duration: 23s; }
.embers i:nth-child(9) { left: 90%; animation-delay: 6s; }
.embers i:nth-child(10) { left: 97%; animation-delay: 13s; animation-duration: 20s; }

@keyframes ember {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.6); }
  10% { opacity: 0.9; }
  70% { opacity: 0.5; }
  100% { opacity: 0; transform: translate3d(40px, -105vh, 0) scale(1.1); }
}

/* ---- the nav ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 max(20px, calc((100vw - 1240px) / 2));
  background: linear-gradient(180deg, rgb(7 8 11 / 92%), rgb(7 8 11 / 72%));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.2);
}

.nav__logo {
  width: auto;
  height: 40px;
  filter: drop-shadow(0 2px 10px rgb(0 0 0 / 70%));
}

.nav__links {
  display: flex;
  gap: 6px;
}

.nav__link {
  position: relative;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav__link::after {
  position: absolute;
  right: 16px;
  bottom: 2px;
  left: 16px;
  height: 2px;
  content: '';
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease);
}

.nav__link:hover,
.nav__link[aria-current='page'] {
  color: var(--text);
}

.nav__link[aria-current='page']::after,
.nav__link:hover::after {
  transform: scaleX(1);
}

/* ---- the hero over the client's key art ---- */

.hero {
  position: relative;
  display: flex;
  gap: 32px;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 380px;
  padding: 72px max(20px, calc((100vw - 1240px) / 2)) 56px;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: '';
  background: var(--hero-art) center 30% / cover no-repeat;
  animation: drift 40s ease-in-out infinite alternate;
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: '';
  background:
    linear-gradient(90deg, rgb(7 8 11 / 92%) 0%, rgb(7 8 11 / 55%) 45%, rgb(7 8 11 / 15%) 75%),
    linear-gradient(180deg, transparent 55%, var(--ink-0) 100%);
}

@keyframes drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}

.hero__eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.42em;
  color: var(--red);
}

.hero__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, #fff 30%, var(--gold-hi) 75%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgb(0 0 0 / 80%));
}

.hero__lead {
  max-width: 34em;
  margin: 14px 0 0;
  font-size: 15px;
  color: rgb(239 233 220 / 82%);
}

.hero__marks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.hero__marks li {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--gold-hi);
}

.hero__marks svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- surfaces ---- */

.card {
  position: relative;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 3%), transparent 40%),
    linear-gradient(180deg, rgb(18 22 30 / 92%), rgb(12 15 21 / 94%));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.card::before {
  position: absolute;
  top: -1px;
  right: 24px;
  left: 24px;
  height: 1px;
  content: '';
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.shell {
  position: relative;
  width: min(1240px, 100% - 40px);
  margin: -24px auto 0;
}

/* ---- buttons and fields ---- */

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
}

.btn--gold {
  color: #241703;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #b98d45);
  box-shadow: 0 8px 22px -10px rgb(216 178 106 / 80%), inset 0 1px 0 rgb(255 255 255 / 50%);
}

.btn--gold:not(:disabled):hover {
  box-shadow: 0 10px 30px -8px rgb(216 178 106 / 90%), inset 0 1px 0 rgb(255 255 255 / 60%);
  transform: translateY(-1px);
}

.btn--ghost {
  color: var(--gold-hi);
  background: rgb(216 178 106 / 6%);
  border-color: var(--line-strong);
}

.btn--ghost:not(:disabled):hover {
  background: rgb(216 178 106 / 12%);
}

.btn--pay {
  width: 100%;
  min-height: 54px;
  font-size: 17px;
  color: #fff;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 14%), transparent 50%),
    linear-gradient(90deg, var(--red-deep), var(--red) 50%, var(--red-deep));
  border-color: rgb(255 120 100 / 35%);
  box-shadow: 0 14px 34px -14px rgb(218 30 21 / 90%), inset 0 1px 0 rgb(255 255 255 / 25%);
}

.btn--pay:not(:disabled):hover {
  box-shadow: 0 16px 40px -12px rgb(218 30 21 / 100%), inset 0 1px 0 rgb(255 255 255 / 30%);
  transform: translateY(-1px);
}

.field {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
}

.field__icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

.field__input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 42px;
  background: rgb(4 5 8 / 70%);
  border: 1px solid var(--ink-4);
  border-radius: var(--radius-sm);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.field__input::placeholder {
  color: var(--faint);
}

.field__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgb(216 178 106 / 18%);
}

.hint {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.hint:empty {
  min-height: 0;
  margin: 0;
}

.hint--error {
  color: var(--error);
}

/* ---- chips and the game's item slot (a reward: its grade's frame, icon and count) ---- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 1px 8px;
  font-size: 12px;
  line-height: 20px;
  color: var(--muted);
  white-space: nowrap;
  background: rgb(255 255 255 / 5%);
  border: 1px solid var(--ink-4);
  border-radius: 6px;
}

.chip--gold {
  color: var(--gold-hi);
  background: rgb(216 178 106 / 10%);
  border-color: var(--line-strong);
}

.chip--red {
  color: #ffd9d4;
  background: rgb(218 30 21 / 22%);
  border-color: rgb(218 30 21 / 55%);
}

/* the game's item slot: its grade's frame, the icon and its count */
.slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  background: radial-gradient(circle at 50% 35%, var(--slot-glow, rgb(160 160 160 / 25%)), rgb(8 9 12 / 95%) 75%);
  border: 1px solid var(--slot-edge, #4a4f5a);
  border-radius: 10px;
  box-shadow: inset 0 0 12px rgb(0 0 0 / 70%);
}

.slot--lead {
  width: 76px;
  height: 76px;
  border-radius: 14px;
}

.slot img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.slot__count {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
}

.slot__name {
  padding: 4px;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.slot[data-grade='2'] { --slot-edge: #3f9b5f; --slot-glow: rgb(63 155 95 / 40%); }
.slot[data-grade='3'] { --slot-edge: #3f7fd0; --slot-glow: rgb(63 127 208 / 42%); }
.slot[data-grade='4'] { --slot-edge: #c9413a; --slot-glow: rgb(201 65 58 / 45%); }
.slot[data-grade='5'] { --slot-edge: #d8a64a; --slot-glow: rgb(216 166 74 / 50%); }
.slot[data-grade='6'] { --slot-edge: #d35ad0; --slot-glow: rgb(211 90 208 / 45%); }

/* ---- states (closed, returned) ---- */

.state {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 56px 24px;
  text-align: center;
}

.state__art {
  width: 160px;
  margin-bottom: 8px;
  filter: drop-shadow(0 10px 30px rgb(216 178 106 / 30%));
}

.state h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.1em;
}

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

.state__order {
  margin: 8px 0 12px !important;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--gold-hi) !important;
}

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

.foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding: 56px 20px calc(40px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--faint);
}

.foot__logo {
  width: auto;
  height: 32px;
  opacity: 0.6;
}

@media (width <= 760px) {
  .nav {
    height: 58px;
  }

  .nav__logo {
    height: 32px;
  }

  .nav__link {
    padding: 8px 10px;
    font-size: 14px;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 44px 16px 40px;
  }

  .hero::after {
    background:
      linear-gradient(180deg, rgb(7 8 11 / 40%) 0%, rgb(7 8 11 / 75%) 60%, var(--ink-0) 100%);
  }

  .shell {
    width: calc(100% - 24px);
    margin-top: -12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }

  .embers {
    display: none;
  }
}
