* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 25%, #253044 0%, #111722 42%, #080b11 100%);
  color: #e9eef7;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.game-panel {
  width: min(1100px, 100%);
}

#game-container {
  width: 100%;
  min-height: 620px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(4, 8, 14, .48);
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}

#game-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(15, 20, 29, .82);
  backdrop-filter: blur(8px);
}

.hud-group {
  white-space: nowrap;
}

.status {
  flex: 1;
  color: #c8d4e7;
}

#restart-btn {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  padding: 9px 14px;
  background: #263248;
  color: white;
  cursor: pointer;
}

#restart-btn:hover {
  background: #33425e;
}

.help {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 4px 0;
  color: #9eabc0;
  font-size: .93rem;
}

.level-select-grid button.current-level {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  transform: scale(1.08);
}

@media (max-width: 920px) {
  .app-shell {
    padding: 6px;
  }

  #game-container {
    min-height: 0;
    height: 56vh;
    max-height: 520px;
    border-radius: 12px;
  }

  .hud {
    flex-wrap: wrap;
  }

  .status {
    order: 3;
    flex-basis: 100%;
  }
}

@media (
  max-width: 920px
) and (
  orientation: landscape
) {

  .app-shell {
    min-height: 100dvh;
    padding: 4px;
    place-items: start center;
  }

#game-container {
  width: 100%;
  min-height: 0;
  max-height: none;
  border-radius: 10px;
}
}
