:root, [data-theme="dark"] {
  --app-bg: #101014;
  --surface-1: #18181D;
  --surface-2: #222228;
  --surface-3: #2B2B33;
  --border-hairline: #2E2E36;
  --border-strong: #3E3E48;
  --ink-primary: #F5F5F7;
  --ink-secondary: #A4A6B3;
  --ink-muted: #707382;
  --brand-blue: #0A84FF;
  --brand-blue-hover: #0070E0;
  --brand-blue-soft: rgba(10, 132, 255, 0.16);
  --accent-green: #64C81A;
  --accent-green-hover: #56B015;
  --accent-green-soft: rgba(100, 200, 26, 0.15);
  --accent-amber: #F59E0B;
  --accent-amber-soft: rgba(245, 158, 11, 0.14);
  --accent-red: #EF4444;
  --accent-red-soft: rgba(239, 68, 68, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="light"] {
  --app-bg: #F3F4F8;
  --surface-1: #FFFFFF;
  --surface-2: #F7F8FB;
  --surface-3: #ECEEF4;
  --border-hairline: #E2E5EE;
  --border-strong: #C9CFDD;
  --ink-primary: #111827;
  --ink-secondary: #4B5563;
  --ink-muted: #828A99;
  --brand-blue: #0066EE;
  --brand-blue-hover: #0052C2;
  --brand-blue-soft: rgba(0, 102, 238, 0.1);
  --accent-green: #22A52D;
  --accent-green-hover: #1B8C25;
  --accent-green-soft: rgba(34, 165, 45, 0.12);
  --accent-amber: #D97706;
  --accent-amber-soft: rgba(217, 119, 6, 0.1);
  --accent-red: #DC2626;
  --accent-red-soft: rgba(220, 38, 38, 0.1);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--app-bg);
  color: var(--ink-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

button {
  font-family: inherit;
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* App Shell: Left Rail + Main Workspace */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.side-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 60px;
  background: var(--surface-1);
  border-right: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 6px;
  z-index: 45;
}

.rail-brand {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--brand-blue);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-bottom: 18px;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.rail-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rail-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  width: 46px;
  min-height: 44px;
  padding: 5px 2px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.rail-btn:hover {
  background: var(--surface-2);
  color: var(--ink-primary);
}

.rail-btn.active {
  background: var(--surface-3);
  color: var(--ink-primary);
}

.rail-label {
  font-size: 10px;
  font-weight: 500;
}

.workspace-col {
  margin-left: 60px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Sticky Top Header & Spotlight Search */
.site-header {
  position: sticky;
  top: 0;
  z-index: 42;
  background: rgba(16, 16, 20, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-hairline);
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.88);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 54px;
}

.brand-compact {
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.brand-compact strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-compact small {
  font-size: 11px;
  color: var(--ink-muted);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 560px;
  z-index: 50;
}

.search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 6px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-wrap.focused .search-pill {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px var(--brand-blue-soft);
}

.search-icon {
  color: var(--ink-muted);
  flex-shrink: 0;
}

.search-pill input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-primary);
  font-size: 13.5px;
  outline: none;
  min-width: 0;
}

.search-clear {
  appearance: none;
  border: none;
  background: var(--surface-3);
  color: var(--ink-secondary);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
}

.search-kbd {
  font-family: inherit;
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 5px;
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  z-index: 55;
}

.search-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-tag-chip {
  appearance: none;
  border: 1px solid var(--border-hairline);
  background: var(--surface-2);
  color: var(--ink-secondary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.quick-tag-chip:hover {
  border-color: var(--brand-blue);
  color: var(--ink-primary);
}

.search-live-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-live-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: inherit;
}

.search-live-item:hover {
  background: var(--surface-2);
}

.search-live-thumb {
  width: 44px;
  height: 28px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}

.search-live-meta {
  flex: 1;
  min-width: 0;
}

.search-live-meta strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-live-meta small {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.search-live-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-green);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--accent-green);
  background: var(--accent-green-soft);
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 500;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
}

.live-pill.offline {
  color: var(--accent-amber);
  background: var(--accent-amber-soft);
}

.live-pill.offline .live-dot {
  background: var(--accent-amber);
}

.btn-blue-pill {
  appearance: none;
  border: none;
  background: var(--brand-blue);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.btn-blue-pill:hover {
  background: var(--brand-blue-hover);
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--border-hairline);
  background: var(--surface-2);
  color: var(--ink-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--ink-primary);
}

/* Main Content */
.main-content {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px 56px;
  flex: 1;
}

.notice-strip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--brand-blue);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
}

.notice-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-blue);
  background: var(--brand-blue-soft);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.notice-strip p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 13px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Catalog Header & Controls (appstorrent.ru/games/ style) */
.catalog-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.breadcrumb {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.title-with-count {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.title-with-count h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.count-sup {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-top: 2px;
}

.catalog-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-select {
  appearance: none;
  background: var(--surface-2);
  color: var(--ink-primary);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
}

.view-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  width: 30px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.view-btn.active {
  background: var(--surface-3);
  color: var(--ink-primary);
}

.facet-bar {
  margin-bottom: 18px;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-tab {
  appearance: none;
  border: 1px solid var(--border-hairline);
  background: var(--surface-2);
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cat-tab:hover {
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

.cat-tab.active {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--app-bg);
  font-weight: 600;
}

.cat-count {
  font-size: 11px;
  opacity: 0.72;
}

/* 4-Column Games Grid (appstorrent.ru/games/ style) */
.games-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.game-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.game-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  background: linear-gradient(135deg, #1E2230 0%, #141720 100%);
  overflow: hidden;
}

.game-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.game-card:hover .game-card-cover img {
  transform: scale(1.05);
}

.game-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  background: radial-gradient(circle at 20% 20%, rgba(10, 132, 255, 0.28), transparent 65%),
              linear-gradient(135deg, #1D212D 0%, #14161D 100%);
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-green);
  color: #0B1404;
  letter-spacing: 0.02em;
}

.card-size-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(16, 16, 20, 0.72);
  backdrop-filter: blur(6px);
  color: #F5F5F7;
}

.game-card-body {
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.game-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-sub {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-footer {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.card-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-green);
}

.price-orig {
  font-size: 11.5px;
  color: var(--ink-muted);
  text-decoration: line-through;
}

.card-buy-mini {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--ink-primary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.card-buy-mini:hover:not(:disabled) {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #0B1404;
}

.card-buy-mini:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* List View Mode */
.games-list-mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-list-row {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 120px 100px 92px;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.game-list-row:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.list-thumb {
  width: 78px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-3);
}

.list-thumb-fallback {
  width: 78px;
  height: 40px;
  border-radius: 6px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: 11px;
}

/* Dedicated Game Detail View (2-Column appstorrent.ru layout) */
.detail-breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
}

.btn-back-link {
  appearance: none;
  border: 1px solid var(--border-hairline);
  background: var(--surface-2);
  color: var(--ink-primary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.btn-back-link:hover {
  background: var(--surface-3);
}

.crumb-sep, .crumb-muted {
  color: var(--ink-muted);
}

.crumb-curr {
  color: var(--ink-primary);
  font-weight: 600;
}

.detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.detail-left, .detail-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.detail-card {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 18px;
}

.cover-hero-card {
  padding: 0;
  overflow: hidden;
}

.detail-hero-banner {
  position: relative;
  width: 100%;
  max-height: 360px;
  min-height: 170px;
  background: radial-gradient(circle at 30% 30%, rgba(10, 132, 255, 0.25), transparent 65%), #161822;
  overflow: hidden;
}

.detail-hero-banner img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--surface-1) 0%, transparent 55%);
  pointer-events: none;
}

.detail-hero-body {
  padding: 16px 20px 20px;
}

.detail-hero-body h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}

.detail-summary {
  margin: 0 0 14px;
  color: var(--ink-secondary);
  font-size: 14px;
}

.important-notice-box {
  background: var(--accent-amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.important-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-amber);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}

.important-text {
  font-size: 13px;
  color: var(--ink-primary);
  white-space: pre-line;
  line-height: 1.6;
}

.detail-description {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-secondary);
  white-space: pre-line;
}

.detail-sec-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 650;
}

.screenshot-stage {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  margin-bottom: 10px;
}

.screenshot-stage img {
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  display: block;
}

.shot-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.shot-thumb-btn {
  appearance: none;
  border: 2px solid transparent;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  width: 96px;
  height: 58px;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--surface-2);
}

.shot-thumb-btn.active {
  border-color: var(--brand-blue);
}

.shot-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-reqs-text {
  font-size: 13.5px;
  color: var(--ink-secondary);
  white-space: pre-line;
  line-height: 1.65;
}

.info-price-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-hairline);
}

.detail-price-now {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-primary);
}

.info-meta-list {
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 9px 10px;
  font-size: 13px;
}

.info-meta-list dt {
  color: var(--ink-muted);
}

.info-meta-list dd {
  margin: 0;
  color: var(--ink-primary);
  font-weight: 500;
  text-align: right;
}

.btn-green-cta {
  appearance: none;
  border: none;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-green);
  color: #0B1404;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-green-cta:hover:not(:disabled) {
  background: var(--accent-green-hover);
}

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

.shield-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent-green);
}

.sidebar-card-title {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-secondary);
}

.features-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.feature-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-green-soft);
  color: var(--accent-green);
  font-weight: 500;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid transparent;
}

.related-item:hover {
  border-color: var(--border-strong);
}

.related-item img {
  width: 58px;
  height: 36px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}

.related-meta {
  flex: 1;
  min-width: 0;
}

.related-meta strong {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-meta small {
  font-size: 11.5px;
  color: var(--accent-green);
}

/* Shared Pills & Buttons */
.btn-primary {
  appearance: none;
  border: 1px solid var(--brand-blue);
  background: var(--brand-blue);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-blue-hover);
}

.btn-outline {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-outline:hover {
  background: var(--surface-3);
}

.btn-ghost {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--brand-blue);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-ghost:hover {
  background: var(--brand-blue-soft);
}

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-xs { padding: 4px 8px; font-size: 12px; }
.btn-block { width: 100%; padding: 11px 16px; font-size: 14px; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill-green { background: var(--accent-green-soft); color: var(--accent-green); }
.pill-amber { background: var(--accent-amber-soft); color: var(--accent-amber); }
.pill-muted { background: var(--surface-3); color: var(--ink-muted); }

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

.tier-chip {
  font-size: 11px;
  color: var(--accent-amber);
  background: var(--accent-amber-soft);
  padding: 2px 7px;
  border-radius: 4px;
}

.empty-state {
  grid-column: 1 / -1;
  background: var(--surface-1);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 44px 20px;
  text-align: center;
  color: var(--ink-muted);
}

/* Panels (Lookup & Help) */
.panel-card {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}

.panel-header h1 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 650;
}

.panel-header p {
  margin: 0 0 18px;
  color: var(--ink-secondary);
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 13px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.field input {
  width: 100%;
  padding: 8.5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink-primary);
  background: var(--surface-2);
}

.req { color: var(--accent-red); }

.lookup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.lookup-results {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-result-card {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface-2);
}

.order-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.order-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.order-result-grid strong {
  display: block;
  color: var(--ink-primary);
  font-size: 13.5px;
}

.help-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.help-grid h2 { margin: 0 0 12px; font-size: 16px; }

.help-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.support-list {
  margin: 0;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
}

.support-list dt { color: var(--ink-muted); }
.support-list dd { margin: 0; color: var(--ink-primary); font-weight: 600; }

.muted-note {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  background: var(--surface-1);
  padding: 14px 24px;
  color: var(--ink-muted);
  font-size: 12.5px;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  align-items: center;
}

.footer-community {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.footer-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  color: var(--ink-primary);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.footer-chip:hover {
  border-color: var(--brand-green);
}

.support-link {
  color: var(--brand-blue, #38bdf8);
  text-decoration: underline;
  word-break: break-all;
}

.ref-tag {
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Slide-over Checkout Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  z-index: 60;
}

.checkout-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 470px;
  max-width: 100vw;
  background: var(--surface-1);
  border-left: 1px solid var(--border-hairline);
  z-index: 70;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-hairline);
}

.drawer-header h2 { margin: 0; font-size: 16px; font-weight: 650; }
.drawer-subtitle { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-muted); }

.drawer-body {
  padding: 18px 20px 28px;
  overflow-y: auto;
  flex: 1;
}

.product-brief {
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  margin-bottom: 16px;
}

.brief-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stock-text { font-size: 12px; font-weight: 600; color: var(--ink-secondary); }
.product-desc { font-size: 13px; color: var(--ink-secondary); white-space: pre-line; }

.field-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.field-inline label { font-size: 13px; font-weight: 600; color: var(--ink-secondary); }

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-control button {
  border: none;
  background: var(--surface-2);
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-primary);
}

.qty-control input {
  width: 54px;
  height: 32px;
  border: none;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  background: var(--surface-1);
  color: var(--ink-primary);
}

.coupon-row { display: flex; gap: 8px; }
.field-hint { font-size: 12px; color: var(--ink-muted); min-height: 16px; }
.field-hint.ok { color: var(--accent-green); }
.field-hint.err { color: var(--accent-red); }

.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pay-option {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pay-option strong { font-size: 13px; color: var(--ink-primary); }
.pay-option small { font-size: 11.5px; color: var(--ink-muted); }

.pay-option.selected {
  border-color: var(--brand-blue);
  background: var(--brand-blue-soft);
}

.price-summary {
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 14px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 13px;
  color: var(--ink-secondary);
}

.total-row {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-hairline);
  color: var(--ink-primary);
  font-weight: 600;
}

.total-amount { font-size: 20px; color: var(--accent-green); }
.text-green { color: var(--accent-green); }

.error-box {
  background: var(--accent-red-soft);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* Payment & Done */
.pay-box, .done-box { display: flex; flex-direction: column; gap: 13px; }
.pay-top-row { display: flex; align-items: center; justify-content: space-between; }

.pay-status-badge {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.pay-countdown { font-size: 12.5px; font-weight: 600; color: var(--ink-secondary); }
.pay-amount-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pay-amount { font-size: 32px; font-weight: 700; }

.exact-warning {
  background: var(--accent-amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.38);
  color: var(--accent-amber);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
}

.qr-card {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.qr-channel-tag { font-size: 13px; font-weight: 650; color: var(--brand-blue); }
.qr-channel-tag.wechat { color: var(--accent-green); }

.qr-image {
  width: 210px;
  height: 210px;
  object-fit: contain;
  background: #FFFFFF;
  border-radius: 8px;
  padding: 6px;
}

.qr-missing {
  width: 210px;
  padding: 28px 14px;
  background: var(--surface-1);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}

.qr-listen-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent-green);
}

.pay-meta {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-meta > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.pay-meta span { color: var(--ink-muted); }

.usdt-box {
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}

.usdt-label { font-size: 12px; color: var(--ink-muted); margin-bottom: 4px; }
.usdt-box code { word-break: break-all; font-size: 12.5px; }

.demo-pay-panel {
  background: var(--brand-blue-soft);
  border: 1px solid rgba(10, 132, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 14px;
}

.demo-pay-panel p { margin: 0 0 12px; font-size: 12.5px; color: var(--ink-secondary); }

.done-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-green-soft);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.done-box h3 { margin: 0; font-size: 18px; }
.done-subtitle { margin: -6px 0 0; color: var(--ink-secondary); font-size: 13px; }

.done-order-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.delivered-keys-wrapper {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.delivered-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-hairline);
  font-size: 12.5px;
  font-weight: 600;
}

.delivered-keys-list { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }

.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-hairline);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  word-break: break-all;
}

.key-item:last-child { border-bottom: none; }

/* Auth, Modals, Maintenance & Toast */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 2px 6px 2px 4px;
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-label {
  font-size: 12px;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 410px;
  max-width: 100%;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-hairline);
}

.modal-header h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; }

.auth-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.auth-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.auth-tab.active { background: var(--brand-blue-soft); color: var(--brand-blue); }

.auth-tip { margin: 12px 0 0; font-size: 12px; color: var(--ink-muted); text-align: center; }

.my-orders-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.my-orders-head h2 { margin: 0; font-size: 17px; }
.my-orders-hint { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-muted); }

.maintenance-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(16, 16, 20, 0.96);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.maintenance-card {
  max-width: 440px;
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
}

.maintenance-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--ink-primary);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

@media (max-width: 1120px) {
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-columns { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .side-rail {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 54px;
    flex-direction: row;
    justify-content: space-around;
    border-right: none;
    border-top: 1px solid var(--border-hairline);
    padding: 4px 8px;
  }
  .rail-brand, .rail-bottom { display: none; }
  .rail-nav { flex-direction: row; justify-content: space-around; }
  .workspace-col { margin-left: 0; padding-bottom: 58px; }
  .brand-compact, .live-pill { display: none; }
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-list-row { grid-template-columns: 60px minmax(0, 1fr) auto; }
  .form-row-3, .help-grid, .order-result-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .games-grid { grid-template-columns: 1fr; }
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btnSpin 0.65s linear infinite;
  flex-shrink: 0;
}
button.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  opacity: 0.78;
  cursor: wait;
}
#btn-send-auth-code {
  min-width: 96px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:not(:disabled):active {
  transform: scale(0.98);
}

.coin-pill {
  appearance: none;
  border: 1px solid rgba(255, 215, 0, 0.55);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(218, 165, 32, 0.14));
  color: #FFD700;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-shadow: 0 1px 6px rgba(255, 215, 0, 0.25);
}
.coin-pill:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.34), rgba(218, 165, 32, 0.22));
}

.facet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.coin-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.card-coin-price {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(212, 175, 55, 0.12));
  border: 1px solid rgba(255, 215, 0, 0.42);
  color: #FFD700;
  white-space: nowrap;
}
.coin-gold-text {
  color: #FFD700;
  font-weight: 700;
}
.coin-wallet-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.16), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(255, 215, 0, 0.42);
  margin-bottom: 14px;
}
.coin-wallet-banner small { color: var(--ink-secondary); font-size: 11.5px; }
.coin-wallet-num {
  font-size: 21px;
  font-weight: 800;
  color: #FFD700;
  margin-top: 2px;
  text-shadow: 0 1px 10px rgba(255, 215, 0, 0.28);
}
.bind-phone-box {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 215, 0, 0.09);
  border: 1px solid rgba(255, 215, 0, 0.32);
  margin-bottom: 14px;
}
.coin-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.coin-logs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}
.coin-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
}
.rail-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #22c55e;
  color: #052e16;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
}
.email-alert-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.email-alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
  font-size: 13px;
  line-height: 1.5;
}
.order-mail-notice {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.5;
  background: rgba(34, 197, 94, 0.13);
  border: 1px solid rgba(34, 197, 94, 0.38);
  color: #86efac;
}
.order-mail-notice.pending {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.38);
  color: #fcd34d;
}
.order-device-bound-notice {
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(245, 158, 11, 0.12));
  border: 1px solid rgba(248, 113, 113, 0.42);
  color: #fecaca;
  font-size: 12.5px;
  line-height: 1.55;
}
.order-device-bound-title {
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: 4px;
  font-size: 13px;
}
.order-device-bound-desc strong {
  color: #fff;
}
.order-device-bound-meta {
  margin-top: 6px;
  font-size: 11.5px;
  color: #fde68a;
  opacity: 0.92;
}
.order-device-bound-meta code {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 6px;
  border-radius: 5px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.key-item-burned {
  background: rgba(239, 68, 68, 0.06);
}
.key-item-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.key-code-burned {
  text-decoration: line-through;
  opacity: 0.62;
  color: #fca5a5;
}
.key-burned-meta {
  font-size: 11px;
  color: #fcd34d;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.pill-burned {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.42);
  font-weight: 600;
}
.pill-active-key {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-size: 11px;
  padding: 2px 7px;
}

/* Startup Welcome & Event Promo Modal */
#welcome-promo-modal {
  background: rgba(6, 8, 13, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.welcome-promo-card {
  position: relative;
  width: min(760px, 94vw);
  max-width: 760px;
  padding: 28px 28px 24px;
  background-color: #141822;
  background-image:
    radial-gradient(circle at 18% 0%, rgba(255, 215, 0, 0.14), transparent 48%),
    radial-gradient(circle at 86% 10%, rgba(34, 197, 94, 0.1), transparent 44%);
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(255, 215, 0, 0.16);
  opacity: 1;
}
.welcome-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #232a3b;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}
.welcome-close-btn:hover {
  background: #334155;
  transform: scale(1.06);
}
.welcome-promo-head {
  padding-right: 40px;
  margin-bottom: 20px;
}
.welcome-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #FFD700;
  background: #252010;
  border: 1px solid rgba(255, 215, 0, 0.52);
  margin-bottom: 10px;
}
.welcome-title {
  margin: 0 0 8px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.welcome-sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: #cbd5e1;
}
.welcome-games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .welcome-games-grid {
    grid-template-columns: 1fr;
  }
}
.welcome-game-card {
  background: #1c2231;
  border: 1px solid #2d364d;
  border-radius: 13px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.welcome-game-card:hover {
  transform: translateY(-3px);
  border-color: #FFD700;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}
.welcome-game-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0f131b;
  overflow: hidden;
}
.welcome-game-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.welcome-free-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #1c1400;
  background: linear-gradient(135deg, #FFE44D, #FFB800);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.welcome-free-tag.hot {
  background: linear-gradient(135deg, #FFD700, #FF9900);
}
.welcome-game-meta {
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.welcome-game-meta strong {
  font-size: 14px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.welcome-game-meta small {
  font-size: 11.5px;
  color: #94a3b8;
}
.welcome-game-buy {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #FFD700;
}
.welcome-promo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #262f42;
}
.welcome-footer-note {
  font-size: 12.5px;
  color: #cbd5e1;
}
.welcome-cta-btn {
  flex-shrink: 0;
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  color: #1b1300;
  background: linear-gradient(135deg, #FFE44D, #FFB800);
  box-shadow: 0 6px 20px rgba(255, 200, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.welcome-cta-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* Referral Share & 10 RMB Invite Coupon */
.invite-coupon-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(255, 165, 0, 0.08));
  border: 1px solid rgba(255, 215, 0, 0.48);
  color: #fef08a;
  font-size: 13px;
}
.referral-share-card {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 215, 0, 0.36);
}
.referral-share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.referral-share-head h3 {
  margin: 0;
  font-size: 15px;
  color: #FFD700;
}
.referral-share-desc {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-secondary);
}
.referral-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.referral-link-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(0, 0, 0, 0.32);
  color: var(--ink-primary);
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.referral-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  margin-bottom: 10px;
}
.referral-stats-row strong {
  color: var(--ink-primary);
}
.referral-invitees-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}
.referral-invitee-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  font-size: 12px;
}

/* Welfare Guide Gift Code Redemption Card */
.welfare-redeem-card {
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 215, 0, 0.14), transparent 50%),
    var(--bg-surface);
  border: 1px solid rgba(255, 215, 0, 0.42);
}
.welfare-redeem-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.welfare-redeem-row input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.36);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink-primary);
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.welfare-redeem-row input:focus {
  outline: none;
  border-color: #FFD700;
}
.welfare-redeem-ok {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
  font-size: 13px;
}

/* Stock badge & Sold-out styling */
.card-badge.sold-out {
  background: rgba(185, 28, 28, 0.88);
  color: #fee2e2;
  border: 1px solid rgba(248, 113, 113, 0.5);
}
.game-card.is-sold-out,
.game-list-row.is-sold-out {
  opacity: 0.72;
}
.game-card.is-sold-out:hover {
  opacity: 0.92;
}
.card-buy-mini.sold-out-btn {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
  font-size: 11px;
  padding: 5px 8px;
  white-space: nowrap;
}
.card-buy-mini.sold-out-btn:hover {
  background: rgba(245, 158, 11, 0.28);
}

/* Real-Time Payment Verification Animation Panel */
.btn-verify-paid {
  width: 100%;
  margin-top: 2px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
}

.pay-verifying-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 22px 18px 16px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 18%, rgba(56, 189, 248, 0.16), transparent 62%),
    rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(56, 189, 248, 0.34);
  transition: border-color 0.28s ease, background 0.28s ease;
}

.pay-verifying-card.is-verified {
  background:
    radial-gradient(circle at 50% 18%, rgba(34, 197, 94, 0.22), transparent 65%),
    rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.55);
}

.verify-radar {
  position: relative;
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.verify-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.5);
  animation: verifyRipple 2s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}

.verify-ripple-2 {
  animation-delay: 1s;
}

.pay-verifying-card.is-verified .verify-ripple {
  border-color: rgba(34, 197, 94, 0.65);
  animation: none;
  opacity: 0.45;
  transform: scale(1.06);
}

.verify-spinner-ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.16);
  border-top-color: #38bdf8;
  border-right-color: #60a5fa;
  animation: verifySpin 0.9s linear infinite;
}

.pay-verifying-card.is-verified .verify-spinner-ring {
  animation: none;
  border-color: #22c55e;
}

.verify-center-icon {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.pay-verifying-card.is-verified .verify-center-icon {
  background: rgba(34, 197, 94, 0.22);
  color: #4ade80;
  transform: scale(1.08);
}

.verify-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-primary);
}

.pay-verifying-card.is-verified .verify-title {
  color: #4ade80;
}

.verify-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-secondary);
  max-width: 310px;
}

.verify-progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 2px 0;
}

.verify-progress-bar {
  position: absolute;
  top: 0;
  left: -45%;
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #38bdf8, #4ade80, transparent);
  animation: verifyScan 1.35s ease-in-out infinite;
}

.pay-verifying-card.is-verified .verify-progress-bar {
  left: 0;
  width: 100%;
  background: #22c55e;
  animation: none;
}

.verify-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.verify-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}

.verify-step .v-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}

.verify-step.is-done {
  color: #86efac;
}

.verify-step.is-done .v-dot {
  background: rgba(34, 197, 94, 0.22);
  border-color: #22c55e;
  color: #4ade80;
}

.verify-step.is-active {
  color: #bae6fd;
  font-weight: 600;
}

.verify-step.is-active .v-dot {
  border-color: #38bdf8;
  background: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.22);
  animation: verifyPulseDot 1.1s ease-in-out infinite;
}

@keyframes verifySpin {
  to { transform: rotate(360deg); }
}

@keyframes verifyRipple {
  0% { transform: scale(0.76); opacity: 0.75; }
  100% { transform: scale(1.38); opacity: 0; }
}

@keyframes verifyScan {
  0% { left: -45%; }
  100% { left: 105%; }
}

@keyframes verifyPulseDot {
  0%, 100% { transform: scale(0.9); box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.08); }
}

/* === Enhanced Storefront Components (Cart, Pagination, Share, Install Guide, Change Password, Order Actions) === */
.cart-header-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cart-header-btn:hover { border-color: var(--accent); background: var(--bg-hover); }
.cart-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.card-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.card-cart-mini {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.card-cart-mini:hover, .card-cart-mini.in-cart {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}
.detail-secondary-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.catalog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 8px 0 18px;
}
.change-pwd-box {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(59, 130, 246, 0.05);
}
.change-pwd-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.change-pwd-form input {
  flex: 1;
  min-width: 160px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--ink-primary);
  font-size: 13px;
}
.mac-install-guide {
  margin: 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(16, 185, 129, 0.06);
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.6;
  text-align: left;
}
.mac-install-guide summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink-primary);
}
.mac-install-guide ol {
  margin: 8px 0 0;
  padding-left: 18px;
}
.mac-install-guide code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cart-modal-card { max-width: 520px; width: 94vw; }
.cart-coupon-progress {
  padding: 9px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 12.5px;
  font-weight: 600;
}
.cart-coupon-progress.ready {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 13px;
}
.order-pending-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.order-downloads-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.order-dl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
@media (max-width: 640px) {
  .cart-btn-text { display: none; }
}
