:root {
  color-scheme: light;
  --bg: #eef2f5;
  --paper: #f8fbff;
  --surface: #ffffff;
  --ink: #151b20;
  --muted: #64717a;
  --line: rgba(26, 39, 45, 0.15);
  --charcoal: #151b20;
  --red: #b83b35;
  --red-strong: #8f2824;
  --jade: #0e7565;
  --gold: #c98a2b;
  --sky: #277b9a;
  --shadow: 0 18px 42px rgba(16, 29, 38, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #151b20 0, #742824 220px, #eef2f5 221px),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

body.drawer-open {
  overflow: hidden;
}

.site-shell {
  width: min(1180px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 14px 14px 94px;
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 0;
  background: linear-gradient(180deg, rgba(45, 24, 23, 0.96), rgba(45, 24, 23, 0.82));
  backdrop-filter: blur(12px);
}

.brand-mark {
  display: inline-grid;
  grid-template-columns: 44px minmax(0, auto);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  text-align: left;
}

.brand-icon,
.avatar {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 8px;
  font-weight: 1000;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.brand-mark strong,
.brand-mark small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark strong {
  font-size: 17px;
  line-height: 1.1;
}

.brand-mark small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.desktop-nav {
  display: none;
}

.install-button,
.text-button,
.primary,
.ghost,
.nav-link,
.nav-item,
.status {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 900;
}

.install-button,
.primary {
  color: #fff;
  background: var(--red);
  border: 0;
}

.install-button {
  padding: 0 13px;
}

.primary {
  padding: 0 14px;
}

.primary.alt {
  background: var(--jade);
}

.ghost {
  padding: 0 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.ghost.dark {
  color: var(--charcoal);
  background: rgba(255, 250, 243, 0.88);
  border-color: rgba(255, 250, 243, 0.92);
}

.text-button {
  padding: 0 12px;
  color: var(--red-strong);
  background: #fff1df;
  border: 1px solid rgba(184, 59, 53, 0.16);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-gamebox {
  display: grid;
  gap: 16px;
  min-height: min(680px, calc(100svh - 92px));
  padding: 18px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(27, 22, 21, 0.88), rgba(27, 22, 21, 0.52)),
    url("./assets/games/thvd.jpg") center / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  align-content: end;
  gap: 14px;
}

.eyebrow,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.eyebrow {
  color: #c28e55;
  font-weight: 950;
  text-transform: uppercase;
}

.hero-copy .eyebrow,
.featured-game p {
  color: rgba(255, 224, 184, 0.9);
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
.section-head h2,
.featured-game h2,
.product-title h3 {
  margin: 0;
}

h1 {
  max-width: 11ch;
  font-size: clamp(42px, 12vw, 76px);
  line-height: 0.98;
}

.hero-text {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.5;
}

.hero-actions,
.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.signal-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 520px;
}

.signal-row span {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 8px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-size: 12px;
}

.signal-row strong {
  color: #fff;
  font-size: 19px;
}

.hero-showcase {
  display: grid;
  align-content: end;
  gap: 10px;
}

.featured-game {
  position: relative;
  display: grid;
  min-height: 290px;
  overflow: hidden;
  border-radius: 8px;
  isolation: isolate;
}

.featured-game img,
.product-card img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-game::after,
.product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(15, 10, 8, 0.86));
}

.featured-game > div {
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 14px;
}

.featured-game p,
.featured-game h2 {
  margin: 0;
}

.featured-game h2 {
  font-size: 30px;
  line-height: 1.05;
}

.mini-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mini-game {
  display: grid;
  gap: 6px;
  padding: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid transparent;
  border-radius: 8px;
}

.mini-game.active {
  border-color: rgba(255, 210, 132, 0.78);
}

.mini-game img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.mini-game span {
  font-size: 11px;
  font-weight: 950;
}

.account-strip,
.member-strip,
.wallet-panel,
.auth-status-row,
.quick-grid article,
.seo-panel,
.benefit-item,
.binding-item,
.legacy-panel,
.consent-panel,
.form-grid,
.support-card,
.install-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.account-strip {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 12px;
}

.member-strip,
.wallet-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
}

.member-strip strong,
.wallet-panel strong {
  display: block;
  margin: 3px 0 8px;
  font-size: 22px;
  line-height: 1.05;
}

.member-strip > div,
.wallet-panel > div {
  min-width: 0;
}

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  background: #dce6eb;
  border-radius: 8px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--jade), var(--gold));
  border-radius: inherit;
}

.wallet-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

.task-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.auth-status-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  background: var(--jade);
}

.account-strip strong,
.auth-status-row strong {
  display: block;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.quick-grid article {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.quick-grid span {
  color: var(--red);
  font-size: 12px;
  font-weight: 1000;
}

.quick-grid strong {
  font-size: 18px;
}

.quick-grid p,
.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 12px;
}

.section-head h2 {
  font-size: 25px;
  line-height: 1.1;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #6b3208;
  background: #ffe8c7;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.pill.hot {
  color: #7a241c;
  background: #ffe0dc;
}

.seo-panel {
  padding: 2px 12px 12px;
}

.article-grid,
.product-list,
.benefit-list,
.binding-list,
.support-actions {
  display: grid;
  gap: 12px;
}

.article-card {
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 12px;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid rgba(201, 138, 43, 0.22);
  border-radius: 8px;
  text-align: left;
}

.article-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
}

.article-card strong {
  font-size: 17px;
  line-height: 1.18;
}

.product-card {
  position: relative;
  display: grid;
  min-height: 220px;
  overflow: hidden;
  color: #fff;
  background: var(--charcoal);
  border-radius: 8px;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.product-card::after {
  background: linear-gradient(90deg, rgba(20, 15, 13, 0.9), rgba(20, 15, 13, 0.42) 62%, rgba(20, 15, 13, 0.08));
}

.product-content {
  display: grid;
  align-content: end;
  gap: 10px;
  min-height: 220px;
  padding: 14px;
}

.card-detail {
  justify-self: start;
  min-height: 28px;
  padding: 0 9px;
  color: #fff4dd;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.product-title {
  display: grid;
  gap: 3px;
}

.product-title h3 {
  max-width: 14ch;
  font-size: 29px;
  line-height: 1.04;
}

.product-title span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 850;
}

.reward-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reward-line span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  color: #fff4dd;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}

.benefit-item,
.binding-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px;
}

.reward-card {
  min-height: 92px;
}

.reward-kind {
  display: block;
  margin-bottom: 4px;
  color: var(--sky);
  font-size: 12px;
  font-weight: 950;
}

.redemption-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.section-head.compact {
  margin: 6px 0 0;
}

.section-head.compact h2 {
  font-size: 19px;
}

.benefit-item strong,
.binding-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  font-size: 12px;
  white-space: nowrap;
}

.status.ready {
  color: #0b5f42;
  background: #dbf7e6;
}

.status.pending {
  color: #7a241c;
  background: #ffe0dc;
}

.status.locked {
  color: #544a43;
  background: #eee6dc;
}

.form-grid {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.auth-form {
  margin-bottom: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.legacy-panel {
  margin-bottom: 12px;
  padding: 14px;
}

.legacy-panel strong {
  display: block;
  margin: 3px 0;
  font-size: 18px;
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(184, 59, 53, 0.14);
}

.wide {
  width: 100%;
}

.support-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.support-card {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 92px;
  padding: 10px;
  text-align: left;
}

.support-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.support-card strong {
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.install-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
}

.install-card strong {
  display: block;
  margin-bottom: 3px;
}

.consent-panel {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  padding: 8px 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  font-weight: 760;
}

.switch-row input {
  width: 48px;
  height: 28px;
  accent-color: var(--jade);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 14;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 250, 243, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-item {
  min-height: 46px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 13px;
}

.nav-item.active {
  color: #fff;
  background: var(--charcoal);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 92px;
  left: 16px;
  z-index: 20;
  max-width: 520px;
  min-height: 44px;
  margin: 0 auto;
  padding: 12px 14px;
  color: #fff;
  background: rgba(29, 23, 21, 0.96);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.game-drawer[hidden] {
  display: none;
}

.game-drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
  padding: 18px;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 10, 8, 0.68);
  border: 0;
  backdrop-filter: blur(10px);
}

.drawer-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(860px, 100%);
  max-height: calc(100svh - 36px);
  margin: 0 auto;
  overflow: auto;
  background: #fffaf3;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(20, 12, 8, 0.36);
}

.drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 38px;
  height: 38px;
  color: #fff;
  background: rgba(29, 23, 21, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  font-weight: 1000;
}

.drawer-media {
  position: relative;
  min-height: 210px;
  overflow: hidden;
}

.drawer-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(27, 22, 21, 0.28));
}

.drawer-media img {
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
}

.drawer-media .pill {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
}

.drawer-content {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.drawer-content h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.02;
}

.drawer-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

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

.drawer-steps span {
  display: grid;
  gap: 5px;
  min-height: 68px;
  padding: 10px;
  background: #fff2df;
  border: 1px solid rgba(201, 138, 43, 0.22);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.drawer-steps strong {
  color: var(--red-strong);
  font-size: 18px;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

@media (min-width: 760px) {
  .site-shell {
    padding: 18px 18px 42px;
  }

  .site-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    background: transparent;
    position: relative;
  }

  .desktop-nav {
    display: flex;
    justify-content: center;
    gap: 6px;
  }

  .nav-link {
    padding: 0 13px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  .nav-link.active {
    color: var(--charcoal);
    background: #fffaf3;
  }

  .bottom-nav {
    display: none;
  }

  .hero-gamebox {
    grid-template-columns: minmax(0, 0.92fr) minmax(380px, 0.72fr);
    min-height: min(560px, calc(100svh - 150px));
    padding: 24px;
  }

  h1 {
    max-width: 12ch;
    font-size: clamp(52px, 6vw, 74px);
  }

  .drawer-card {
    grid-template-columns: minmax(330px, 0.82fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .drawer-media,
  .drawer-media img {
    min-height: 420px;
  }

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

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

  .form-grid .wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1080px) {
  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .article-grid,
  .product-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .hero-gamebox {
    gap: 12px;
    min-height: 0;
    padding: 14px;
  }

  .hero-copy {
    gap: 10px;
  }

  h1 {
    max-width: 12ch;
    font-size: 40px;
  }

  .hero-text {
    font-size: 14px;
    line-height: 1.38;
  }

  .hero-actions,
  .action-row,
  .install-card {
    grid-template-columns: 1fr;
  }

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

  .featured-game .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-actions {
    grid-template-columns: 1fr;
  }

  .member-strip,
  .wallet-panel {
    grid-template-columns: 1fr;
  }

  .task-actions {
    grid-template-columns: 1fr;
  }

  .drawer-actions,
  .drawer-steps {
    grid-template-columns: 1fr;
  }

  .signal-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .signal-row span {
    min-height: 48px;
    padding: 7px 5px;
    font-size: 11px;
  }

  .signal-row strong {
    font-size: 16px;
  }

  .hero-showcase {
    gap: 8px;
  }

  .account-strip {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    margin: 8px 0;
    padding: 10px;
  }

  .avatar {
    width: 44px;
    height: 44px;
  }

  .featured-game {
    min-height: 176px;
  }

  .featured-game > div {
    gap: 8px;
    padding: 12px;
  }

  .featured-game h2 {
    font-size: 24px;
  }

  .mini-rail {
    gap: 6px;
  }

  .mini-game {
    gap: 4px;
    padding: 5px;
  }

  .product-title h3 {
    font-size: 25px;
  }
}
