html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* the game fills the window; SDL takes this size (and follows it when it changes) */
canvas {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  outline: none;
}

#fps {
  position: fixed;
  left: 6px;
  top: 6px;
  z-index: 20;
  font: 12px/1.3 ui-monospace, monospace;
  background: rgba(0, 0, 0, 0.6);
  color: #7f7;
  padding: 3px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #2a2f7e 0%, #10123a 60%, #05060f 100%);
  z-index: 10;
  transition: opacity 0.35s;
}
.overlay.gone { opacity: 0; pointer-events: none; }
.hidden { display: none !important; }

.panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
}

.logo {
  font: 900 clamp(34px, 8vw, 72px)/1 Impact, "Arial Black", "Haettenschweiler", sans-serif;
  color: #ff6600;
  letter-spacing: 1px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.logo .cross { color: #ff1a1a; margin: 0 2px; }

.progress {
  width: min(360px, 70vw);
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.progress .fill {
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff6600, #ffb03a);
  transition: width 0.2s;
}

.status { color: rgba(255, 255, 255, 0.75); font-size: 15px; min-height: 21px; }
.status.error { color: #ff8080; max-width: 520px; }

.play {
  font: 900 26px/1 "Arial Black", Impact, sans-serif;
  letter-spacing: 1px;
  color: #000;
  background: #fff;
  border: 0;
  border-radius: 999px;
  padding: 16px 42px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255, 102, 0, 0.45), 0 0 0 4px rgba(255, 255, 255, 0.15);
  animation: pulse 1.6s ease-in-out infinite;
}
.play:active { transform: scale(0.96); color: #ff2000; }
@keyframes pulse { 50% { box-shadow: 0 6px 34px rgba(255, 102, 0, 0.8), 0 0 0 8px rgba(255, 255, 255, 0.08); } }

.phone {
  width: 46px;
  height: 78px;
  border: 4px solid #fff;
  border-radius: 10px;
  animation: turn 2s ease-in-out infinite;
}
@keyframes turn { 0%, 30% { transform: rotate(0deg); } 60%, 100% { transform: rotate(-90deg); } }

/* the game's text questions (port/TextPrompt.cpp); near the top, above a phone's keyboard */
.prompt {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: max(16px, 8vh) 16px 16px;
  background: rgba(0, 0, 0, 0.55);
}
.prompt .box {
  width: min(440px, 100%);
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 12px;
  background: #fff;
  color: #111;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.prompt .title { font-weight: 700; font-size: 20px; }
.prompt .message { font-size: 15px; color: #444; }
.prompt .message:empty { display: none; }
.prompt input {
  font: inherit;
  font-size: 20px;
  padding: 8px 10px;
  border: 2px solid #ccc;
  border-radius: 8px;
  color: #111;
  background: #fff;
  -webkit-user-select: text;
  user-select: text;
  touch-action: auto;
}
.prompt input:focus { outline: none; border-color: #ff6600; }
.prompt.code input { text-transform: uppercase; letter-spacing: 3px; font-family: ui-monospace, monospace; }
.prompt .buttons { display: flex; justify-content: flex-end; gap: 8px; }
.prompt button { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 10px 20px; cursor: pointer; }
#prompt-ok { background: #ff6600; color: #fff; }
#prompt-cancel { background: #eee; color: #222; }

.option { color: rgba(255, 255, 255, 0.7); font-size: 14px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.option input { accent-color: #ff6600; width: 16px; height: 16px; }
