* { box-sizing: border-box; }

:root {
  --yellow: #ffd84d;
  --purple: #5724bd;
  --purple-dark: #20124d;
  --white: #fff;
  --shadow: rgba(15, 10, 45, .26);
}

html, body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 216, 77, .35), transparent 26rem),
    linear-gradient(135deg, #16204f, #5724bd 68%, #ca36d8);
  color: white;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  font-weight: 900;
}

.back-button {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 50;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--yellow);
  color: #4a2500;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 10px 24px var(--shadow);
}

.page-shell {
  width: 100vw;
  height: 100dvh;
  display: grid;
  place-items: center;
}

.hidden { display: none !important; }

.start-screen,
.win-screen {
  width: min(94vw, 720px);
  text-align: center;
}

.start-card,
.win-card {
  padding: clamp(22px, 4vw, 42px);
  border-radius: 34px;
  background: rgba(255, 255, 255, .18);
  box-shadow: 0 22px 48px var(--shadow);
  backdrop-filter: blur(12px);
}

.start-pulga,
.win-pulga {
  height: clamp(130px, 28vw, 220px);
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.22));
}

.eyebrow {
  display: inline-block;
  margin: 8px 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--yellow);
  color: #4a2500;
  font-weight: 900;
}

h1, h2 {
  margin: 8px 0;
  line-height: .95;
  font-size: clamp(3rem, 10vw, 6rem);
  text-shadow: 0 12px 24px rgba(0,0,0,.18);
}

.start-card p,
.win-card p {
  max-width: 520px;
  margin: 12px auto 18px;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.start-card button,
.win-card button {
  padding: 16px 28px;
  border-radius: 999px;
  background: var(--yellow);
  color: #4a2500;
  box-shadow: 0 12px 24px var(--shadow);
}

.start-card small {
  display: block;
  margin-top: 14px;
  opacity: .82;
}

.game-wrap {
  position: relative;
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100vw * 9 / 16));
  background: #14244a;
  overflow: hidden;
  border-radius: clamp(0px, 2vw, 22px);
  box-shadow: 0 20px 44px rgba(0,0,0,.25);
}

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

.hud {
  position: absolute;
  z-index: 10;
  inset: 12px 12px auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.hud div,
.hud button {
  min-width: 86px;
  padding: 9px 13px;
  border-radius: 18px;
  background: rgba(255,255,255,.85);
  color: #2c166f;
  text-align: center;
  box-shadow: 0 10px 20px rgba(0,0,0,.16);
}

.hud span {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .76;
}

.hud strong {
  display: block;
  font-size: 1.18rem;
}

.hud button {
  min-width: 44px;
  pointer-events: auto;
}

.mobile-controls {
  position: absolute;
  z-index: 12;
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

#jumpBtn {
  pointer-events: auto;
  min-width: 180px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--yellow);
  color: #4a2500;
  box-shadow: 0 12px 25px rgba(0,0,0,.22);
}

@media (max-width: 700px) {
  .back-button {
    top: 10px;
    left: 10px;
    padding: 9px 12px;
    font-size: .86rem;
  }

  .hud {
    inset: 8px 8px auto 8px;
    justify-content: flex-end;
    gap: 6px;
  }

  .hud div {
    min-width: 64px;
    padding: 7px 9px;
  }

  .hud button {
    min-width: 38px;
    padding: 7px 9px;
  }

  .hud strong { font-size: .98rem; }
  .hud span { font-size: .62rem; }

  #jumpBtn {
    min-width: 150px;
    padding: 12px 20px;
  }
}
