@font-face {
  font-family: "Lemon";
  src: url("/fonts/Lemon-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --demo-sky: linear-gradient(180deg, #51b0f2 0%, #87cbf3 45%, #c6e4f4 100%);
  --ink: #2a1830;
  --pink: #ff5294;
  --card: rgba(255, 255, 255, 0.88);
  --font-display: "Lemon", "Trebuchet MS", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background: #51b0f2;
}

.demo {
  height: 100svh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.45rem 0.7rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  gap: 0.55rem;
  background: var(--demo-sky);
  overflow: hidden;
  box-sizing: border-box;
}

.demo__top {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: start;
  min-height: 0;
  padding: 0.1rem 0.15rem 0.55rem;
  gap: 0.15rem 0;
}

.demo__back {
  justify-self: start;
  align-self: center;
  z-index: 2;
}

.demo__mute {
  justify-self: end;
  align-self: center;
  z-index: 2;
}

.demo__back,
.demo__mute {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 16px rgba(40, 60, 100, 0.12);
  color: rgba(42, 24, 48, 0.88);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.demo__back:hover,
.demo__mute:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.78);
}

.demo__back span {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  margin-top: -1px;
}

.demo__brand {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: min(220px, calc(100% - 7.5rem));
  pointer-events: none;
  z-index: 1;
  padding-bottom: 0.15rem;
}

.demo__logo {
  height: clamp(40px, 9vw, 52px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(40, 20, 50, 0.12));
}

.demo__stage {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
  color: rgba(42, 24, 48, 0.62);
  white-space: nowrap;
}

.demo__stage-sep {
  opacity: 0.45;
  font-weight: 400;
}

.demo__mute-icon {
  grid-area: 1 / 1;
  width: 1.2rem;
  height: 1.2rem;
  display: block;
  pointer-events: none;
}

/* Only one speaker glyph visible - do not rely on [hidden] alone */
.demo__mute .demo__mute-icon--off,
.demo__mute[aria-pressed="true"] .demo__mute-icon--on {
  display: none !important;
}

.demo__mute[aria-pressed="true"] .demo__mute-icon--off {
  display: block !important;
}

.demo__mute[aria-pressed="false"] .demo__mute-icon--on {
  display: block !important;
}

.demo__mute[aria-pressed="true"] {
  background: rgba(42, 24, 48, 0.78);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(40, 20, 50, 0.22);
}

.demo__hud {
  width: min(520px, 100%);
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 0.85rem;
  padding: 0;
  box-sizing: border-box;
}

.pill {
  flex: 1 1 0;
  min-width: 0;
  background: var(--card);
  border-radius: 16px;
  padding: 0.45rem 0.65rem;
  box-shadow: 0 8px 20px rgba(40, 60, 100, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.35rem;
}

.pill small {
  width: 100%;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.pill strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
}

.pill em {
  font-style: normal;
  font-size: 0.85rem;
  opacity: 0.55;
}

.demo__board-wrap {
  width: min(520px, 100%);
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
}

#board {
  display: block;
  max-width: 100%;
  max-height: 100%;
  background: transparent;
  touch-action: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  image-rendering: auto;
}

.demo__help {
  width: min(520px, 100%);
  flex: 0 0 auto;
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.3;
  color: rgba(42, 24, 48, 0.78);
}

.demo .app-store-soon-row {
  flex: 0 0 auto;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(12, 10, 20, 0.55);
  backdrop-filter: blur(6px);
}

.overlay.hidden {
  display: none;
}

.overlay__card {
  width: min(420px, 100%);
  text-align: center;
  padding: 1.6rem 1.25rem 1.35rem;
  border-radius: 28px;
  background: #12121a;
  color: #f6f2f7;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.overlay__card img {
  margin: 0 auto 0.85rem;
  display: block;
  border-radius: 22px;
}

.overlay__card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 400;
}

.overlay__card p {
  margin: 0.7rem 0 0;
  color: rgba(246, 242, 247, 0.78);
  line-height: 1.45;
  font-size: 0.95rem;
}

.overlay__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.btn--primary {
  background: linear-gradient(180deg, #ff6aa3 0%, #ff5294 42%, #f26bb8 100%);
  border: 2.4px solid #c73a72;
  box-shadow:
    0 12px 24px rgba(242, 89, 140, 0.35),
    inset 0 -7px 0 rgba(120, 20, 60, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn--primary::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 46%;
  height: 58%;
  border-radius: 0 999px 0 70%;
  background: radial-gradient(
    ellipse 90% 80% at 88% 18%,
    rgba(255, 252, 245, 0.98) 0%,
    rgba(255, 250, 240, 0.72) 28%,
    rgba(255, 255, 255, 0.18) 52%,
    transparent 72%
  );
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 1;
}

.btn--primary::after {
  content: "";
  position: absolute;
  top: 16%;
  right: 11%;
  width: 0.85rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.95);
  transform: rotate(-32deg);
  box-shadow: 0 0 6px 1px rgba(255, 252, 245, 0.7);
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 2;
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}

.btn--ghost::before,
.btn--ghost::after {
  display: none;
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.btn--secondary::before,
.btn--secondary::after {
  display: none;
}

@media (max-width: 520px) {
  .demo {
    padding: 0.35rem 0.55rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    gap: 0.5rem;
  }

  .demo__top {
    padding-bottom: 0.45rem;
  }

  .demo__logo {
    height: clamp(34px, 8vw, 44px);
  }

  .demo__stage {
    font-size: 0.64rem;
    line-height: 1.3;
  }

  .demo__brand {
    gap: 0.3rem;
  }

  .demo__hud {
    gap: 0.75rem;
  }

  .pill {
    padding: 0.35rem 0.5rem;
    border-radius: 12px;
  }

  .pill strong {
    font-size: 1.1rem;
  }

  .demo__help {
    font-size: 0.68rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-height: 720px) {
  .demo__help {
    display: none;
  }
}
