:root {
  --bg-0: #f9edd3;
  --bg-1: #f5c98f;
  --ink: #3b2410;
  --panel: #fff7ebcc;
  --accent: #f06a27;
  --danger: #9f1919;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 10%, var(--bg-0), var(--bg-1));
}

body {
  display: grid;
  place-items: center;
  padding: 16px;
}

.app-shell {
  width: min(100%, 460px);
  display: grid;
  gap: 14px;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 2px solid #0000001f;
  border-radius: 12px;
  background: var(--panel);
}

.hud-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.hud-label {
  opacity: 0.7;
  font-size: 0.95rem;
}

.stage-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #00000024;
  background: #f6b678;
  min-height: 220px;
}

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

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 18px;
  background: #f7e5ccde;
}

.overlay.visible {
  display: flex;
}

.overlay h1,
.overlay h2,
.overlay p {
  margin: 0;
}

.overlay input,
.overlay button {
  font: inherit;
  border-radius: 9px;
  border: 1px solid #00000033;
  padding: 10px 12px;
}

.overlay button {
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: 0;
  min-width: 140px;
}

.overlay.death {
  background: transparent;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 24px;
}

.overlay.death.waiting {
  background: transparent;
}

.overlay.death button {
  background: var(--danger);
  font-size: 1.2rem;
  min-width: 180px;
  padding: 14px 20px;
  border-radius: 12px;
}

.tiny {
  font-size: 0.86rem;
  opacity: 0.8;
}

@media (max-width: 720px) {
  body {
    padding: 10px;
  }

  .hud {
    padding: 8px 10px;
  }

  .stage-wrap {
    border-radius: 10px;
  }

  .overlay {
    gap: 10px;
  }
}
