:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --ink: #17191d;
  --muted: #626a73;
  --line: #dde1e6;
  --gold: #ffd45a;
  --coral: #ff6b5f;
  --teal: #17bebb;
  --night: #111316;
  --shadow: 0 18px 50px rgba(17, 19, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 10px clamp(18px, 4vw, 56px);
  background: rgba(246, 247, 248, 0.92);
  border-bottom: 1px solid rgba(221, 225, 230, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 136px;
  height: auto;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.main-nav a,
.header-action {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.main-nav a:hover,
.header-action:hover {
  background: #e9eef1;
  color: var(--ink);
}

.header-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 190px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.header-action {
  background: var(--night);
  color: #fff;
}

.header-action:hover {
  background: #2b2f34;
  color: #fff;
}

.hero {
  position: relative;
  min-height: calc(100svh - 128px);
  display: flex;
  align-items: center;
  background-image:
    linear-gradient(90deg, rgba(17, 19, 22, 0.92) 0%, rgba(17, 19, 22, 0.72) 42%, rgba(17, 19, 22, 0.18) 100%),
    url("assets/yuma-hero.png");
  background-position: center;
  background-size: cover;
  color: #fff;
}

.hero-inner {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 630px) auto;
  align-items: end;
  gap: 28px;
  padding: 64px 0;
}

.hero-copy {
  max-width: 620px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: 64px;
  line-height: 1;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 580px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--gold);
  color: var(--night);
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.button.product-button {
  width: 100%;
  margin-top: auto;
  background: var(--night);
  color: #fff;
}

.button.product-button:hover {
  background: #30343a;
}

.full-width {
  width: 100%;
}

.hero-wallet {
  justify-self: end;
  width: min(260px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(17, 19, 22, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.wallet-label,
.wallet-unit {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.hero-wallet strong {
  display: block;
  margin: 8px 0 0;
  color: var(--gold);
  font-size: 52px;
  line-height: 1;
}

.section {
  padding: 76px 0;
}

.section-inner {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.intro-band {
  padding: 32px 0;
  background: var(--night);
  color: #fff;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.intro-grid h2,
.section-heading h2,
.member-copy h2,
.company-layout h2,
.game-panel h3 {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.intro-grid p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-copy {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

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

.companion-card,
.product-card,
.service-card,
.host-card,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.companion-card {
  overflow: hidden;
}

.companion-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.card-body {
  padding: 18px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.card-title-row h3,
.product-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.card-title-row span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f7f6;
  color: #047d7a;
  font-size: 12px;
  font-weight: 900;
}

.card-body p,
.product-card p,
.service-card p,
.host-card p,
.member-copy p,
.shop-note {
  color: var(--muted);
}

.host-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 12px;
}

.host-card {
  overflow: hidden;
}

.host-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

.host-body {
  padding: 10px;
}

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

.host-top h3 {
  min-width: 0;
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.host-top span {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #e7f7f6;
  color: #047d7a;
  font-size: 10px;
  font-weight: 1000;
}

.host-card p {
  min-height: 38px;
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
}

.host-card .ghost-button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.service-section {
  background: var(--surface);
}

.service-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.service-card {
  min-height: 235px;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.service-code {
  width: fit-content;
  margin-bottom: 24px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e7f7f6;
  color: #047d7a;
  font-size: 12px;
  font-weight: 1000;
}

.service-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.service-card p {
  margin: 0;
}

.game-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.38fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 28px;
  padding: 26px;
  border-radius: 8px;
  background: var(--night);
  color: #fff;
}

.game-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-list span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 850;
}

.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.shop-section {
  background: #eef5f5;
}

.physical-section {
  background: var(--surface);
}

.product-card {
  position: relative;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.product-card.featured {
  border-color: rgba(255, 107, 95, 0.45);
  box-shadow: 0 24px 70px rgba(255, 107, 95, 0.18);
}

.ribbon {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.star-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--night);
  font-size: 25px;
  font-weight: 1000;
  box-shadow: inset 0 -8px 0 rgba(17, 19, 22, 0.1);
}

.star-mark::before {
  content: "★";
  margin-right: 3px;
  font-size: 17px;
}

.price {
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: 32px;
  font-weight: 1000;
}

.shop-note {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: 14px;
}

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

.physical-product-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.physical-product-image {
  display: block;
  background: #f5f7f7;
}

.physical-product-image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  transition: transform 180ms ease;
}

.physical-product-card:hover .physical-product-image img {
  transform: scale(1.025);
}

.physical-product-body {
  display: grid;
  gap: 10px;
  flex: 1;
  padding: 18px;
}

.physical-product-body h3 {
  min-height: 54px;
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.physical-price {
  margin: 0;
  color: var(--coral);
  font-size: 25px;
  line-height: 1.1;
  font-weight: 1000;
}

.add-cart-button {
  width: 100%;
  margin-top: auto;
  background: var(--night);
  color: #fff;
}

.add-cart-button:hover {
  background: #30343a;
}

.cart-panel {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  box-shadow: var(--shadow);
}

.cart-header,
.cart-total,
.cart-quantity {
  display: flex;
  align-items: center;
}

.cart-header {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.cart-header h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.cart-header .section-kicker {
  margin-bottom: 6px;
}

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

.cart-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid #e1e6ea;
  border-radius: 8px;
  background: #fff;
}

.cart-row img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #f5f7f7;
  object-fit: contain;
}

.cart-detail {
  min-width: 0;
  flex: 1;
}

.cart-detail h4 {
  margin: 0 0 5px;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.cart-detail p {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.cart-quantity {
  gap: 8px;
}

.quantity-button,
.remove-cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 1000;
}

.quantity-button:hover,
.remove-cart-button:hover {
  background: #edf2f4;
}

.cart-quantity span {
  min-width: 28px;
  text-align: center;
  font-weight: 1000;
}

.remove-cart-button {
  min-width: 64px;
  color: #be3a31;
}

.cart-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 850;
}

.cart-panel.has-items .cart-empty {
  display: none;
}

.cart-total {
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-weight: 1000;
}

.cart-total strong {
  color: var(--coral);
  font-size: 28px;
}

.cart-panel #checkoutButton {
  margin-top: 16px;
}

.cart-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.member-section {
  background: var(--surface);
}

.member-layout,
.company-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 44px;
  align-items: start;
}

.member-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  width: min(360px, 100%);
  margin-top: 24px;
  padding: 18px;
  border-left: 5px solid var(--teal);
  background: #f0fbfa;
}

.member-summary span {
  color: var(--muted);
  font-weight: 800;
}

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

.auth-panel {
  padding: 22px;
}

.tab-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: #eceff3;
}

.tab-button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
}

.tab-button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(17, 19, 22, 0.08);
}

.auth-form {
  display: none;
  margin-top: 20px;
}

.auth-form.active {
  display: grid;
  gap: 9px;
}

.auth-form label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 0 13px;
  border: 1px solid #cfd6dd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.auth-form input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(23, 190, 187, 0.18);
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.auth-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.auth-message.success {
  color: #087f5b;
}

.auth-message.error {
  color: #be3a31;
}

.company-section {
  background: var(--night);
  color: #fff;
}

.company-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.company-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.company-list dt {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 900;
}

.company-list dd {
  margin: 0;
  color: #fff;
  font-weight: 800;
}

.company-list a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer {
  background: #07080a;
  color: rgba(255, 255, 255, 0.72);
}

.footer-inner {
  width: min(1120px, calc(100% - 36px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: min(360px, calc(100% - 40px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--night);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  font-weight: 900;
}

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

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .header-account {
    grid-column: 2;
    grid-row: 1;
    min-width: auto;
  }

  .hero {
    min-height: calc(100svh - 150px);
    background-position: 58% center;
  }

  .hero-inner,
  .intro-grid,
  .game-panel,
  .member-layout,
  .company-layout {
    grid-template-columns: 1fr;
  }

  .hero-wallet {
    justify-self: start;
  }

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

  .physical-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header {
    gap: 10px;
    padding: 8px 14px;
  }

  .brand img {
    width: 116px;
  }

  .header-account {
    font-size: 12px;
  }

  .header-account span {
    display: none;
  }

  .main-nav {
    gap: 4px;
  }

  .main-nav a,
  .header-action {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .hero {
    min-height: calc(100svh - 220px);
  }

  .hero-inner {
    width: min(100% - 28px, 1120px);
    padding: 42px 0;
  }

  .hero h1 {
    font-size: 48px;
  }

  .hero-lead {
    font-size: 17px;
    overflow-wrap: anywhere;
  }

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

  .button {
    width: 100%;
  }

  .section {
    padding: 54px 0;
  }

  .intro-band {
    padding: 28px 0;
  }

  .intro-grid h2,
  .section-heading h2,
  .member-copy h2,
  .company-layout h2,
  .game-panel h3 {
    font-size: 28px;
  }

  .section-heading {
    display: block;
  }

  .product-card {
    min-height: 320px;
  }

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

  .physical-product-body h3 {
    min-height: auto;
  }

  .cart-panel {
    padding: 18px;
  }

  .cart-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .cart-row img {
    width: 64px;
    height: 64px;
  }

  .cart-quantity,
  .remove-cart-button {
    grid-column: 2;
    justify-self: start;
  }

  .service-card {
    min-height: auto;
  }

  .game-panel {
    padding: 22px;
  }

  .company-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 0;
  }
}
