:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-soft: #f2efe8;
  --ink: #333333;
  --muted: #77736b;
  --line: #e6e1d7;
  --accent: #c9934b;
  --accent-strong: #a7652a;
  --green: #6f8d6a;
  --red: #d75945;
  --blue: #4d6e8f;
  --shadow: 0 18px 50px rgb(61 48 33 / 0.12);
  --radius: 8px;
  --topbar: 72px;
  color-scheme: light;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(460px, 1fr) 390px;
  grid-template-rows: var(--topbar) calc(100vh - var(--topbar));
  min-height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 268px auto minmax(320px, 720px) 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgb(250 250 247 / 0.92);
  backdrop-filter: blur(14px);
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: #1f1f1f;
  color: #fff7e7;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 18px;
  line-height: 1.2;
}

.brand-copy small,
.rail-heading span,
.drawer-heading span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 260px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.game-entry-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #2f2a21;
  border-radius: 999px;
  background: #1f1f1f;
  color: #fff7e7;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgb(31 31 31 / 0.14);
}

.game-entry-button svg {
  width: 18px;
  height: 18px;
}

.search-box svg {
  width: 18px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.icon-button,
.round-button,
.action-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.icon-button:hover,
.round-button:hover,
.action-button:hover {
  background: var(--surface-soft);
}

.menu-button {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.menu-button svg {
  width: 22px;
  height: 22px;
}

.menu-button span {
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.product-toggle {
  justify-self: end;
}

.sidebar {
  overflow: auto;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
}

.category-nav {
  display: grid;
  gap: 8px;
}

.category-group {
  display: grid;
  gap: 6px;
}

.category-button {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.category-button:hover,
.category-button.is-active {
  background: var(--surface-soft);
}

.category-button svg {
  width: 22px;
  height: 22px;
}

.category-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.category-video-list {
  display: grid;
  gap: 4px;
  padding: 0 8px 8px 48px;
}

.category-video-button {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 0 10px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.category-video-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.category-video-button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 30px;
}

.sidebar-info {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding: 14px 12px 4px 48px;
  border-top: 1px solid var(--line);
}

.sidebar-info a {
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-info a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.static-fallback {
  width: min(880px, calc(100% - 32px));
  margin: 48px auto;
  line-height: 1.75;
}

.static-fallback h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 5vw, 44px);
}

.static-fallback a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.mobile-category-strip {
  display: none;
}

.feed-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(330px, 580px) 76px;
  justify-content: center;
  height: 100%;
  gap: 18px;
  padding: 16px 12px;
}

.video-feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.video-feed::-webkit-scrollbar,
.product-rail::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.comment-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.video-slide {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 68px;
  align-items: center;
  gap: 16px;
  height: calc(100vh - var(--topbar) - 32px);
  min-height: 620px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.video-card {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 9 / 16;
  justify-self: end;
  overflow: hidden;
  border-radius: var(--radius);
  background: #080808;
  box-shadow: var(--shadow);
}

.video-card.is-horizontal::before {
  position: absolute;
  inset: -18px;
  content: "";
  background-image: var(--poster);
  background-position: center;
  background-size: cover;
  filter: blur(18px);
  opacity: 0.42;
  transform: scale(1.08);
}

.video-card.is-horizontal {
  aspect-ratio: 9 / 16;
}

.video-card video,
.video-card .video-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-card.is-horizontal video,
.video-card.is-horizontal .video-poster {
  position: relative;
  z-index: 1;
  object-fit: contain;
}

.video-gradient {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, rgb(0 0 0 / 0.84), transparent);
  pointer-events: none;
}

.video-meta {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  color: #fff;
  text-shadow: 0 1px 18px rgb(0 0 0 / 0.6);
}

.video-meta h2 {
  margin: 8px 0 6px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.3;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.video-meta p {
  margin: 0;
  color: rgb(255 255 255 / 0.76);
  font-size: 14px;
  line-height: 1.5;
}

.is-product-video .video-meta h2 {
  max-width: 92%;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.38;
}

.is-product-video .video-meta p {
  max-width: 92%;
  font-size: 13px;
  line-height: 1.55;
}

.video-product-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(92%, 340px);
  min-height: 40px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 999px;
  background: rgb(255 247 231 / 0.92);
  color: #1f1f1f;
  text-decoration: none;
  text-shadow: none;
  box-shadow: 0 12px 26px rgb(0 0 0 / 0.28);
}

.video-product-cta span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.video-product-cta strong {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.video-product-cta svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.product-peek {
  position: absolute;
  top: 16px;
  right: 16px;
  display: none;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 8px 10px;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.42);
  color: #fff;
  backdrop-filter: blur(10px);
}

.product-peek.is-visible {
  display: inline-flex;
  animation: peekPulse 1.8s ease both;
}

.product-peek img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.product-peek .peek-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
}

.product-peek .peek-icon svg {
  width: 18px;
  height: 18px;
}

.creator-peek {
  background: rgb(17 17 17 / 0.58);
}

.product-peek span {
  overflow: hidden;
  max-width: 190px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.next-cue {
  position: absolute;
  right: 16px;
  bottom: 172px;
  z-index: 7;
  display: none;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 32px);
  padding: 7px 10px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.48);
  color: #fff7e7;
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 900;
}

.next-cue.is-visible {
  display: inline-flex;
  animation: cueFloat 2.6s ease both;
}

.next-cue svg {
  width: 16px;
  height: 16px;
}

@keyframes cueFloat {
  0%,
  100% {
    opacity: 0;
    transform: translateY(6px);
  }
  18%,
  72% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes peekPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-4px);
  }
}

.play-button {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.18);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.play-button svg {
  width: 22px;
  height: 22px;
}

.action-stack {
  display: grid;
  position: relative;
  z-index: 6;
  gap: 14px;
  align-self: center;
  justify-items: center;
}

.action-button {
  width: 54px;
  min-height: 70px;
  align-content: center;
  gap: 6px;
  padding: 0;
  border-radius: 999px;
}

.action-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
}

.action-button svg {
  width: 24px;
  height: 24px;
}

.action-button span {
  font-size: 12px;
  color: var(--muted);
}

.action-button.is-liked .action-icon {
  background: #ffe6df;
  color: var(--red);
}

.feed-controls {
  display: grid;
  align-content: center;
  gap: 12px;
}

.round-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(61 48 33 / 0.08);
}

.product-rail {
  overflow-y: auto;
  padding: 28px 28px 48px 10px;
  border-left: 1px solid var(--line);
}

.rail-heading {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 8px 0 14px;
  background: var(--bg);
}

.rail-heading strong,
.sheet-heading strong,
.drawer-heading strong {
  display: block;
  font-size: 18px;
  line-height: 1.3;
}

.product-list,
.mobile-product-list {
  display: grid;
  gap: 14px;
}

.product-section {
  display: grid;
  gap: 10px;
}

.product-section + .product-section {
  padding-top: 4px;
}

.product-section-heading {
  display: grid;
  gap: 2px;
  padding: 2px 2px 0;
}

.product-section-heading strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.product-section-heading span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.product-section-list {
  display: grid;
  gap: 12px;
}

.product-card {
  position: relative;
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 12px;
  min-height: 130px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgb(61 48 33 / 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.product-card:hover,
.product-card.is-active {
  transform: translateY(-2px);
  border-color: rgb(201 147 75 / 0.6);
  box-shadow: 0 14px 30px rgb(61 48 33 / 0.12);
}

.product-card img {
  width: 116px;
  height: 116px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-soft);
}

.product-info {
  display: grid;
  align-content: space-between;
  min-width: 0;
}

.product-name {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.product-tag {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
}

.product-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  margin-top: 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #1f1f1f;
  color: #fff7e7;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgb(0 0 0 / 0.18);
}

.product-card[data-rank="1"] .rank-badge {
  background: var(--red);
  color: #fff;
}

.product-card[data-rank="2"] .rank-badge {
  background: var(--accent-strong);
}

.product-card[data-rank="3"] .rank-badge {
  background: var(--green);
}

.mobile-shop-button,
.bottom-sheet,
.comment-drawer,
.entry-gate,
.toast {
  position: fixed;
  z-index: 50;
}

.bottom-sheet {
  z-index: 120;
}

.comment-drawer {
  z-index: 130;
}

.entry-gate {
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgb(203 76 55 / 0.34), transparent 23%),
    radial-gradient(circle at 50% 52%, rgb(0 0 0 / 0.82), rgb(31 31 31 / 0.5));
  backdrop-filter: blur(10px);
}

.entry-gate::before {
  position: absolute;
  inset: -20%;
  content: "";
  background:
    linear-gradient(110deg, transparent 0 42%, rgb(255 255 255 / 0.36) 48%, transparent 54%),
    repeating-linear-gradient(0deg, transparent 0 11px, rgb(255 255 255 / 0.05) 12px 13px);
  animation: entrySweep 2.8s ease-in-out infinite;
  pointer-events: none;
}

.entry-gate.is-hidden {
  display: none;
}

.entry-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  padding: 30px 26px 24px;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.98), rgb(255 244 223 / 0.96)),
    var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: entryImpact 780ms cubic-bezier(.17,.84,.34,1.35) both, entryHeartbeat 2.4s ease-in-out 1s infinite;
}

.entry-card strong {
  font-size: 22px;
  line-height: 1.3;
}

.entry-card small {
  color: var(--muted);
  font-size: 14px;
}

.entry-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff7e7;
  font-weight: 900;
  box-shadow: 0 0 0 0 rgb(203 76 55 / 0.42);
  animation: entryPulse 1.6s ease infinite;
}

.entry-primary,
.entry-close,
.entry-secondary {
  min-height: 42px;
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.entry-primary {
  width: 100%;
  margin-top: 8px;
  border-radius: 999px;
  background: #1f1f1f;
  color: #fff7e7;
  box-shadow: 0 12px 28px rgb(31 31 31 / 0.18);
}

.entry-primary:hover {
  transform: translateY(-2px) scale(1.02);
}

.entry-close {
  position: absolute;
  top: -14px;
  right: -14px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  box-shadow: 0 12px 26px rgb(203 76 55 / 0.28);
}

.entry-close svg {
  width: 20px;
  height: 20px;
}

.entry-secondary {
  display: inline-grid;
  place-items: center;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  text-decoration: none;
}

.entry-secondary:hover {
  transform: translateY(-1px);
  background: #fff2df;
}

@keyframes entryImpact {
  0% {
    transform: scale(0.35) rotate(-6deg);
    filter: brightness(2.2);
    opacity: 0;
  }
  55% {
    transform: scale(1.12) rotate(1deg);
    filter: brightness(1.22);
    opacity: 1;
  }
  72% {
    transform: scale(0.96) rotate(-1deg);
  }
  100% {
    transform: scale(1) rotate(0);
    filter: brightness(1);
  }
}

@keyframes entryHeartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  8% {
    transform: scale(1.025);
  }
  14% {
    transform: scale(0.995);
  }
}

@keyframes entryPulse {
  0% {
    box-shadow: 0 0 0 0 rgb(203 76 55 / 0.42);
  }
  70% {
    box-shadow: 0 0 0 18px rgb(203 76 55 / 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(203 76 55 / 0);
  }
}

@keyframes entrySweep {
  0% {
    transform: translateX(-36%) rotate(0deg);
    opacity: 0.2;
  }
  45% {
    opacity: 0.85;
  }
  100% {
    transform: translateX(36%) rotate(0deg);
    opacity: 0.25;
  }
}

.mobile-shop-button {
  right: 16px;
  bottom: 18px;
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #1f1f1f;
  color: #fff7e7;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.mobile-shop-button.is-nudged {
  animation: shopNudge 1.8s ease both;
}

.mobile-shop-button.has-product {
  background: var(--accent-strong);
}

.mobile-action-rail {
  position: fixed;
  right: 12px;
  top: 50%;
  z-index: 90;
  display: grid;
  visibility: hidden;
  opacity: 0;
  gap: 10px;
  transform: translateY(-44%);
  pointer-events: none;
}

.mobile-action-button {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 54px;
  min-height: 64px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff7e7;
  cursor: pointer;
  text-shadow: 0 2px 10px rgb(0 0 0 / 0.58);
}

.mobile-action-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 50%;
  background: rgb(0 0 0 / 0.34);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.28);
}

.mobile-action-button svg {
  width: 24px;
  height: 24px;
}

.mobile-action-button span:last-child {
  color: rgb(255 247 231 / 0.92);
  font-size: 12px;
  font-weight: 900;
}

.mobile-action-button.is-liked .mobile-action-icon {
  background: rgb(215 89 69 / 0.76);
}

.audio-prompt {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 14;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgb(31 31 31 / 0.92);
  color: #fff7e7;
  font-weight: 800;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.swipe-hint {
  position: absolute;
  top: 48%;
  left: 50%;
  z-index: 45;
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgb(31 31 31 / 0.74);
  color: #fff7e7;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(12px);
  font-weight: 900;
  pointer-events: none;
}

.swipe-hint.is-visible {
  display: inline-flex;
  animation: swipeHintFloat 3.6s ease both;
}

.swipe-hint svg {
  width: 19px;
  height: 19px;
}

@keyframes swipeHintFloat {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 12px));
  }
  18%,
  76% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.audio-prompt svg {
  width: 18px;
  height: 18px;
}

.audio-prompt.is-hidden {
  display: none;
}

.mobile-video-menu {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: none;
}

.mobile-video-menu.is-open {
  display: block;
}

.mobile-video-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.56);
  backdrop-filter: blur(4px);
}

.mobile-video-menu-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(390px, 88vw);
  max-width: 100vw;
  padding: 16px;
  background: #111;
  color: #fff7e7;
  box-shadow: 18px 0 48px rgb(0 0 0 / 0.34);
}

.mobile-video-menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgb(255 255 255 / 0.12);
}

.mobile-video-menu-heading strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.mobile-video-menu-heading span {
  color: rgb(255 247 231 / 0.62);
  font-size: 13px;
}

.mobile-video-menu-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-top: 14px;
}

.mobile-video-group {
  display: grid;
  gap: 6px;
}

.mobile-video-category,
.mobile-video-item {
  width: 100%;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.mobile-video-category {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.08);
}

.mobile-video-category.is-active {
  background: #fff7e7;
  color: #1f1f1f;
}

.mobile-video-category svg {
  width: 22px;
  height: 22px;
}

.mobile-video-category span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.mobile-video-category small {
  color: currentColor;
  font-size: 12px;
  opacity: 0.74;
}

.mobile-video-items {
  display: grid;
  gap: 5px;
  padding: 0 0 8px 34px;
}

.mobile-video-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.05);
}

.mobile-video-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.mobile-video-item small {
  color: rgb(255 247 231 / 0.58);
  font-size: 12px;
}

@keyframes shopNudge {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-8px) scale(1.06);
    background: var(--accent-strong);
  }
  70% {
    transform: translateY(0) scale(1.02);
  }
}

.bottom-sheet,
.comment-drawer {
  inset: 0;
  display: none;
  background: rgb(31 31 31 / 0.34);
}

.bottom-sheet.is-open,
.comment-drawer.is-open {
  display: block;
}

.sheet-panel,
.drawer-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 78vh;
  overflow: auto;
  padding: 10px 16px 18px;
  border-radius: 16px 16px 0 0;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.drawer-panel {
  left: auto;
  width: min(420px, 100%);
  height: 100vh;
  max-height: none;
  border-radius: 0;
  padding: 22px;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 4px auto 12px;
  border-radius: 999px;
  background: #d2cabd;
}

.sheet-heading,
.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.comment-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 160px;
  max-height: calc(100vh - 160px);
  overflow: auto;
}

.comment-item {
  position: relative;
  padding: 12px 12px 12px 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.5;
}

.comment-item::before {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #1f1f1f;
  color: #fff7e7;
  font-size: 11px;
  font-weight: 900;
  content: "3A";
}

.comment-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.comment-form input {
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  outline: 0;
}

.primary-button {
  min-width: 72px;
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent-strong);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.toast {
  left: 50%;
  bottom: 24px;
  display: none;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #1f1f1f;
  color: #fff7e7;
  transform: translateX(-50%);
  box-shadow: var(--shadow);
  font-size: 14px;
}

.toast.is-visible {
  display: block;
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 220px minmax(420px, 1fr) 330px;
  }

  .topbar {
    grid-template-columns: 220px auto minmax(280px, 620px) 1fr;
    padding-inline: 18px;
  }

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

  .product-card img {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 1024px) {
  body {
    overflow: hidden;
    background: #111;
  }

  .app-shell {
    display: block;
    width: 100vw;
    max-width: 100vw;
    min-height: 100dvh;
    padding-top: 62px;
    overflow: hidden;
  }

  .topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 160;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 12px;
    height: 62px;
    width: 100vw;
    max-width: 100vw;
    padding: 8px 12px;
    border-bottom-color: rgb(255 255 255 / 0.08);
    background: rgb(17 17 17 / 0.9);
    color: #fff7e7;
    transform: translateZ(0);
  }

  .menu-button {
    display: inline-flex;
    background: #fff7e7;
    color: #1f1f1f;
    box-shadow: 0 10px 26px rgb(0 0 0 / 0.22);
  }

  .menu-button:active {
    transform: translateY(1px);
  }

  .menu-button:focus:not(:focus-visible) {
    outline: 0;
  }

  .brand-copy small,
  .search-box,
  .sidebar,
  .product-rail,
  .feed-controls {
    display: none;
  }

  .game-entry-button {
    min-height: 42px;
    padding: 0 12px;
    border-color: rgb(255 247 231 / 0.18);
    background: #f6c45f;
    color: #19140b;
    box-shadow: 0 10px 24px rgb(0 0 0 / 0.28);
  }

  .game-entry-button span {
    font-size: 0;
  }

  .game-entry-button span::after {
    content: "遊戲";
    font-size: 14px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    background: #fff7e7;
    color: #1f1f1f;
  }

  .stage {
    height: calc(100dvh - 62px);
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
    background: #111;
  }

  .mobile-category-strip {
    display: none;
  }

  .mobile-category-strip::-webkit-scrollbar {
    display: none;
  }

  .mobile-category-strip button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 999px;
    background: rgb(0 0 0 / 0.35);
    color: #fff7e7;
    backdrop-filter: blur(10px);
  }

  .mobile-category-strip button.is-active {
    background: #fff7e7;
    color: #1f1f1f;
  }

  .feed-layout {
    display: block;
    height: 100%;
    width: 100vw;
    max-width: 100vw;
    padding: 0;
  }

  .video-feed,
  .video-slide {
    width: 100vw;
    max-width: 100vw;
  }

  .video-feed {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .video-slide {
    position: relative;
    display: block;
    height: calc(100dvh - 62px);
    min-height: 0;
    padding-top: 0;
    overflow: hidden;
  }

  .video-card {
    width: 100%;
    height: calc(100dvh - 62px);
    aspect-ratio: auto;
    border-radius: 0;
    justify-self: stretch;
    box-shadow: none;
  }

  .video-card video,
  .video-card .video-poster {
    object-fit: cover;
  }

  .video-card.is-horizontal video,
  .video-card.is-horizontal .video-poster {
    object-fit: contain;
  }

  .video-meta {
    right: 74px;
    bottom: 96px;
    left: 16px;
  }

  .video-product-cta {
    max-width: calc(100vw - 112px);
    min-height: 38px;
    margin-top: 10px;
    padding: 7px 10px;
  }

  .video-product-cta strong {
    font-size: 12px;
  }

  .product-peek {
    top: 14px;
    right: 12px;
  }

  .action-stack {
    display: none;
  }

  .mobile-action-rail {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-shop-button {
    display: inline-flex;
    right: 16px;
    bottom: 20px;
    left: auto;
    justify-content: center;
    min-width: 118px;
    max-width: calc(100vw - 32px);
    z-index: 60;
  }

  .audio-prompt {
    top: 12px;
    bottom: auto;
    left: 14px;
    z-index: 54;
    background: rgb(31 31 31 / 0.72);
    backdrop-filter: blur(12px);
  }

  .comment-drawer {
    z-index: 170;
    background: rgb(0 0 0 / 0.5);
    backdrop-filter: blur(3px);
  }

  .comment-drawer .drawer-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-rows: 14px auto minmax(0, 1fr) auto;
    width: 100%;
    height: min(78dvh, calc(100dvh - 70px));
    max-height: none;
    overflow: hidden;
    padding: 8px 14px calc(12px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    background: #fafaf7;
  }

  .comment-drawer .drawer-panel::before {
    justify-self: center;
    width: 42px;
    height: 4px;
    margin: 2px 0 8px;
    border-radius: 999px;
    background: #d2cabd;
    content: "";
  }

  .drawer-heading {
    align-items: center;
    margin-bottom: 8px;
  }

  .drawer-heading > div {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .drawer-heading strong {
    font-size: 17px;
    line-height: 1.2;
  }

  #commentVideoTitle {
    display: block;
    overflow: hidden;
    max-width: calc(100vw - 92px);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .comment-list {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: 2px 1px 10px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .comment-item {
    border-radius: 14px;
  }

  .comment-form {
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 8px;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .comment-form input {
    height: 42px;
    border-radius: 999px;
    font-size: 16px;
  }

  .comment-form .primary-button {
    min-width: 64px;
    height: 42px;
    border-radius: 999px;
  }

  .next-cue {
    right: 12px;
    bottom: 332px;
  }

  .mobile-product-list .product-card {
    grid-template-columns: 96px 1fr;
  }

  .mobile-product-list .product-card img {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 520px) {
  .brand-copy strong {
    font-size: 15px;
  }

  .video-meta h2 {
    font-size: 18px;
  }

  .video-meta p {
    font-size: 13px;
  }

  .action-button {
    width: 52px;
  }

  .action-icon {
    width: 46px;
    height: 46px;
  }

  .sheet-panel {
    max-height: 82vh;
  }
}

@media (min-width: 1025px) {
  .mobile-action-rail {
    display: none;
  }
}

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