:root {
  color-scheme: dark;
  --bg: #101414;
  --surface: #171d1d;
  --surface-2: #202828;
  --line: #314040;
  --text: #f5f1e6;
  --muted: #a9b5ad;
  --gold: #f0b94f;
  --gold-2: #ffd77b;
  --teal: #3cc4b0;
  --red: #ff7a6e;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(60, 196, 176, 0.12), transparent 24rem),
    linear-gradient(135deg, #0e1313 0%, #151919 52%, #1b1912 100%);
  color: var(--text);
  font-family: "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(240, 185, 79, 0.55);
  border-radius: 8px;
  background: #231d12;
  color: var(--gold-2);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
}

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

.cart-toggle,
.primary-button,
.product-card button {
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #17120a;
  font-weight: 800;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.cart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
}

.cart-toggle:hover,
.primary-button:hover,
.product-card button:hover {
  transform: translateY(-1px);
  background: var(--gold-2);
}

.cart-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: rgba(23, 18, 10, 0.14);
  font-size: 13px;
}

.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  align-items: start;
}

.storefront,
.checkout-panel {
  min-width: 0;
}

.hero {
  position: relative;
  display: grid;
  min-height: 360px;
  grid-template-columns: minmax(390px, 0.9fr) minmax(240px, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #131818;
  box-shadow: var(--shadow);
}

.hero::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(19, 24, 24, 0.98), rgba(19, 24, 24, 0.78) 42%, rgba(19, 24, 24, 0.06));
  content: "";
  z-index: 1;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: clamp(24px, 5vw, 54px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  max-width: 100%;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

.hero-text {
  max-width: 520px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid rgba(240, 185, 79, 0.24);
  border-radius: 8px;
  background: rgba(16, 20, 20, 0.58);
  color: var(--muted);
}

.hero-stats strong {
  color: var(--gold-2);
  font-size: 18px;
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 34px 2px 16px;
}

.currency-note {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

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

.product-card {
  display: grid;
  min-height: 252px;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-card.featured {
  border-color: rgba(240, 185, 79, 0.72);
  background: linear-gradient(180deg, #202319, var(--surface));
}

.product-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.coin-badge {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(240, 185, 79, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, #ffe3a3 0 18%, #f1b743 34%, #9c6a1f 100%);
  color: #37220c;
  font-weight: 900;
}

.tag {
  display: inline-flex;
  max-width: 120px;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(60, 196, 176, 0.13);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.product-name {
  margin: 0 0 10px;
  font-size: 20px;
}

.coin-amount {
  margin: 0 0 8px;
  color: var(--gold-2);
  font-size: 28px;
  font-weight: 900;
}

.product-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.product-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price {
  font-size: 18px;
  font-weight: 900;
}

.product-card button {
  min-height: 42px;
  padding: 0 14px;
}

.checkout-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 29, 29, 0.96);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 6px;
}

.icon-button {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.cart-items {
  display: grid;
  gap: 10px;
  padding: 12px 20px;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.cart-item h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.quantity-controls {
  display: grid;
  grid-template-columns: 30px 32px 30px;
  align-items: center;
  overflow: hidden;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quantity-controls button {
  height: 32px;
  border: 0;
  background: #151b1b;
  color: var(--text);
  font-weight: 900;
}

.quantity-controls span {
  text-align: center;
  font-weight: 800;
}

.remove-button {
  grid-column: 2;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.cart-empty {
  display: grid;
  margin: 12px 20px;
  min-height: 94px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.summary {
  display: grid;
  gap: 12px;
  margin: 10px 20px 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
}

.summary strong {
  color: var(--text);
}

.summary-total {
  align-items: baseline;
  font-size: 18px;
}

.summary-total strong {
  color: var(--gold-2);
  font-size: 24px;
}

.checkout-form {
  display: grid;
  gap: 12px;
  padding: 0 20px 20px;
}

.checkout-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.checkout-form input,
.checkout-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111616;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.checkout-form input:focus,
.checkout-form select:focus {
  border-color: var(--teal);
}

.primary-button {
  min-height: 48px;
  margin-top: 4px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 16px;
  border: 1px solid rgba(240, 185, 79, 0.42);
  border-radius: 8px;
  background: #1c211d;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.backdrop {
  display: none;
}

@media (max-width: 1120px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .checkout-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    width: min(420px, 100%);
    max-height: none;
    border-radius: 8px 0 0 8px;
    transform: translateX(105%);
    transition: transform 220ms ease;
  }

  .checkout-panel.open {
    transform: translateX(0);
  }

  .icon-button {
    display: grid;
    place-items: center;
  }

  .backdrop {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: block;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    padding-bottom: 14px;
  }

  .cart-toggle span:not(.cart-icon) {
    display: none;
  }

  .hero {
    min-height: 520px;
    grid-template-columns: 1fr;
    align-items: end;
  }

  .hero::before {
    background: linear-gradient(0deg, rgba(19, 24, 24, 0.99) 0%, rgba(19, 24, 24, 0.86) 48%, rgba(19, 24, 24, 0.08) 100%);
  }

  .hero-copy {
    padding: 28px;
  }

  .hero-text {
    font-size: 16px;
  }

  h1 {
    font-size: clamp(38px, 11vw, 60px);
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

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

@media (max-width: 480px) {
  .brand strong {
    font-size: 16px;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: 470px;
  }

  .hero-copy {
    padding: 22px;
  }

  .hero-stats {
    flex-direction: column;
  }

  .product-action {
    align-items: stretch;
    flex-direction: column;
  }

  .product-card button {
    width: 100%;
  }
}
