:root {
  --bg-1: #0b132b;
  --bg-2: #1c2541;
  --accent: #5bc0be;
  --accent-2: #ffd166;
  --text: #f7fff7;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, #243b64 0%, transparent 40%),
    radial-gradient(circle at 90% 20%, #1f3559 0%, transparent 35%),
    linear-gradient(155deg, var(--bg-1), var(--bg-2));
  min-height: 100%;
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  gap: 14px;
}

.hud {
  width: min(96vw, 1020px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  margin: 0;
  letter-spacing: 0.4px;
}

.stats {
  display: flex;
  gap: 12px;
  font-size: 0.95rem;
}

.game-shell {
  position: relative;
  width: min(96vw, 1020px);
  display: grid;
  place-items: center;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

canvas {
  display: block;
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: calc(100vh - 220px);
  background:
    radial-gradient(circle at 50% -30%, rgba(255, 255, 255, 0.25), transparent 35%),
    linear-gradient(#0f1d3a, #111827);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 18px;
  text-align: center;
  backdrop-filter: blur(2px);
  background: rgba(7, 10, 20, 0.56);
}

.overlay.hidden {
  display: none;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(145deg, var(--accent), #7fd8d6);
  color: #062628;
}

button:active {
  transform: scale(0.98);
}

.controls {
  width: min(96vw, 1020px);
  display: none;
  justify-content: space-between;
}

.controls button {
  min-width: 42%;
  font-size: 1.15rem;
  padding: 12px 0;
  background: linear-gradient(145deg, var(--accent-2), #ffe8a2);
  color: #352600;
}

@media (max-width: 860px) {
  .controls {
    display: flex;
  }
}

body.embedded .app {
  min-height: 100dvh;
  height: 100dvh;
  padding: 0;
  gap: 0;
}

body.embedded .hud {
  display: none;
}

html.embedded,
body.embedded {
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

body.embedded .game-shell {
  width: 100vw;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.embedded canvas {
  width: 100vw;
  height: 56.25vw;
  max-width: 177.78dvh;
  max-height: 100dvh;
}

body.embedded .controls {
  display: none !important;
}
