:root {
  --orange: #ff5a09;
  --orange-dark: #e64e00;
  --purple: #7a22ff;
  --ink: #111111;
  --muted: #777777;
  --line: #e8e8e8;
  --soft: #f7f7f5;
  --sidebar: 250px;
  --topbar: 68px;
  --radius: 14px;
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

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

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar);
  padding: 16px 10px 84px;
  background: #fff;
  border-right: 1px solid #efefef;
  overflow-y: auto;
  scrollbar-width: thin;
}

.brand-row,
.topbar,
.account-actions,
.section-heading,
.sidebar-footer button,
.side-group-title,
.mobile-menu-title {
  display: flex;
  align-items: center;
}

.brand-row { justify-content: space-between; padding: 0 8px 12px; }
.brand img { width: 134px; height: 34px; object-fit: contain; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f5f5f5; cursor: pointer; }
.menu-banner { width: 100%; aspect-ratio: 3.25; object-fit: cover; border-radius: 10px; margin-bottom: 16px; }

.side-nav { display: grid; gap: 2px; }
.side-nav a,
.side-nav > button,
.side-group-body a,
.side-group-body button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.side-nav a:hover,
.side-nav button:hover { background: #f5f5f3; }
.side-nav span:first-child { width: 20px; text-align: center; }
.side-group { margin-top: 6px; padding: 4px; background: var(--soft); border-radius: 12px; }
.side-group-title { justify-content: space-between; width: 100%; padding: 8px 6px; border: 0; background: transparent; cursor: pointer; }
.side-group-body { display: grid; }
.side-group:not(.is-open) .side-group-body { display: none; }

.sidebar-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  padding: 8px 10px;
  background: linear-gradient(transparent, #fff 22%);
}
.sidebar-footer button { justify-content: space-between; width: 100%; min-height: 40px; margin-top: 6px; padding: 0 12px; border: 0; border-radius: 10px; background: #efefed; cursor: pointer; }
.sidebar-footer small { margin-left: auto; }
.sidebar-footer i { display: inline-block; width: 8px; height: 8px; margin-left: 5px; border-radius: 50%; background: #19c967; }

.page { margin-left: var(--sidebar); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 25; justify-content: space-between; height: var(--topbar); padding: 10px 28px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.mobile-brand { display: none; }
.search-trigger { display: flex; align-items: center; gap: 10px; width: 260px; padding: 10px 16px; border: 1px solid #e6e6e6; border-radius: 24px; color: #777; background: #f8f8f8; cursor: pointer; }
.search-trigger span:first-child { font-size: 22px; line-height: 1; }
.account-actions { gap: 8px; margin-left: auto; }
.button { min-height: 42px; padding: 0 21px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.button:active { transform: translateY(1px); }
.button-light { border-color: #e6e6e6; background: #fff; }
.button-primary { color: #fff; background: var(--orange); }
.button-primary:hover { background: var(--orange-dark); }

.hero {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(520px, 1fr);
  max-width: 1120px;
  min-height: 570px;
  margin: 0 auto;
  padding: 24px 28px 0;
  overflow: hidden;
}
.hero-copy { z-index: 1; align-self: center; padding-bottom: 48px; }
.hero h1 { max-width: 290px; margin: 0 0 16px; font-size: clamp(34px, 3vw, 46px); line-height: 1.08; font-weight: 540; letter-spacing: -.04em; }
.hero h2 { max-width: 280px; margin: 0 0 18px; font-size: 21px; line-height: 1.35; font-weight: 520; }
.hero ul { margin: 0 0 22px; padding: 0; list-style: none; color: #7d7d7d; font-size: 18px; line-height: 1.55; }
.hero-cta { min-width: 150px; margin-bottom: 12px; }
.hero-speed { margin: 0 0 8px; color: #888; }
.text-link { padding: 0; border: 0; border-bottom: 1px solid currentColor; color: #666; background: transparent; cursor: pointer; font-size: 13px; }
.hero-art { position: relative; align-self: end; min-width: 0; }
.hero-art::after { content: ""; position: absolute; inset: auto 0 0; height: 28%; background: linear-gradient(90deg, rgba(122,34,255,.88), rgba(117,17,255,.45)); border-radius: 120px 0 0 0; pointer-events: none; }
.hero-art img { width: 100%; height: 535px; object-fit: contain; object-position: center bottom; }

.provider-strip { display: flex; align-items: center; gap: 56px; min-height: 74px; padding: 18px 36px; border-top: 1px solid #f1f1f1; border-bottom: 1px solid #f1f1f1; overflow-x: auto; color: #aaa; white-space: nowrap; font-weight: 800; font-size: 20px; scrollbar-width: none; }
.provider-strip::-webkit-scrollbar,
.rail::-webkit-scrollbar { display: none; }

.content-section { max-width: 1180px; margin: 0 auto; padding: 30px 28px; scroll-margin-top: 72px; }
.section-heading { justify-content: space-between; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 21px; }
.section-heading button { border: 0; border-bottom: 1px solid #aaa; color: #6f6f6f; background: none; cursor: pointer; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 152px; gap: 14px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; scrollbar-width: none; padding: 2px 2px 8px; }
.rail > * { scroll-snap-align: start; }

.originals-rail { grid-auto-columns: 180px; }
.original-card { position: relative; height: 130px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; color: #fff; background: #24144c; text-align: left; cursor: pointer; }
.original-card::after,
.game-card button::after { content: ""; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.92)); pointer-events: none; }
.original-card img { width: 100%; height: 100%; object-fit: cover; }
.original-card strong,
.original-card small { position: absolute; z-index: 2; left: 10px; right: 8px; }
.original-card strong { bottom: 24px; font-size: 13px; }
.original-card small { bottom: 8px; color: #ddd; }

.game-card { min-width: 0; }
.game-card button { position: relative; display: block; width: 100%; height: 210px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #eee; cursor: pointer; }
.game-card img { width: 100%; height: 100%; object-fit: cover; }
.game-card strong,
.game-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card strong { margin-top: 8px; font-size: 12px; }
.game-card small { margin-top: 3px; color: #888; }
.badge { position: absolute; top: 7px; left: 7px; z-index: 3; padding: 4px 7px; border-radius: 5px; color: #fff; background: var(--orange); font-size: 10px; }
.badge-dark { background: #111; }

.feature-banner { display: grid; grid-template-columns: minmax(170px, 32%) 1fr; min-height: 270px; border-radius: 18px; overflow: hidden; color: #fff; background: linear-gradient(115deg, #3b056a, #9f2dff 58%, #ff701c); }
.feature-banner img { width: 100%; height: 100%; object-fit: cover; }
.feature-banner > div { align-self: center; padding: 34px; }
.feature-banner span { display: inline-block; padding: 4px 8px; border-radius: 6px; background: rgba(0,0,0,.35); }
.feature-banner h3 { margin: 12px 0 6px; font-size: 34px; }
.feature-banner p { margin: 0 0 20px; color: rgba(255,255,255,.8); }

.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.theme-grid button { display: grid; gap: 6px; min-height: 150px; padding: 20px; border: 1px solid #ececec; border-radius: 14px; background: #fafafa; text-align: left; cursor: pointer; }
.theme-grid button:hover { border-color: #cdb7ff; background: #f7f2ff; }
.theme-grid span { font-size: 30px; }
.theme-grid small { color: #777; }

.seo-copy { max-width: 920px; color: #4c4c4c; line-height: 1.7; }
.seo-copy h2 { color: #111; line-height: 1.35; }
.seo-copy h3 { margin-top: 24px; color: #111; }
.seo-copy.is-collapsed .extra-copy { display: none; }
.show-more { display: block; min-width: 130px; margin: 24px auto 0; padding: 11px 18px; border: 1px solid #dedede; border-radius: 9px; background: #fff; cursor: pointer; }

.testimonial-rail { grid-auto-columns: minmax(280px, 1fr); }
.testimonial-rail blockquote { display: grid; gap: 8px; margin: 0; min-height: 180px; padding: 22px; border: 1px solid #e7e7e7; border-radius: 14px; background: #fff; }
.testimonial-rail blockquote span { color: var(--orange); letter-spacing: 3px; }
.testimonial-rail blockquote p { margin: 0; color: #606060; line-height: 1.55; }
.testimonial-rail blockquote cite { align-self: end; color: #999; font-style: normal; }

.footer { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 42px; margin-top: 28px; padding: 48px max(28px, calc((100vw - var(--sidebar) - 1120px) / 2)); background: #f6f6f4; }
.footer-about img { width: 150px; }
.footer p { max-width: 430px; color: #6f6f6f; line-height: 1.55; }
.footer h3 { margin: 4px 0 14px; }
.footer a,
.footer button { display: block; margin: 9px 0; padding: 0; border: 0; color: #666; background: none; text-align: left; cursor: pointer; }

.mobile-menu-view,
.mobile-bottom-nav { display: none; }

.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.48); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(440px, 100%); padding: 28px; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.modal-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f1f1; cursor: pointer; font-size: 22px; }
.modal h2 { margin: 0 32px 12px 0; }
.modal p { color: #5f5f5f; line-height: 1.55; }
.prototype-note { padding: 12px 14px; border-left: 4px solid var(--orange); border-radius: 8px; background: #fff4ed; }
.search-box { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid #d8d8d8; border-radius: 10px; outline: none; }
.search-box:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,90,9,.12); }
.search-results { display: grid; gap: 8px; max-height: 280px; margin-top: 14px; overflow-y: auto; }
.search-results button { padding: 12px; border: 0; border-radius: 9px; background: #f6f6f6; text-align: left; cursor: pointer; }
.toast { position: fixed; z-index: 110; right: 22px; bottom: 22px; max-width: min(360px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 10px; color: #fff; background: #181818; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast[hidden] { display: none; }

.auth-view[hidden] { display: none; }

body.auth-mode { padding-bottom: 0; }
body.auth-mode .sidebar,
body.auth-mode .page,
body.auth-mode .mobile-bottom-nav,
body.auth-mode .modal-backdrop,
body.auth-mode .toast { display: none !important; }

.embedded-auth-shell {
  display: grid;
  grid-template-columns: minmax(440px, 1.05fr) minmax(420px, .95fr);
  min-height: 100vh;
}

.embedded-auth-visual {
  position: relative;
  min-height: 100vh;
  padding: 34px 44px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 115, 25, .95), transparent 34%),
    linear-gradient(145deg, #1d0b36 10%, #6b18c8 53%, #ff5a09 120%);
}

.embedded-auth-visual::after {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -18%;
  width: 65%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 96, 9, .82);
}

.embedded-auth-brand { position: relative; z-index: 3; display: inline-block; padding: 9px 13px; border-radius: 10px; background: #fff; }
.embedded-auth-brand img { width: 154px; height: 35px; object-fit: contain; }
.embedded-visual-copy { position: relative; z-index: 3; max-width: 480px; margin-top: 12vh; }
.embedded-eyebrow { margin: 0 0 12px; color: #ffbd8f; font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.embedded-visual-copy h1 { margin: 0 0 16px; font-size: clamp(46px, 5vw, 76px); line-height: 1.02; letter-spacing: -.05em; }
.embedded-visual-copy p:last-child { max-width: 410px; color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.65; }
.embedded-auth-panda { position: absolute; z-index: 2; right: -3%; bottom: -2%; width: min(78%, 720px); max-height: 66vh; object-fit: contain; object-position: right bottom; }

.embedded-auth-panel { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; padding: 30px clamp(28px, 5vw, 78px); background: #fff; }
.embedded-back-link { align-self: flex-start; color: #666; text-decoration: none; }
.embedded-back-link:hover { color: var(--orange); }
.embedded-auth-card { width: min(470px, 100%); margin: auto; padding: 28px 0 54px; }
.embedded-mobile-logo { display: none; }
.embedded-prototype-notice { margin: 0 0 26px; padding: 13px 15px; border-left: 4px solid var(--orange); border-radius: 8px; color: #5b3a27; background: #fff2e9; font-size: 13px; line-height: 1.55; }
.account-panel[hidden] { display: none; }
.account-panel h2 { margin: 0 0 8px; font-size: 36px; letter-spacing: -.04em; }
.embedded-auth-intro { margin: 0 0 28px; color: var(--muted); }
.embedded-auth-form { display: grid; }
.embedded-auth-form label { margin-bottom: 8px; font-size: 14px; font-weight: 650; }
.embedded-auth-form input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #fff; }
.embedded-auth-form input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,90,9,.12); }
.embedded-auth-form input[aria-invalid="true"] { border-color: #d62e2e; }
.embedded-password-field { position: relative; }
.embedded-password-field input { padding-right: 72px; }
.embedded-password-toggle { position: absolute; inset: 7px 7px 7px auto; min-width: 54px; border: 0; border-radius: 7px; color: #555; background: #f2f2f2; cursor: pointer; }
.embedded-field-error { min-height: 20px; margin: 5px 0 10px; color: #c92929; font-size: 12px; }
.embedded-auth-submit { min-height: 52px; margin-top: 5px; border: 0; border-radius: 10px; color: #fff; background: var(--orange); cursor: pointer; font-weight: 700; }
.embedded-auth-submit:hover { background: var(--orange-dark); }
.embedded-form-status { min-height: 24px; margin: 12px 0 0; color: #604818; line-height: 1.5; }
.embedded-auth-switch { margin: 18px 0 0; color: #666; text-align: center; }
.embedded-auth-switch a { color: var(--orange); font-weight: 700; }

body.sidebar-collapsed { --sidebar: 76px; }
body.sidebar-collapsed .sidebar { padding-inline: 12px; }
body.sidebar-collapsed .brand,
body.sidebar-collapsed .menu-banner,
body.sidebar-collapsed .side-nav,
body.sidebar-collapsed .sidebar-footer { display: none; }
body.sidebar-collapsed .brand-row { justify-content: center; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 250px minmax(420px, 1fr); }
  .hero h1 { font-size: 38px; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --topbar: 62px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .page { margin-left: 0; }
  .topbar { height: var(--topbar); padding: 8px 16px; }
  .mobile-brand { display: block; width: 32px; height: 32px; }
  .mobile-brand img { width: 32px; height: 32px; object-fit: contain; }
  .search-trigger { display: none; }
  .account-actions { gap: 7px; }
  .button { min-height: 40px; padding: 0 17px; }

  .hero { display: flex; flex-direction: column; min-height: auto; padding: 0 16px; }
  .hero-copy { align-self: stretch; padding: 0; }
  .hero h1 { max-width: none; margin-top: 0; font-size: 25px; line-height: 1.35; letter-spacing: -.03em; }
  .hero h2 { max-width: none; margin-bottom: 15px; font-size: 16px; }
  .hero ul { margin-bottom: 19px; font-size: 16px; line-height: 1.48; }
  .hero-cta { min-width: 147px; min-height: 55px; margin-bottom: 12px; font-size: 16px; }
  .hero-speed { font-size: 14px; }
  .hero-art { width: 100%; margin-top: 28px; }
  .hero-art img { width: 100%; height: auto; min-height: 245px; object-fit: contain; }
  .hero-art::after { height: 31%; border-radius: 80px 0 26px 26px; }

  .provider-strip { gap: 34px; min-height: 64px; padding: 14px 32px; font-size: 18px; }
  .content-section { padding: 26px 16px; scroll-margin-top: 68px; }
  .section-heading { margin-bottom: 12px; }
  .section-heading h2 { font-size: 18px; }
  .rail { margin-right: -16px; padding-right: 16px; }
  .originals-rail { grid-auto-columns: 104px; gap: 12px; }
  .original-card { height: 80px; border-radius: 8px; }
  .original-card strong { bottom: 16px; font-size: 10px; }
  .original-card small { bottom: 3px; font-size: 8px; }
  .game-rail { grid-auto-columns: 104px; gap: 12px; }
  .game-card button { height: 140px; border-radius: 8px; }
  .game-card strong { font-size: 10px; }
  .game-card small { font-size: 9px; }
  .badge { top: 5px; left: 5px; padding: 3px 5px; font-size: 8px; }

  .feature-banner { grid-template-columns: 42% 1fr; min-height: 210px; border-radius: 14px; }
  .feature-banner > div { padding: 18px 14px; }
  .feature-banner h3 { font-size: 23px; }
  .feature-banner p { font-size: 12px; }
  .feature-banner .button { padding: 0 13px; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .theme-grid button { min-height: 132px; padding: 15px; }
  .testimonial-rail { grid-auto-columns: 84%; }
  .footer { grid-template-columns: 1fr 1fr; gap: 26px; padding: 36px 20px; }
  .footer-about { grid-column: 1 / -1; }

  .mobile-bottom-nav { position: fixed; inset: auto 0 0; z-index: 70; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(72px + env(safe-area-inset-bottom)); padding: 7px 8px env(safe-area-inset-bottom); border: 1px solid #e5e5e5; border-radius: 28px 28px 0 0; background: rgba(255,255,255,.96); backdrop-filter: blur(14px); box-shadow: 0 -6px 24px rgba(0,0,0,.05); }
  .mobile-bottom-nav a,
  .mobile-bottom-nav button { display: grid; place-items: center; align-content: center; gap: 2px; border: 0; border-radius: 22px; background: transparent; cursor: pointer; }
  .mobile-bottom-nav span { font-size: 22px; line-height: 1; }
  .mobile-bottom-nav small { font-size: 12px; }
  .mobile-bottom-nav .is-active { color: var(--orange); background: #fff1e9; }

  .mobile-menu-view { padding: 6px 20px 100px; }
  .mobile-menu-view:not([hidden]) { display: block; }
  .mobile-menu-banner { width: 100%; aspect-ratio: 3.25; object-fit: cover; border-radius: 11px; }
  .mobile-menu-list { display: grid; gap: 2px; margin-top: 14px; }
  .mobile-menu-list > a,
  .mobile-menu-list > button,
  .mobile-menu-body a,
  .mobile-menu-body button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 43px; padding: 8px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
  .mobile-menu-list span:first-child { width: 20px; text-align: center; }
  .mobile-menu-group { margin-top: 6px; padding: 6px; border-radius: 13px; background: #f7f7f5; }
  .mobile-menu-title { justify-content: space-between; width: 100%; min-height: 40px; padding: 4px 2px; border: 0; background: transparent; cursor: pointer; }
  .mobile-menu-body { display: grid; }
  .mobile-menu-group:not(.is-open) .mobile-menu-body { display: none; }
  body.menu-open .main-view { display: none; }
  body.menu-open .topbar { position: sticky; }

  .modal { padding: 24px 20px; }
  .toast { right: 16px; bottom: 88px; }

  .embedded-auth-shell { display: block; }
  .embedded-auth-visual { display: none; }
  .embedded-auth-panel { min-height: 100svh; padding: 18px 20px 34px; }
  .embedded-auth-card { padding-top: 34px; }
  .embedded-mobile-logo { display: block; width: 158px; margin: 0 auto 28px; }
  .account-panel h2 { font-size: 32px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 23px; }
  .account-actions .button { padding-inline: 14px; }
  .theme-grid { grid-template-columns: 1fr; }
  .embedded-auth-panel { padding-inline: 16px; }
  .embedded-auth-card { padding-top: 24px; }
}

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