:root {
  color-scheme: dark;
  --bg: #080d1d;
  --panel: rgba(19, 29, 58, .90);
  --panel-soft: rgba(13, 22, 45, .76);
  --text: #f4f7ff;
  --muted: #9aa7c9;
  --faint: #7482a8;
  --line: rgba(145, 163, 214, .18);
  --line-strong: rgba(145, 163, 214, .30);
  --brand-soft: rgba(109, 140, 255, .16);
  --green: #45df9a;
  --green-soft: rgba(69, 223, 154, .14);
  --shadow: 0 20px 48px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html {
  min-width: 0;
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 8% -8%, rgba(91, 121, 255, .34), transparent 34%),
    radial-gradient(circle at 102% 18%, rgba(21, 165, 139, .18), transparent 30%),
    linear-gradient(180deg, #0a1024 0%, var(--bg) 48%, #070b18 100%);
}

button { font: inherit; }

.shelf-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding:
    max(24px, env(safe-area-inset-top))
    clamp(14px, 4vw, 30px)
    max(30px, env(safe-area-inset-bottom));
}

.shelf-header { padding: 4px 2px 0; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.orders-entry {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(11, 18, 38, .66);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.orders-entry:hover { border-color: var(--line-strong); }

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 45px;
  height: 45px;
  place-items: center;
  border: 1px solid rgba(147, 169, 255, .42);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, rgba(123, 151, 255, .95), rgba(70, 91, 203, .86));
  box-shadow: 0 9px 28px rgba(76, 104, 236, .36);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.08em;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .20em;
}

h1 {
  margin: 0;
  font-size: clamp(29px, 8vw, 42px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.shelf-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 18, 38, .62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.summary-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft), 0 0 15px rgba(69, 223, 154, .62);
}

.summary-note {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 10px;
}

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

a.product-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

a.product-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 24px 52px rgba(0, 0, 0, .34);
  transform: translateY(-2px);
}

a.product-card:active { transform: translateY(0); }

a.product-card:focus-visible {
  outline: 2px solid #8fa8ff;
  outline-offset: 3px;
}

.cover-wrap {
  position: relative;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
  background: #101936;
}

.cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.platform-tag,
.availability {
  position: absolute;
  top: 9px;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(5, 10, 24, .68);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.platform-tag { left: 9px; color: #fff; }
.availability { right: 9px; color: var(--green); }

.card-content { padding: 12px 12px 13px; }

.product-name {
  min-height: 42px;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 680;
  line-height: 1.5;
  letter-spacing: -.012em;
}

.product-facts {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.fact dt {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.4;
}

.fact dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #e8edff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.4;
  text-align: right;
}

.fact.price-fact {
  align-items: flex-end;
  padding-top: 2px;
}

.price {
  color: #ffd26d !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.price small {
  color: var(--faint);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0;
}

.eta-fact dd { color: #b9c8ff; }

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: #aebcff;
  font-size: 10px;
  font-weight: 700;
}

.card-cta::after { content: "→"; }

.shelf-state {
  margin-top: 14px;
  padding: 24px 18px;
  border: 1px solid rgba(255, 132, 145, .25);
  border-radius: 16px;
  background: rgba(68, 17, 28, .36);
  text-align: center;
}

.shelf-state[hidden] { display: none; }

.shelf-state strong {
  display: block;
  font-size: 15px;
}

.shelf-state p {
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.retry-button {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: var(--brand-soft);
  cursor: pointer;
}

.shelf-footer {
  margin-top: 22px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.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;
}

.skeleton-card {
  min-height: 252px;
  border-color: rgba(145, 163, 214, .10);
  background:
    linear-gradient(100deg, transparent 22%, rgba(255, 255, 255, .045) 42%, transparent 62%),
    var(--panel-soft);
  background-size: 220% 100%, 100% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  to { background-position: -220% 0, 0 0; }
}

@media (min-width: 700px) {
  .shelf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
  }

  .card-content { padding: 14px 14px 15px; }
  .product-name { font-size: 15px; }
  .fact dt, .fact dd { font-size: 11px; }
  .price { font-size: 22px !important; }
}

@media (max-width: 359px) {
  .shelf-grid { grid-template-columns: 1fr; }
  .product-name { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-card { animation: none; }
}
