html, body {
  margin: 0;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  width: 100%;
  height: 100%;
  background: #1a2e1a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* --- landscape presentation ------------------------------------------------
   #stage holds the whole game (canvas + HUD + screens + ad anchor). Its px
   size and transform are set from JS (see applyPresentation() in game.js):
   - already-landscape / desktop viewport -> width=innerWidth, height=innerHeight,
     no transform at all, i.e. identical to how the game rendered before.
   - portrait phone -> width=innerHeight, height=innerWidth, rotated 90deg so the
     game fills the screen as a landscape play area. Because #stage is a
     transformed ancestor, every position:fixed child (canvas, HUD, .screen
     overlays, the shared ad overlays) is positioned against #stage instead of
     the viewport, so the whole presentation rotates as one piece.
   JUMPER's only input is hold/release with no pointer coordinates used
   anywhere, so no touch remapping is needed. */
#stage {
  position: fixed;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  overflow: hidden;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #7ec8e3;
}

body {
  font-family: -apple-system, "Segoe UI", "Courier New", monospace;
}

#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 18px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  z-index: 5;
  pointer-events: none;
}

#score {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #1a4d2e, 0 0 10px rgba(0,0,0,0.3);
}

#dist.sub {
  font-size: 15px;
  font-weight: 700;
  color: #eafff0;
  background: rgba(0,0,0,0.25);
  padding: 3px 8px;
  border-radius: 6px;
}

#best {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: #eafff0;
  background: rgba(0,0,0,0.3);
  padding: 4px 8px;
  border-radius: 6px;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, #7ec8e3 0%, #cdeedd 55%, #4a8f5c 100%);
  z-index: 10;
}

.title {
  font-family: "Courier New", monospace;
  font-weight: 900;
  font-size: 50px;
  letter-spacing: 3px;
  color: #ff6b35;
  text-shadow: 3px 3px 0 #7a2600, 0 0 16px rgba(255,107,53,0.3);
  margin: 0;
}

.title.small { font-size: 36px; color: #d43b3b; text-shadow: 3px 3px 0 #5c0000; }

.subtitle {
  color: #16401f;
  font-size: 14px;
  max-width: 320px;
  line-height: 1.5;
  margin: 0;
  font-weight: 600;
}

.bestLine {
  color: #16401f;
  font-weight: 800;
  font-size: 14px;
  background: rgba(255,255,255,0.5);
  padding: 6px 14px;
  border-radius: 8px;
  margin: 0;
}

.resultLine {
  color: #16401f;
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.roast {
  color: rgba(22,64,31,0.55);
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  margin: 0;
}

.cta {
  margin-top: 10px;
  font-family: inherit;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 1px;
  color: #fff;
  background: #ff6b35;
  border: none;
  border-radius: 16px;
  padding: 18px 36px;
  box-shadow: 0 6px 0 #b8471a, 0 8px 18px rgba(0,0,0,0.3);
  animation: pulse 1.1s ease-in-out infinite;
}

.cta:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b8471a;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.hidden { display: none; }

/* rotate cue — only shown briefly, on the title screen, when we had to
   rotate the presentation ourselves */
#rotateHint {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(0,0,0,0.62);
  color: #fff8ee;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  animation: hintFade 0.4s ease-out;
}
@keyframes hintFade { from { opacity: 0; } to { opacity: 1; } }

/* --- desktop keyboard hint (PC support, additive) --- */
.kbd-hint{display:none;}
@media (hover: hover) and (pointer: fine){
  .kbd-hint{display:block;}
}
.kbd-hint{color:#16401f;font-size:12px;font-weight:700;letter-spacing:1px;margin:0;opacity:.75;}

/* The shared ad anchor is a fixed band at the top of #stage (it positions
   against #stage because #stage is a transformed ancestor, so it rotates with
   the presentation). Screen content must clear that band or a real banner
   creative lands on top of the title. Measured overlap before this: 45x198px
   on the JUMPER title in the rotated portrait presentation. */
.screen {
  padding-top: calc(24px + var(--thela-ad-band, 96px));
  box-sizing: border-box;
}

