:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  touch-action: manipulation;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 0;
  background: radial-gradient(circle at 50% 15%, #3c7fc8 0, #173a64 48%, #0b1d35 100%);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
}
.game-shell { text-align: center; }
.game {
  position: relative;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  width: min(92vw, 420px);
  aspect-ratio: 21 / 34;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, .75);
  border-radius: 24px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, .4), inset 0 0 0 2px rgba(14, 52, 90, .25);
  background: #74c9ef;
}
canvas { display: block; width: 100%; height: 100%; }
.hud {
  position: absolute;
  z-index: 2;
  top: 24px;
  left: 0;
  width: 100%;
  color: white;
  font-size: clamp(2.4rem, 9vw, 4.2rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 3px 0 #305a75, 0 5px 10px rgba(0,0,0,.25);
  pointer-events: none;
}
.message {
  position: absolute;
  z-index: 3;
  left: 50%; top: 44%;
  width: 84%;
  transform: translate(-50%, -50%);
  padding: 22px 14px;
  color: #153350;
  background: rgba(255,255,255,.89);
  border: 3px solid white;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(14, 60, 96, .24);
}
.message.hidden { display: none; }
h1 { margin: 0 0 8px; font-size: 2.1rem; }
p { margin: 0; font-weight: 700; line-height: 1.35; }
button {
  margin-top: 17px; padding: 11px 26px; border: 0; border-radius: 999px;
  background: #f7a92e; color: #fff; font: inherit; font-weight: 900; font-size: 1rem;
  cursor: pointer; box-shadow: 0 4px 0 #c87217; transition: transform .15s;
}
button:hover { transform: translateY(-2px); }
button:active { transform: translateY(2px); box-shadow: 0 2px 0 #c87217; }
.game-navigation { position: absolute; z-index: 4; top: 12px; left: 12px; right: 12px; text-align: left; pointer-events: none; }
#backButton { margin-top: 0; min-height: 44px; padding: 10px 14px; font-size: .9rem; pointer-events: auto; }
#backButton:focus-visible { outline: 3px solid white; outline-offset: 4px; }
.back-status { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(11, 29, 53, .9); color: white; font-size: .9rem; }
.back-status:empty { display: none; }
.tip { margin: 16px 0 0; color: rgba(255,255,255,.8); font-size: .92rem; }
