:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef7ff;
  color: #17324d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.95), transparent 34rem),
    linear-gradient(180deg, #e8f5ff 0%, #f7fbff 58%, #e5f2f9 100%);
}

body { padding: 18px; }

.page-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.game-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
  color: #3975a7;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.45rem);
  line-height: 1.05;
}

.utility-btn {
  border: 1px solid #b7d4e9;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  padding: 10px 15px;
  color: #17324d;
  font-weight: 750;
  cursor: pointer;
}

.game-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 360px;
  overflow: hidden;
  border: 6px solid rgba(255,255,255,.9);
  border-radius: 24px;
  background: #bfe7ff;
  box-shadow: 0 18px 50px rgba(28, 69, 99, .18);
}

#game-container,
#game-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.loading-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #244c69;
  pointer-events: none;
}

.mobile-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: none;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  z-index: 10;
}

.mobile-controls button {
  width: 58px;
  height: 58px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: rgba(20, 64, 96, .72);
  color: white;
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 5px 15px rgba(0,0,0,.2);
  touch-action: none;
  pointer-events: auto;
}

.help-text {
  margin: 12px auto 0;
  text-align: center;
  color: #42657f;
  font-size: .95rem;
}

@media (pointer: coarse), (max-width: 800px) {
  body { padding: 8px; }
  .game-header { align-items: center; }
  .utility-btn { padding: 8px 11px; font-size: .82rem; }
  .game-frame { min-height: 300px; border-radius: 16px; border-width: 4px; }
  .mobile-controls { display: flex; }
  .help-text { font-size: .82rem; }
}
