:root {
  --paper: #f7f1e5;
  --paper-deep: #eee3d1;
  --surface: rgba(255, 253, 247, 0.9);
  --ink: #23201c;
  --muted: #756d62;
  --gold: #b88a3b;
  --gold-deep: #8d6526;
  --line: rgba(47, 39, 29, 0.16);
  --shadow: 0 26px 70px rgba(54, 41, 25, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 3%, rgba(184, 138, 59, 0.17), transparent 34rem),
    radial-gradient(circle at 96% 22%, rgba(71, 61, 47, 0.1), transparent 28rem),
    linear-gradient(150deg, #fbf7ee 0%, var(--paper) 48%, #f1e7d8 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M0 79.5h80M79.5 0v80' stroke='%235c4d37' stroke-opacity='.055'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 42px;
}

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

.brand-logo {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(54, 41, 25, 0.1);
}

.brand-name {
  display: grid;
  gap: 1px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.brand-name small {
  color: var(--muted);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.24em;
}

.brand-rule {
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: clamp(26px, 5vw, 70px);
}

.content-column {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 28px;
  height: 1px;
  background: currentColor;
  content: "";
}

.content-title,
.home-title {
  max-width: 15em;
  margin: 0;
  font-family: Georgia, "Noto Serif TC", "Times New Roman", serif;
  font-size: clamp(38px, 6.3vw, 76px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.03;
  overflow-wrap: anywhere;
}

.content-description,
.home-intro {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.content-stage {
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.content-stage-inner {
  padding: clamp(18px, 4vw, 38px);
}

.media-frame {
  display: flex;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ebe4d7;
}

.media-frame img {
  display: block;
  width: 100%;
  max-height: 640px;
  object-fit: contain;
}

.card-frame {
  max-width: 470px;
  margin: 0 auto;
  background: #ded4c4;
}

.deck-cover {
  position: relative;
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper-deep);
  box-shadow: 0 18px 46px rgba(54, 41, 25, 0.16);
}

.deck-cover-count-0 {
  aspect-ratio: 0.72;
}

.deck-cover-ratio-probe {
  display: block;
  visibility: hidden;
  width: 100%;
  height: auto;
}

.deck-cover-grid {
  position: absolute;
  inset: 0;
  display: grid;
}

.deck-cover-slot {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #ded4c4;
}

.deck-cover-slot img {
  display: block;
  width: 100%;
  height: 100%;
}

.deck-cover-count-1 .deck-cover-slot img {
  object-fit: contain;
}

.deck-cover-count-2 .deck-cover-grid,
.deck-cover-count-4 .deck-cover-grid {
  gap: 1px;
  background: var(--line);
}

.deck-cover-count-2 .deck-cover-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.deck-cover-count-2 .deck-cover-slot img,
.deck-cover-count-3 .deck-cover-slot img,
.deck-cover-count-4 .deck-cover-slot img {
  object-fit: cover;
}

.deck-cover-count-3 .deck-cover-slot-1 {
  position: absolute;
  inset: 0;
}

.deck-cover-count-3 .deck-cover-slot-2,
.deck-cover-count-3 .deck-cover-slot-3 {
  position: absolute;
  bottom: 0;
  z-index: 1;
  width: 50%;
  height: 50%;
  border-top: 1px solid var(--line);
}

.deck-cover-count-3 .deck-cover-slot-2 {
  left: 0;
  border-right: 1px solid var(--line);
}

.deck-cover-count-3 .deck-cover-slot-3 {
  right: 0;
}

.deck-cover-count-4 .deck-cover-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.deck-cover-empty {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  color: var(--ink);
  text-align: left;
}

.deck-cover-empty img {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  object-fit: contain;
}

.deck-cover-empty strong,
.deck-cover-empty span {
  display: block;
}

.deck-cover-empty strong {
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 18px;
}

.deck-cover-empty span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.thumb-card,
.shop-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.thumb-card img {
  display: block;
  width: 100%;
  aspect-ratio: 0.72;
  background: var(--paper-deep);
  object-fit: contain;
}

.thumb-copy,
.shop-copy {
  padding: 10px 11px 12px;
}

.thumb-title,
.shop-title {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.thumb-subtitle,
.shop-price {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.collection-grid,
.ranking-items,
.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}

.author-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-deep);
  object-fit: cover;
}

.author-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.author-name {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 800;
}

.post-excerpt {
  margin: 0;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-image {
  display: block;
  width: 100%;
  max-height: 520px;
  margin-top: 26px;
  border-radius: 18px;
  background: var(--paper-deep);
  object-fit: cover;
}

.ranking-section + .ranking-section {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.ranking-title {
  margin: 0 0 14px;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 22px;
}

.shop-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: var(--paper-deep);
  object-fit: cover;
}

.battle-card {
  padding: clamp(28px, 7vw, 76px) clamp(24px, 6vw, 64px);
  text-align: center;
}

.battle-room-name {
  margin: 0;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.battle-owner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 15px;
}

.battle-owner strong {
  color: var(--ink);
}

.empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  padding: 52px 28px;
  text-align: center;
}

.empty-mark {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold-deep);
  font-family: Georgia, serif;
  font-size: 42px;
  line-height: 68px;
}

.empty-state h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 30px;
}

.empty-state p {
  max-width: 28em;
  margin: 12px auto 0;
  color: var(--muted);
  line-height: 1.7;
}

.desktop-app-card {
  position: sticky;
  top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 18px 52px rgba(54, 41, 25, 0.11);
  text-align: center;
  backdrop-filter: blur(18px);
}

.desktop-app-card h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 25px;
}

.desktop-app-card p {
  margin: 9px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.qr-box {
  display: grid;
  width: 188px;
  min-height: 188px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.qr-box img,
.qr-box canvas,
.qr-box svg {
  width: 164px !important;
  height: 164px !important;
}

.button-stack {
  display: grid;
  gap: 9px;
}

.app-button,
.store-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease;
}

.app-button {
  background: var(--ink);
  color: #fff;
}

.store-button {
  border-color: var(--line);
  background: #fffaf0;
}

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

.mobile-smart-banner {
  display: none;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 410px);
  align-items: center;
  gap: clamp(30px, 7vw, 92px);
  min-height: calc(100vh - 170px);
}

.home-title {
  max-width: 9em;
}

.home-art {
  position: relative;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 46% 54% 47% 53% / 56% 39% 61% 44%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(236, 221, 196, 0.74)),
    var(--paper-deep);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.home-art::before,
.home-art::after {
  position: absolute;
  border: 1px solid rgba(141, 101, 38, 0.42);
  content: "";
}

.home-art::before {
  inset: 14% 18%;
  border-radius: 50%;
}

.home-art::after {
  inset: 28% 7%;
  transform: rotate(34deg);
}

.home-monogram {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: clamp(72px, 12vw, 132px);
  font-weight: 700;
  letter-spacing: -0.08em;
  transform: rotate(-2deg);
}

.home-qr-card {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: grid;
  justify-items: center;
  width: 218px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 18px 48px rgba(54, 41, 25, 0.13);
  text-align: center;
  transform: rotate(-2deg);
}

.home-qr-card .qr-box {
  margin-bottom: 10px;
}

.home-qr-card strong,
.home-qr-card span {
  display: block;
}

.home-qr-card strong {
  font-size: 13px;
}

.home-qr-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.noscript-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.is-hidden {
  display: none !important;
}

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

  .desktop-app-card {
    display: none;
  }

  .site-shell.has-smart-banner {
    padding-bottom: 126px;
  }

  .mobile-smart-banner {
    position: fixed;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 20;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto 34px;
    align-items: center;
    gap: 11px;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    background: rgba(35, 32, 28, 0.96);
    color: #fff;
    box-shadow: 0 18px 54px rgba(28, 22, 15, 0.31);
    backdrop-filter: blur(18px);
  }

  .smart-logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: #fff;
  }

  .smart-copy {
    min-width: 0;
  }

  .smart-copy strong,
  .smart-copy span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .smart-copy strong {
    font-size: 13px;
  }

  .smart-copy span {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 11px;
  }

  .smart-action {
    min-height: 38px;
    border-radius: 999px;
    padding: 9px 14px;
    background: var(--gold);
    color: #15120e;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
  }

  .smart-close {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
  }

  .home-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .home-art {
    min-height: 330px;
  }
}

@media (max-width: 620px) {
  .site-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 16px;
  }

  .brand-bar {
    margin-bottom: 30px;
  }

  .brand-rule {
    display: none;
  }

  .content-title,
  .home-title {
    font-size: clamp(36px, 12vw, 54px);
  }

  .content-stage {
    margin-top: 26px;
    border-radius: 22px;
  }

  .collection-grid,
  .ranking-items,
  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-smart-banner {
    grid-template-columns: 42px minmax(0, 1fr) auto 30px;
    gap: 8px;
  }

  .smart-logo {
    width: 42px;
    height: 42px;
  }
}

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