/* Public try-before-you-buy surface. It deliberately reuses the production
   board and control styles, while keeping the catalogue isolated from every
   account/progress script. */
.public-demo-page {
  min-width: 0;
  overflow: hidden;
}

#screen-demo {
  max-width: none;
  padding-top: 0;
  overflow: hidden;
}

.demo-topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: calc(10px + var(--safe-t)) 16px 10px;
}

.demo-home-link,
.demo-login-link {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--ink-line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink-line);
  font-weight: 1000;
  text-decoration: none;
}

.demo-home-link { width: 42px; font-size: 22px; }
.demo-login-link { padding: 0 14px; font-size: 13px; }
.demo-home-link:active,
.demo-login-link:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink-line); }

.demo-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.demo-brand img { width: 38px; height: 38px; object-fit: contain; }
.demo-brand span { min-width: 0; line-height: .92; }
.demo-brand b,
.demo-brand small { display: block; white-space: nowrap; }
.demo-brand b { overflow: hidden; text-overflow: ellipsis; font-size: 15px; font-weight: 1000; letter-spacing: .35px; }
.demo-brand small { margin-top: 5px; color: var(--c1); font-size: 9px; font-weight: 1000; letter-spacing: 2.8px; }

.demo-scroll {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  padding: 6px 14px calc(26px + var(--safe-b));
}

.demo-hero,
.demo-picker,
.demo-more,
.demo-access-card,
.demo-footnote {
  width: min(980px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.demo-hero {
  min-height: 235px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 24px 6px 18px 22px;
  overflow: hidden;
  border: 3px solid var(--ink-line);
  border-radius: 27px;
  background:
    radial-gradient(circle at 87% 12%, rgba(255,255,255,.62) 0 12%, transparent 12.5%),
    linear-gradient(145deg, #fff0b0, #f5cf6f);
  box-shadow: var(--shadow-lg);
}
.demo-hero::after {
  content: "";
  position: absolute;
  right: 112px;
  top: 25px;
  width: 46px;
  height: 46px;
  border: 3px solid rgba(47,42,38,.23);
  border-radius: 14px;
  transform: rotate(15deg);
}
.demo-hero-copy { position: relative; z-index: 1; min-width: 0; padding-bottom: 6px; }
.demo-hero-copy p,
.demo-section-heading p,
.demo-access-card p,
.demo-result-kicker {
  margin: 0 0 7px;
  color: var(--c1);
  font-size: 10.5px;
  font-weight: 1000;
  letter-spacing: 1.45px;
}
.demo-hero-copy h1 {
  margin: 0;
  color: var(--ink-line);
  font-size: clamp(39px, 12vw, 64px);
  font-weight: 1000;
  line-height: .93;
  letter-spacing: -1.8px;
}
.demo-hero-copy > span {
  display: block;
  max-width: 27ch;
  margin-top: 14px;
  color: #66543f;
  font-size: 13.5px;
  font-weight: 850;
  line-height: 1.35;
}
.demo-hero > img {
  position: relative;
  z-index: 1;
  width: clamp(112px, 34vw, 165px);
  height: auto;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 7px 0 rgba(47,42,38,.16));
}

.demo-picker { padding-top: 27px; }
.demo-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.demo-section-heading h2 { margin: 0; color: var(--ink-line); font-size: 25px; line-height: 1; }
.demo-section-heading > span {
  flex: none;
  padding: 6px 9px;
  border: 2px solid var(--ink-line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 1000;
}

.demo-game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.demo-game-card {
  min-width: 0;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid var(--ink-line);
  border-radius: 21px;
  background: var(--game-color, var(--c1));
  box-shadow: var(--shadow);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.demo-game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(20,16,12,.85) 0%,
    rgba(20,16,12,.58) 24%,
    rgba(20,16,12,.08) 52%,
    rgba(20,16,12,0) 70%);
}
.demo-game-card::after {
  content: "MAIN →";
  position: absolute;
  top: 11px;
  right: 10px;
  z-index: 3;
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 2.5px solid var(--ink-line);
  border-radius: 999px;
  background: #fff5c9;
  color: var(--ink-line);
  box-shadow: 2px 2px 0 var(--ink-line);
  font-size: 10.5px;
  font-weight: 1000;
  letter-spacing: .5px;
}
.demo-game-card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink-line); }
.demo-game-cover {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.demo-game-body {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  min-width: 0;
  padding: 42px 14px 14px;
}
.demo-game-body h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(17px, 4.8vw, 21px);
  font-weight: 1000;
  line-height: 1.08;
  text-shadow: 0 2px 1px rgba(20,16,12,.55);
}

.demo-more {
  margin-top: 24px;
  padding: 19px 15px 17px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: rgba(255,253,249,.84);
}
.demo-more > p {
  margin: 0 0 6px;
  color: var(--c1);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 1.35px;
}
.demo-more h2 {
  margin: 0 0 14px;
  color: var(--ink-line);
  font-size: 20px;
  line-height: 1.15;
}
.demo-more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.demo-more-grid li {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.demo-access-card {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 17px 14px 18px 8px;
  border: 3px solid var(--ink-line);
  border-radius: 24px;
  background: linear-gradient(140deg, #d9efe9, #b9dfd5);
  box-shadow: var(--shadow-lg);
}
.demo-access-card img { width: 82px; height: 82px; object-fit: contain; }
.demo-access-card h2 { margin: 0 0 13px; color: var(--ink-line); font-size: 20px; line-height: 1.13; }
.demo-access-card .demo-access-copy {
  margin: -5px 0 14px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.4;
}
.demo-access-cta,
.demo-result-access {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 13px;
  border: 2.5px solid var(--ink-line);
  border-radius: 14px;
  background: var(--c1);
  box-shadow: 3px 3px 0 var(--ink-line);
  color: #fff;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.demo-access-cta:active,
.demo-result-access:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink-line); }
.demo-footnote { margin-top: 17px; color: var(--ink-soft); font-size: 10.5px; font-weight: 750; text-align: center; }
.demo-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  width: min(980px, 100%);
  margin: 18px auto 0;
  padding-top: 17px;
  border-top: 2px dashed var(--line);
}
.demo-footer .footer-note { margin: 0; }

/* Real game chrome, with only a tiny demo status strip added. */
.demo-playbar .app-bar-title { min-width: 0; flex-direction: column; gap: 1px; line-height: 1.1; }
#play-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-chip { color: var(--c3); font-size: 8px; font-weight: 1000; letter-spacing: 1.5px; }
.demo-play-progress {
  width: fit-content;
  max-width: calc(100% - 28px);
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 auto 6px;
  padding: 5px 9px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: rgba(255,253,249,.86);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 850;
}
.demo-play-progress b { color: var(--accent, var(--c1)); }
#screen-play .play-stage { touch-action: manipulation; }

.demo-modal-cover {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 10px;
  border: 2.5px solid var(--ink-line);
  border-radius: 20px;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.demo-modal-meta { margin: -7px 0 15px; color: var(--c1); font-size: 11px; font-weight: 1000; letter-spacing: .7px; }
.demo-howto-card .howto-steps { margin-bottom: 14px; font-size: 13.5px; }
.demo-howto-card .modal-title { padding-inline: 18px; }
.demo-result-card > img { display: block; width: 106px; height: 106px; margin: -7px auto -2px; object-fit: contain; }
.demo-result-card .demo-result-kicker { margin-top: 0; }
.demo-result-card .modal-title { margin: 0 0 8px; font-size: 25px; }
.demo-result-card > p:not(.demo-result-kicker) { margin: 0 0 14px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }
.demo-result-access { margin-top: 11px; }
.demo-result-card .btn-ghost { color: var(--c1); }

@media (min-width: 720px) {
  .demo-scroll { padding-inline: 24px; }
  .demo-hero { min-height: 270px; padding: 32px 35px 25px; }
  .demo-hero > img { width: 190px; }
  .demo-game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
  .demo-game-body { padding: 55px 18px 18px; }
  .demo-game-body h3 { font-size: 21px; }
  .demo-more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .demo-access-card { grid-template-columns: 112px minmax(0, 1fr); padding: 22px 28px 22px 14px; }
  .demo-access-card img { width: 110px; height: 110px; }
  .demo-access-card h2 { font-size: 26px; }
  .demo-access-cta { font-size: 14px; }
}

@media (max-width: 370px) {
  .demo-topbar { grid-template-columns: 40px minmax(0,1fr) auto; padding-inline: 10px; }
  .demo-home-link { width: 40px; }
  .demo-login-link { padding-inline: 9px; font-size: 11px; }
  .demo-brand img { display: none; }
  .demo-brand b { font-size: 13px; }
  .demo-hero { padding-left: 16px; }
  .demo-hero-copy h1 { font-size: 36px; }
  .demo-game-grid { gap: 9px; }
  .demo-game-card::after { min-height: 31px; padding: 6px 9px; font-size: 9px; }
  .demo-game-body { padding: 36px 10px 10px; }
  .demo-game-body h3 { font-size: 14px; }
  .demo-access-card { grid-template-columns: 62px minmax(0,1fr); }
  .demo-access-card img { width: 65px; height: 65px; }
  .demo-access-card h2 { font-size: 17px; }
  .demo-footer { flex-direction: column; }
}

@media (max-width: 420px) {
  .demo-hero {
    min-height: 210px;
    align-items: flex-start;
    padding: 22px 104px 18px 16px;
  }
  .demo-hero-copy { width: 100%; padding-bottom: 0; }
  .demo-hero-copy h1 {
    font-size: 31px;
    line-height: .96;
    letter-spacing: -1.2px;
    white-space: nowrap;
  }
  .demo-hero-copy > span { max-width: 22ch; margin-top: 12px; font-size: 11.5px; }
  .demo-hero > img {
    position: absolute;
    right: 3px;
    bottom: 5px;
    width: 106px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .public-demo-page *, .public-demo-page *::before, .public-demo-page *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
