:root {
  --sky-top: #2276f2;
  --sky-mid: #35bfed;
  --sky-bottom: #c9f6ff;
  --panel: rgba(20, 38, 83, 0.78);
  --panel-bright: rgba(0, 183, 208, 0.9);
  --panel-purple: rgba(75, 64, 174, 0.9);
  --text: #f8fbff;
  --muted: #d9ecff;
  --button: #ffcb3d;
  --button-dark: #354868;
  --locked: rgba(30, 44, 75, 0.66);
  --radius: 18px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: #101827;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  height: 100dvh;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.demo-app {
  position: relative;
  width: min(100vw, 390px);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-mid) 54%, var(--sky-bottom));
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  min-height: 100%;
  padding: 18px;
}

.screen-active {
  display: grid;
  align-content: start;
  gap: 18px;
}

.top-status,
.game-hud {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  min-width: 86px;
  border-radius: 9px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--panel), var(--panel-bright));
  box-shadow: 0 12px 28px rgba(6, 33, 74, 0.22);
}

.status-pill-purple {
  background: linear-gradient(135deg, var(--panel), var(--panel-purple));
}

.status-pill span,
.summary-card span {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-pill strong,
.summary-card strong {
  display: block;
  margin-top: 2px;
  font-size: 1.2rem;
  line-height: 1;
}

.hero-panel,
.result-panel {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  overflow: hidden;
  border-radius: 28px;
  padding: 28px 22px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(27, 80, 176, 0.22));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 20px 36px rgba(7, 39, 83, 0.18);
}

.hero-panel h1,
.panel-header h2,
.result-panel h2 {
  margin: 0;
  color: #ffffff;
}

.hero-panel p,
.result-panel p {
  margin: 0;
  max-width: 270px;
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  border-radius: 999px;
  padding: 5px 10px;
  color: #17344b;
  background: rgba(255, 226, 116, 0.94);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.primary-action,
.small-action,
.ghost-action,
.end-action {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-action,
.small-action {
  color: #17344b;
  background: linear-gradient(180deg, #ffe477, var(--button));
  box-shadow: 0 10px 20px rgba(45, 71, 107, 0.2);
}

.ghost-action,
.end-action {
  color: #ffffff;
  background: rgba(43, 60, 93, 0.84);
}

.end-action {
  position: absolute;
  right: 14px;
  bottom: 16px;
  z-index: 4;
}

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

.summary-card,
.upgrade-card,
.settings-panel,
.panel-header {
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(20, 38, 83, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.bottom-nav {
  position: absolute;
  right: 12px;
  bottom: 14px;
  left: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border-radius: 18px;
  padding: 8px;
  background: rgba(20, 38, 83, 0.72);
}

.nav-item {
  min-height: 48px;
  border-radius: 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  font-size: 0.76rem;
  font-weight: 800;
}

.nav-item-active {
  color: #17344b;
  background: var(--button);
}

.nav-item-locked {
  color: rgba(255, 255, 255, 0.62);
  background: var(--locked);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-header .eyebrow {
  width: fit-content;
  margin-bottom: 5px;
}

.upgrade-list {
  display: grid;
  gap: 12px;
}

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

.upgrade-card h3,
.upgrade-card p {
  margin: 0;
}

.upgrade-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.locked-card {
  opacity: 0.68;
}

.lock-badge {
  border-radius: 999px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
}

.setting-row + .setting-row {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.game-screen {
  padding: 0;
}

.game-screen.screen-active {
  display: block;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100dvh;
  touch-action: none;
}

.game-hud {
  position: absolute;
  top: 18px;
  right: 16px;
  left: 16px;
}

.parachute-mark {
  position: relative;
  width: 88px;
  height: 90px;
}

.canopy {
  position: absolute;
  top: 2px;
  left: 9px;
  width: 70px;
  height: 34px;
  border-radius: 70px 70px 12px 12px;
  background: radial-gradient(circle at 20% 30%, #fff2a3 0 14%, transparent 15%), linear-gradient(90deg, #e73535 0 30%, #f8f1e3 30% 48%, #e73535 48% 100%);
  box-shadow: 0 4px 0 rgba(88, 42, 40, 0.22);
}

.cord,
.cord::after {
  position: absolute;
  top: 34px;
  width: 2px;
  height: 34px;
  background: rgba(255, 255, 255, 0.9);
  content: "";
}

.cord-left {
  left: 26px;
  transform: rotate(14deg);
}

.cord-right {
  right: 26px;
  transform: rotate(-14deg);
}

.runner {
  position: absolute;
  top: 60px;
  left: 35px;
  width: 18px;
  height: 24px;
  border-radius: 9px 9px 6px 6px;
  background: #2f3149;
  box-shadow: 0 -9px 0 #ffb13b, -10px 7px 0 -5px #2557a8, 10px 7px 0 -5px #2557a8;
}

.hero-cloud,
.hero-cloud::before,
.hero-cloud::after {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  content: "";
}

.hero-cloud {
  width: 108px;
  height: 26px;
}

.hero-cloud::before {
  top: -16px;
  left: 16px;
  width: 44px;
  height: 44px;
}

.hero-cloud::after {
  top: -10px;
  right: 16px;
  width: 38px;
  height: 38px;
}

.hero-cloud-left {
  left: -20px;
  bottom: 36px;
}

.hero-cloud-right {
  right: -28px;
  top: 42px;
  transform: scale(0.75);
}

.locked-nudge {
  animation: nudge 260ms ease;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@keyframes nudge {
  0%,
  100% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(-4px);
  }

  70% {
    transform: translateX(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 340px) {
  .screen {
    padding: 12px;
  }

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

/* Portfolio iframe fit: compact menu chrome without changing gameplay. */
.screen {
  height: 100%;
  min-height: 0;
  padding: clamp(12px, 2.4vh, 18px);
}

.screen-active {
  gap: clamp(10px, 2vh, 18px);
}

@media (max-height: 660px) {
  .hero-panel,
  .result-panel {
    gap: 10px;
    padding: 18px 16px;
  }

  .parachute-mark {
    width: 72px;
    height: 74px;
  }

  .status-pill {
    min-width: 76px;
    padding: 8px 10px;
  }

  .summary-card,
  .upgrade-card,
  .settings-panel,
  .panel-header {
    padding: 12px;
  }

  .bottom-nav {
    bottom: 10px;
    gap: 6px;
    padding: 6px;
  }

  .nav-item {
    min-height: 42px;
    font-size: 0.72rem;
  }
}
