:root {
  --navy: #07111f;
  --ice: #8ec8ff;
  --frost: #c8e4ff;
  --ember: #ff6b2c;
  --ember-deep: #c43a12;
  --gold: #f4c95d;
  --ink: #e8eef6;
  --ink-soft: #b7c4d6;
  --muted: #8b9bb0;
  --line: rgba(142, 200, 255, 0.18);
  --surface: rgba(12, 24, 42, 0.72);
  --phone-bezel: #121820;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

.templates-embed,
.play-embed {
  width: min(68rem, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
  border-top: 1px solid var(--line);
}

.demo-banner {
  margin: 0 0 1.25rem;
  padding: 0.65rem 1rem;
  background: rgba(142, 200, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--ice);
  font-size: 0.875rem;
  text-align: center;
}

.page-intro .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 600;
}

.page-intro h1,
.page-intro h2 {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  letter-spacing: -0.02em;
}

.page-intro .lede {
  margin: 0.75rem 0 0;
  max-width: 40rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.platform-toggle {
  display: inline-flex;
  margin-top: 1.5rem;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  gap: 2px;
}

.plat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.plat-btn.active {
  background: var(--ink);
  color: #07111f;
}

.plat-btn:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.plat-ico {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 4px;
  background: currentColor;
  opacity: 0.85;
}

.plat-ico.ios {
  border-radius: 5px;
}

.plat-ico.android {
  border-radius: 2px 2px 4px 4px;
  background: #3ddc84;
}

.plat-btn.active .plat-ico.android {
  opacity: 1;
}

.walk-stage {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  min-height: 620px;
}

.device-col {
  margin: 0;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.device-col[hidden] {
  display: none;
}

.platform-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.phone {
  width: 280px;
  height: 600px;
  background: var(--phone-bezel);
  border-radius: 36px;
  padding: 10px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 28px 48px rgba(0, 0, 0, 0.45);
  position: relative;
}

.phone-ios {
  border-radius: 42px;
}

.phone-android {
  border-radius: 26px;
  padding: 8px;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0a1524;
  border-radius: 32px;
  overflow: hidden;
}

.phone-android .phone-screen {
  border-radius: 20px;
}

.screen-pane {
  display: none;
  position: absolute;
  inset: 0;
  background: #0a1524;
}

.screen-pane.active {
  display: block;
  animation: pane-in 0.28s ease;
}

.screen-pane img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

@keyframes pane-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.walk-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.walk-nav button {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.walk-nav button:hover {
  border-color: var(--ember);
}

.flow-controls {
  margin-top: 2.5rem;
}

.step-list {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 720px) {
  .step-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-btn {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(12, 24, 42, 0.55);
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  color: inherit;
}

.step-btn:hover {
  border-color: rgba(255, 107, 44, 0.45);
}

.step-btn.active {
  border-color: var(--ember);
  background: rgba(255, 107, 44, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 107, 44, 0.25);
}

.step-btn .sn {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ice);
  color: #07111f;
  font-size: 0.7rem;
  font-weight: 700;
}

.step-btn.active .sn {
  background: var(--ember);
  color: #fff;
}

.step-btn .st {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.step-btn .sd {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.note-box {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border-left: 3px solid var(--ember);
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* Interactive play board */
.play-stage {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.play-phone {
  width: min(22rem, 100%);
}

.play-climate {
  --warmth: 0.35;
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  min-height: 34rem;
  padding: 1.15rem 1rem 1.25rem;
  isolation: isolate;
  box-shadow: 0 28px 48px rgba(0, 0, 0, 0.4);
}

.climate-ice,
.climate-fire {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.35s ease;
}

.climate-ice {
  opacity: calc(1 - var(--warmth));
  background:
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(142, 200, 255, 0.35) 0%, transparent 60%),
    linear-gradient(180deg, #0a1c33 0%, #16324f 55%, #8ec8ff 160%);
}

.climate-fire {
  opacity: var(--warmth);
  background:
    radial-gradient(ellipse 80% 55% at 50% 110%, rgba(255, 77, 42, 0.55) 0%, transparent 55%),
    linear-gradient(180deg, #1a0c08 0%, #4a1a0c 50%, #ff6b2c 140%);
}

.climate-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 180, 80, 0.7) 0 1.2px, transparent 2px);
  background-size: 52px 64px, 38px 48px;
  background-position: 8px 12px, 22px 4px;
  opacity: calc(0.15 + var(--warmth) * 0.45);
}

.play-ui {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: #fff;
}

.play-brand {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.play-hint-line {
  margin: 0.15rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

.thermo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.thermo {
  width: 18px;
  height: 86px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.thermo::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: calc(10% + var(--warmth) * 82%);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff4d2a, #f4c95d 55%, #8ec8ff);
  transition: height 0.3s ease, background 0.3s ease;
}

.thermo-readout .deg {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
}

.thermo-readout .label {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.play-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.hint-btn,
.play-new {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: #07111f;
  background: #fff;
}

.hint-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.hint-btn.on {
  background: rgba(244, 201, 93, 0.25);
  border-color: var(--gold);
  color: var(--gold);
}

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  padding: 0.7rem;
  border-radius: 16px;
  background: rgba(8, 12, 20, 0.38);
  backdrop-filter: blur(8px);
  touch-action: none;
}

.spot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.spot .num {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  z-index: 1;
  pointer-events: none;
}

.spot.glow {
  animation: slot-glow 1s ease-in-out infinite;
  border-color: var(--gold);
}

.spot.drop-target {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

@keyframes slot-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(244, 201, 93, 0.15);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(244, 201, 93, 0.28);
  }
}

.tile {
  position: absolute;
  inset: 6px 5px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f4f0e8;
  color: #14110e;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  cursor: grab;
  user-select: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  touch-action: none;
  z-index: 2;
}

.tile:active,
.tile.dragging {
  cursor: grabbing;
  z-index: 8;
  transform: scale(1.06);
}

.tile.locked-correct {
  background: #fff6d8;
  box-shadow: 0 0 0 2px var(--gold);
}

.melt-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 6, 4, 0.55);
  backdrop-filter: blur(6px);
}

.melt-overlay.show {
  display: flex;
}

.melt-card {
  width: min(18rem, 100%);
  padding: 1.25rem 1.1rem 1.15rem;
  border-radius: 18px;
  text-align: center;
  background: rgba(18, 12, 10, 0.88);
  border: 1px solid rgba(244, 201, 93, 0.45);
  color: #fff;
}

.melt-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.melt-word {
  margin: 0.7rem 0 0;
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.melt-card p {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}

.melt-card .btn {
  width: 100%;
  margin-top: 1rem;
}

@media (max-width: 420px) {
  .phone {
    width: 250px;
    height: 540px;
  }

  .play-climate {
    min-height: 30rem;
  }
}
