:root {
  --sky-top: #6ec1ff;
  --sky-bot: #b8e6ff;
  --ink: #1b1f2a;
  --card: #fff8e7;
  --accent: #ff5a3c;
  --accent-2: #ffc23c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 100%);
  font-family: ui-rounded, "Quicksand", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game {
  display: block;
  margin: 0 auto;
  background: linear-gradient(180deg, #87ceff 0%, #cdeeff 70%, #ffd49a 100%);
  image-rendering: pixelated;
  width: 100vw;
  max-width: 100vw;
  height: auto;
  aspect-ratio: 16 / 9;
  box-shadow: 0 0 0 4px var(--ink) inset;
}

#hud {
  position: fixed;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 5;
  pointer-events: none;
  font-weight: 700;
  font-size: 14px;
}

#hud span {
  background: rgba(27, 31, 42, 0.78);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

#hud-status {
  background: rgba(255, 90, 60, 0.85) !important;
}

#hud-status.ok {
  background: rgba(46, 160, 67, 0.85) !important;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 31, 42, 0.55);
  z-index: 10;
  backdrop-filter: blur(6px);
}

.overlay.hidden { display: none; }

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 24px 28px;
  width: min(380px, 92vw);
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.18), 0 0 0 4px var(--ink);
}

.card h1 {
  margin: 0 0 4px 0;
  font-size: 28px;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.card .sub {
  margin: 0 0 16px 0;
  font-size: 14px;
  line-height: 1.45;
}

.card label {
  display: block;
  margin: 10px 0;
  font-size: 13px;
  font-weight: 700;
}

.card input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
}

.card input:focus {
  outline: none;
  border-color: var(--accent);
}

.card button {
  margin-top: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.06s;
}

.card button:hover { background: #ff7159; }
.card button:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }

.card .hint {
  font-size: 12px;
  margin: 10px 0 0 0;
  opacity: 0.7;
}

#touch {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 6;
}

#touch.touch-hidden { display: none; }

.t-btn {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: rgba(255, 248, 231, 0.85);
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
}

.t-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }

.t-btn.jump { background: var(--accent-2); }

@media (pointer: coarse) {
  #touch { display: flex !important; }
}

/* Two side-by-side left-right + jump on right */
#touch .t-btn:nth-child(1),
#touch .t-btn:nth-child(2) {
  margin-right: 12px;
}
#touch .jump { margin-left: auto; }
