:root {
  color-scheme: dark;
}

body.web-demo-mode {
  margin: 0;
  min-height: 100vh;
  background: #02050c;
  overflow: hidden;
}

body.web-demo-mode #mainMenu {
  display: none !important;
}

#webDemoSelector,
#webDemoResult {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 15% 10%, rgba(0, 221, 255, .19), transparent 35%),
    radial-gradient(circle at 90% 82%, rgba(140, 0, 255, .19), transparent 38%),
    linear-gradient(145deg, #02050b 0%, #071426 48%, #05020d 100%);
  font-family: Arial, Helvetica, sans-serif;
}

.web-demo-shell {
  width: min(1180px, 100%);
  padding: clamp(20px, 3vw, 42px);
  box-sizing: border-box;
  border: 1px solid rgba(120, 235, 255, .38);
  border-radius: 28px;
  background: rgba(3, 10, 24, .88);
  box-shadow: 0 24px 90px rgba(0, 0, 0, .65), inset 0 0 50px rgba(0, 221, 255, .04);
  backdrop-filter: blur(14px);
}

.web-demo-eyebrow {
  color: #72f3ff;
  text-align: center;
  font-size: clamp(12px, 1.5vw, 16px);
  font-weight: 900;
  letter-spacing: .22em;
}

.web-demo-shell > h1 {
  margin: 8px 0 4px;
  text-align: center;
  color: white;
  font-size: clamp(34px, 5.5vw, 68px);
  line-height: 1;
  text-shadow: 0 0 26px rgba(0, 220, 255, .65);
}

.web-demo-intro {
  margin: 12px auto 8px;
  max-width: 720px;
  text-align: center;
  color: #c9d9ec;
  font-size: clamp(15px, 2vw, 20px);
}

.web-demo-status {
  width: fit-content;
  margin: 12px auto 20px;
  padding: 7px 14px;
  border-radius: 999px;
  color: #ffeeb3;
  background: rgba(255, 190, 0, .12);
  border: 1px solid rgba(255, 210, 70, .45);
  font-weight: 800;
}

.web-demo-status.ready {
  color: #baffd4;
  background: rgba(0, 220, 105, .11);
  border-color: rgba(70, 255, 155, .42);
}

.web-demo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.web-demo-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(160, 230, 255, .28);
  background: rgba(8, 19, 38, .96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .32);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.web-demo-card:hover,
.web-demo-card.preferred {
  transform: translateY(-5px);
  border-color: rgba(105, 240, 255, .78);
  box-shadow: 0 18px 42px rgba(0, 190, 255, .2);
}

.web-demo-art {
  position: relative;
  min-height: 150px;
  background-size: cover;
  background-position: center;
}

.web-demo-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, .72);
  border: 1px solid rgba(255, 255, 255, .34);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.web-demo-card-body {
  padding: 16px;
}

.web-demo-card h2 {
  margin: 0 0 8px;
  color: white;
  font-size: 21px;
}

.web-demo-card p {
  min-height: 56px;
  margin: 0 0 16px;
  color: #aebed2;
  line-height: 1.4;
}

.web-demo-play,
.web-demo-result-primary,
.web-demo-result-secondary,
.web-demo-store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  border-radius: 12px;
  font: inherit;
  font-weight: 900;
  letter-spacing: .06em;
  cursor: pointer;
  text-decoration: none;
}

.web-demo-play,
.web-demo-result-primary {
  border: 1px solid #76f5ff;
  color: #00131a;
  background: linear-gradient(180deg, #8affff, #24cfe7);
  box-shadow: 0 0 18px rgba(0, 220, 255, .32);
}

.web-demo-play:disabled {
  cursor: wait;
  opacity: .42;
  filter: grayscale(1);
}

.web-demo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  color: #8ea0b8;
  font-size: 14px;
}

.web-demo-footer a {
  color: #7cf4ff;
  font-weight: 900;
}

.web-demo-result-panel {
  width: min(620px, 100%);
  padding: clamp(26px, 5vw, 54px);
  box-sizing: border-box;
  border-radius: 28px;
  border: 1px solid rgba(109, 244, 255, .58);
  background: rgba(3, 12, 25, .94);
  box-shadow: 0 24px 90px rgba(0, 0, 0, .7), 0 0 44px rgba(0, 210, 255, .12);
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
}

.web-demo-result-kicker {
  color: #7cf4ff;
  font-weight: 900;
  letter-spacing: .2em;
}

.web-demo-result-panel h2 {
  margin: 12px 0;
  color: white;
  font-size: clamp(34px, 6vw, 58px);
}

.web-demo-result-panel p {
  color: #c4d4e8;
  font-size: 18px;
}

.web-demo-result-actions {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.web-demo-result-secondary {
  border: 1px solid rgba(130, 230, 255, .55);
  color: #dfffff;
  background: rgba(0, 150, 190, .12);
}

.web-demo-store-button {
  border: 1px solid rgba(143, 255, 139, .68);
  color: #eaffdf;
  background: rgba(54, 170, 62, .18);
}

@media (max-width: 950px) {
  #webDemoSelector {
    align-items: start;
  }

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

@media (max-width: 560px) {
  #webDemoSelector,
  #webDemoResult {
    padding: 12px;
  }

  .web-demo-shell {
    border-radius: 18px;
  }

  .web-demo-grid {
    grid-template-columns: 1fr;
  }

  .web-demo-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (orientation: portrait) and (max-width: 900px) {
  body.web-demo-mode:not(.demo-selector-visible)::after {
    content: 'Rotate your device to landscape to play';
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 28px;
    color: white;
    background: rgba(0, 0, 0, .94);
    text-align: center;
    font: 900 24px/1.25 Arial, sans-serif;
  }
}

/* Website-only maze failure screen. */
#failureOverlay.web-demo-failure-overlay {
  gap: 12px;
  padding: 24px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 68, 68, .22), transparent 34%),
    rgba(2, 7, 16, .96);
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
}

#failureOverlay.web-demo-failure-overlay h1 {
  margin: 0;
  color: #ff6262 !important;
  font-size: clamp(34px, 7vw, 66px);
  letter-spacing: .05em;
  text-shadow: 0 0 22px rgba(255, 40, 40, .75) !important;
}

#failureOverlay.web-demo-failure-overlay > div:nth-of-type(1) {
  max-width: 680px;
  color: #e7edf7 !important;
  font-size: clamp(18px, 3vw, 28px) !important;
  line-height: 1.35;
}

#failureOverlay.web-demo-failure-overlay > div:last-child {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(760px, 96vw);
  margin-top: 12px;
}

#failureOverlay.web-demo-failure-overlay button,
#failureOverlay .web-demo-failure-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 18px;
  box-sizing: border-box;
  border-radius: 12px;
  font: 900 15px/1.1 Arial, Helvetica, sans-serif;
  letter-spacing: .04em;
  text-decoration: none;
}

#failureOverlay .web-demo-failure-store {
  border: 1px solid rgba(143, 255, 139, .68);
  color: #edffe6;
  background: rgba(54, 170, 62, .22);
}

@media (max-width: 720px) {
  #failureOverlay.web-demo-failure-overlay > div:last-child {
    grid-template-columns: 1fr;
    width: min(430px, 96vw);
  }
}

